diff options
Diffstat (limited to 'libtomcrypt/src/hashes/rmd320.c')
-rw-r--r-- | libtomcrypt/src/hashes/rmd320.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libtomcrypt/src/hashes/rmd320.c b/libtomcrypt/src/hashes/rmd320.c index 858d7bb..a4356c4 100644 --- a/libtomcrypt/src/hashes/rmd320.c +++ b/libtomcrypt/src/hashes/rmd320.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" @@ -20,11 +18,12 @@ const struct ltc_hash_descriptor rmd320_desc = { "rmd320", - 9, + 14, 40, 64, - /* OID */ + /* OID ... does not exist + * http://oid-info.com/get/1.3.36.3.2 */ { 0 }, 0, @@ -432,8 +431,8 @@ int rmd320_test(void) return CRYPT_NOP; #else static const struct { - char *msg; - unsigned char md[40]; + const char *msg; + unsigned char hash[40]; } tests[] = { { "", { 0x22, 0xd6, 0x5d, 0x56, 0x61, 0x53, 0x6c, 0xdc, 0x75, 0xc1, @@ -472,18 +471,16 @@ int rmd320_test(void) 0xbc, 0x74, 0x70, 0xa9, 0x69, 0xc9, 0xd0, 0x72, 0xa1, 0xac } } }; - int x; - unsigned char buf[40]; + + int i; + unsigned char tmp[40]; hash_state md; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { rmd320_init(&md); - rmd320_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); - rmd320_done(&md, buf); - if (XMEMCMP(buf, tests[x].md, 40) != 0) { -#if 0 - printf("Failed test %d\n", x); -#endif + rmd320_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg)); + rmd320_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD320", i)) { return CRYPT_FAIL_TESTVECTOR; } } @@ -493,3 +490,6 @@ int rmd320_test(void) #endif +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ |