diff --git a/ChangeLog b/ChangeLog index ad89c2ec51dfa0dfa4040a1afc3691053a8966fc..09a744f82f89a097844a98d57e7835601cdc31f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-06 Niels Möller <nisse@lysator.liu.se> + + From Edgar E. Iglesias: + * sha3.c (_sha3_update): Fix condition for when the block buffer + is full. + 2013-04-04 Niels Möller <nisse@lysator.liu.se> * ecc-point.c (ecc_point_get): Allow NULL x or y, ignore diff --git a/sha3.c b/sha3.c index d7aec46eced5a91a51ed7dad513fe2e3c1d8ff89..21e7beb72e3886743cb1216a5f220e14ef1fc23f 100644 --- a/sha3.c +++ b/sha3.c @@ -61,7 +61,7 @@ _sha3_update (struct sha3_state *state, if (pos > 0) { unsigned left = block_size - pos; - if (length < pos) + if (length < left) { memcpy (block + pos, data, length); return pos + length;