[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nettle-bugs
Subject:    Re: [PATCH] sha3: Correct _sha3_update for incremental hashing
From:       nisse () lysator ! liu ! se (Niels =?iso-8859-1?Q?M=F6ller?=)
Date:       2013-04-06 9:33:01
Message-ID: nnli8watrm.fsf () stalhein ! lysator ! liu ! se
[Download RAW message or body]

edgar.iglesias@gmail.com writes:

> diff --git a/sha3.c b/sha3.c
> index d7aec46..21e7beb 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;

Thanks, checked in now. Unfortunately, testutils.c:test_hash doesn't
exercise this logic.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic