diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2013-09-18 14:21:13 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-09-18 14:32:20 +0200 |
commit | b0579baaa04fb91eabbbdc295bcabea04cf84056 (patch) | |
tree | cb29c9defb3d1aedcb90dec639ce5d22ddc9fb96 /tests/basic.c | |
parent | ecde77ad98690540abb21db08e5531297ed72bd0 (diff) | |
download | libgcrypt-b0579baaa04fb91eabbbdc295bcabea04cf84056.tar.gz |
Add basic implementation of GOST R 34.11-94 message digest
* src/gcrypt.h.in (GCRY_MD_GOSTR3411_94): New.
* cipher/gostr3411-94.c: New.
* configure.ac (available_digests): Add gostr3411-94.
* src/cipher.h: Add gostr3411-94 definitions.
* cipher/md.c: Register GOST R 34.11-94.
* tests/basic.c (check_digests): Add 4 tests for GOST R 34.11-94
hash algo. Two are defined in the standard itself, two other are
more or less common tests - an empty string an exclamation mark.
* doc/gcrypt.texi: Add an entry describing GOST R 34.11-94 to the MD
algorithms table.
--
Add simple implementation of GOST R 34.11-94 hash function. Currently
there is no way to specify hash parameters (it always uses GOST R 34.11-94
test parameters).
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Stack burn value in gost3411_init added by wk.
Diffstat (limited to 'tests/basic.c')
-rw-r--r-- | tests/basic.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/basic.c b/tests/basic.c index 527c8ae9..07d38fa4 100644 --- a/tests/basic.c +++ b/tests/basic.c @@ -2816,7 +2816,25 @@ check_digests (void) "\x29\x05\x7F\xD8\x6B\x20\xBF\xD6\x2D\xEC\xA0\xF1\xCC\xEA\x4A\xF5" "\x1F\xC1\x54\x90\xED\xDC\x47\xAF\x32\xBB\x2B\x66\xC3\x4F\xF9\xAD" "\x8C\x60\x08\xAD\x67\x7F\x77\x12\x69\x53\xB2\x26\xE4\xED\x8B\x01" }, - { 0 }, +#ifdef USE_GOST_R_3411_94 + { GCRY_MD_GOSTR3411_94, + "This is message, length=32 bytes", + "\xB1\xC4\x66\xD3\x75\x19\xB8\x2E\x83\x19\x81\x9F\xF3\x25\x95\xE0" + "\x47\xA2\x8C\xB6\xF8\x3E\xFF\x1C\x69\x16\xA8\x15\xA6\x37\xFF\xFA" }, + { GCRY_MD_GOSTR3411_94, + "Suppose the original message has length = 50 bytes", + "\x47\x1A\xBA\x57\xA6\x0A\x77\x0D\x3A\x76\x13\x06\x35\xC1\xFB\xEA" + "\x4E\xF1\x4D\xE5\x1F\x78\xB4\xAE\x57\xDD\x89\x3B\x62\xF5\x52\x08" }, + { GCRY_MD_GOSTR3411_94, + "", + "\xCE\x85\xB9\x9C\xC4\x67\x52\xFF\xFE\xE3\x5C\xAB\x9A\x7B\x02\x78" + "\xAB\xB4\xC2\xD2\x05\x5C\xFF\x68\x5A\xF4\x91\x2C\x49\x49\x0F\x8D" }, + { GCRY_MD_GOSTR3411_94, + "!", + "\x5C\x00\xCC\xC2\x73\x4C\xDD\x33\x32\xD3\xD4\x74\x95\x76\xE3\xC1" + "\xA7\xDB\xAF\x0E\x7E\xA7\x4E\x9F\xA6\x02\x41\x3C\x90\xA1\x29\xFA" }, +#endif + { 0 } }; int i; |