On Thu, Nov 28, 2013 at 06:38:47AM +0100, Niels Möller wrote:
> You must call sha1_init(&hash_ctx) before the first sha1_update.

Erm, yes. Sorry, the real code has this :)

> > Does doing the sha1_digest alter state in some way? I can't image it is, but
> > then how does this behavior crop up?
> 
> sha1_digest implies a sha1_init. So with sha1_digest(...);
> sha1_digest(...), the second call gives you the sha1 digest of the empty
> string. I think this is explained in the manual,
> http://www.lysator.liu.se/~nisse/nettle/nettle.html#Legacy-hash-functions

Erm, so it is. Sorry 'bout that. Thanks!

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

Cheers,
  Paul

-- 
 .''`.  Paul Tagliamonte <[email protected]>
: :'  : Proud Debian Developer
`. `'`  4096R / 8F04 9AD8 2C92 066C 7352  D28A 7B58 5B30 807C 2A87
 `-     http://people.debian.org/~paultag

Attachment: signature.asc
Description: Digital signature

_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to