Commit Graph

8 Commits

Author SHA1 Message Date
Olivier Chéron
caec601cd1 Add finalize_prefix functions 2020-06-26 07:16:30 +02:00
Nicolas DI PRIMA
002f300021 add fastpbkdf2 with sha512 2017-02-11 14:08:27 +00:00
Mikael Bung
0ca7afcb87 [SECURITY] Fix a buffer overflow in SHA384
Caused by a difference in the size of the digest
byte array allocated on Haskell side and the
amount of bytes copied to it on the C side.

In cbits/cryptonite_sha512.c:cryptonite_sha384_finalize
SHA384_DIGEST_SIZE bytes is copied into the out buffer.
SHA384_DIGEST_SIZE is #defined as 64 in cbits/cryptonite_sha512.h
while the buffer given will have size 48, as defined in
Crypto/Hash/SHA384.hs.

Defining SHA384_DIGEST_SIZE as 48 fixes the issue.
2016-02-21 09:23:36 +00:00
Vincent Hanquez
69f9d225eb [hash] trim hash algorithm with multiple output size.
The output size is now passed by parameter to the finalize function
instead of being stored in the context. that simplify quite a
bit the passing of this parameter
2015-11-19 11:52:21 +00:00
Vincent Hanquez
ad285be68c [Hash] tweak internal C API to have the hashlen 2015-11-19 11:37:38 +00:00
Vincent Hanquez
81e335cfff [HASH] re-enable SHA512t 2015-05-06 07:53:51 +01:00
Vincent Hanquez
488bc980aa [hash] mark update function buffer as const 2015-04-18 12:20:38 +01:00
Vincent Hanquez
09feb59f62 merge cryptohash 2014-07-07 14:55:55 +01:00