Commit fd4adf1a authored by Adrian-Ken Rueegsegger's avatar Adrian-Ken Rueegsegger Committed by Herbert Xu

[CRYPTO] tcrypt: Add test vectors for RIPEMD-128 and RIPEMD-160

This patch adds test vectors for RIPEMD-128 and
RIPEMD-160 hash algorithms and digests (HMAC).

The test vectors are taken from ISO:IEC 10118-3 (2004)
and RFC2286.
Signed-off-by: default avatarAdrian-Ken Rueegsegger <rueegsegger@swiss-it.ch>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c6580eb8
......@@ -13,6 +13,7 @@
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* 2008-04-27 Added RIPEMD tests
* 2007-11-13 Added GCM tests
* 2007-11-13 Added AEAD support
* 2007-11-06 Added SHA-224 and SHA-224-HMAC tests
......@@ -83,7 +84,7 @@ static char *check[] = {
"blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
"cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
"camellia", "seed", "salsa20", "lzo", "cts", NULL
"camellia", "seed", "salsa20", "rmd128", "rmd160", "lzo", "cts", NULL
};
static void hexdump(unsigned char *buf, unsigned int len)
......@@ -1615,6 +1616,14 @@ static void do_test(void)
CTS_MODE_DEC_TEST_VECTORS);
break;
case 39:
test_hash("rmd128", rmd128_tv_template, RMD128_TEST_VECTORS);
break;
case 40:
test_hash("rmd160", rmd160_tv_template, RMD160_TEST_VECTORS);
break;
case 100:
test_hash("hmac(md5)", hmac_md5_tv_template,
HMAC_MD5_TEST_VECTORS);
......@@ -1650,6 +1659,16 @@ static void do_test(void)
XCBC_AES_TEST_VECTORS);
break;
case 107:
test_hash("hmac(rmd128)", hmac_rmd128_tv_template,
HMAC_RMD128_TEST_VECTORS);
break;
case 108:
test_hash("hmac(rmd160)", hmac_rmd160_tv_template,
HMAC_RMD160_TEST_VECTORS);
break;
case 200:
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
speed_template_16_24_32);
......@@ -1788,6 +1807,14 @@ static void do_test(void)
test_hash_speed("sha224", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
case 314:
test_hash_speed("rmd128", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
case 315:
test_hash_speed("rmd160", sec, generic_hash_speed_template);
if (mode > 300 && mode < 400) break;
case 399:
break;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment