Add BLAKE2b and BLAKE2s hash algorithms (RFC 7693)
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 26 Feb 2017 17:55:34 +0000 (19:55 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 27 Feb 2017 19:10:45 +0000 (21:10 +0200)
commit5bd530b8a4624f101b8d42e68f1b28bcc13f4f76
treea2ff2c0e5225d25cef04aba77de74a81792da782
parentda213db2c6cda6f57e5853e8c591d69bfa1cfa74
Add BLAKE2b and BLAKE2s hash algorithms (RFC 7693)

* cipher/blake2.c: New.
* cipher/Makefile.am: Add 'blake2.c'.
* cipher/md.c (digest_list, prepare_macpads): Add BLAKE2.
(md_setkey): New.
(_gcry_md_setkey): Call 'md_setkey' for non-HMAC md.
* configure.ac: Add BLAKE2 digest.
* doc/gcrypt.texi: Add BLAKE2.
* src/cipher.h (_gcry_blake2_init_with_key)
(_gcry_digest_spec_blake2b_512, _gcry_digest_spec_blake2b_384)
(_gcry_digest_spec_blake2b_256, _gcry_digest_spec_blake2b_160)
(_gcry_digest_spec_blake2s_256, _gcry_digest_spec_blake2s_224)
(_gcry_digest_spec_blake2s_160, _gcry_digest_spec_blake2s_128): New.
* src/gcrypt.h.in (GCRY_MD_BLAKE2B_512, GCRY_MD_BLAKE2B_384)
(GCRY_MD_BLAKE2B_256, GCRY_MD_BLAKE2B_160, GCRY_MD_BLAKE2S_256)
(GCRY_MD_BLAKE2S_224, GCRY_MD_BLAKE2S_160, GCRY_MD_BLAKE2S_128): New.
* tests/basic.c (check_one_md): Add testing for keyed hashes.
(check_digests): Add BLAKE2 test vectors; Add testing for keyed hashes.
* tests/blake2b.h: New.
* tests/blake2s.h: New.
* tests/Makefile.am: Add 'blake2b.h' and 'blake2s.h'.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/Makefile.am
cipher/blake2.c [new file with mode: 0644]
cipher/md.c
configure.ac
doc/gcrypt.texi
src/cipher.h
src/gcrypt.h.in
tests/Makefile.am
tests/basic.c
tests/blake2b.h [new file with mode: 0644]
tests/blake2s.h [new file with mode: 0644]