JuliaCrypto / Nettle.jl

Julia wrapper around nettle cryptographic hashing/encryption library providing MD5, SHA1, SHA2 hashing and HMAC functionality, as well as AES encryption/decryption
Other
51 stars 34 forks source link

Cloning hash state #89

Closed rausm closed 5 years ago

rausm commented 7 years ago

Hi,

I needed to copy the hashing state (avoiding recomputation for common prefixes). Following worked well, and I'd like it to be included (IMO commonly supported functionality).

copy(hsh:: Hasher) = Hasher(hsh.hash_type, copy(hsh.state))

Thanks.

edit: ping @staticfloat

staticfloat commented 5 years ago

Feel free to open a PR with suggestions for improvements!