aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorAdrian-Ken Rueegsegger <rueegsegger@swiss-it.ch>2008-05-09 09:29:35 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 08:35:13 -0400
commit2998db37b5c62890ff1a0d48abd76ada13ebc554 (patch)
tree46cc2af8c275949e7e0ea9b093658354b79672b2 /crypto/tcrypt.c
parentc555c28d9da517579085a00fc80e725b0b5d9fce (diff)
[CRYPTO] tcrypt: Add test vectors for RIPEMD-256 and RIPEMD-320
This patch adds test vectors for RIPEMD-256 and RIPEMD-320 hash algorithms. The test vectors are taken from <http://homes.esat.kuleuven.be/~bosselae/ripemd160.html> Signed-off-by: Adrian-Ken Rueegsegger <rueegsegger@swiss-it.ch> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 69eb29e1a53b..e0ea4d53f25e 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -76,7 +76,8 @@ static char *check[] = {
76 "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", 76 "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
77 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 77 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
78 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", 78 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
79 "camellia", "seed", "salsa20", "rmd128", "rmd160", "lzo", "cts", NULL 79 "camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320",
80 "lzo", "cts", NULL
80}; 81};
81 82
82static void hexdump(unsigned char *buf, unsigned int len) 83static void hexdump(unsigned char *buf, unsigned int len)
@@ -1559,7 +1560,7 @@ static void do_test(void)
1559 case 29: 1560 case 29:
1560 test_hash("tgr128", tgr128_tv_template, TGR128_TEST_VECTORS); 1561 test_hash("tgr128", tgr128_tv_template, TGR128_TEST_VECTORS);
1561 break; 1562 break;
1562 1563
1563 case 30: 1564 case 30:
1564 test_cipher("ecb(xeta)", ENCRYPT, xeta_enc_tv_template, 1565 test_cipher("ecb(xeta)", ENCRYPT, xeta_enc_tv_template,
1565 XETA_ENC_TEST_VECTORS); 1566 XETA_ENC_TEST_VECTORS);
@@ -1632,6 +1633,14 @@ static void do_test(void)
1632 test_hash("rmd160", rmd160_tv_template, RMD160_TEST_VECTORS); 1633 test_hash("rmd160", rmd160_tv_template, RMD160_TEST_VECTORS);
1633 break; 1634 break;
1634 1635
1636 case 41:
1637 test_hash("rmd256", rmd256_tv_template, RMD256_TEST_VECTORS);
1638 break;
1639
1640 case 42:
1641 test_hash("rmd320", rmd320_tv_template, RMD320_TEST_VECTORS);
1642 break;
1643
1635 case 100: 1644 case 100:
1636 test_hash("hmac(md5)", hmac_md5_tv_template, 1645 test_hash("hmac(md5)", hmac_md5_tv_template,
1637 HMAC_MD5_TEST_VECTORS); 1646 HMAC_MD5_TEST_VECTORS);
@@ -1823,6 +1832,14 @@ static void do_test(void)
1823 test_hash_speed("rmd160", sec, generic_hash_speed_template); 1832 test_hash_speed("rmd160", sec, generic_hash_speed_template);
1824 if (mode > 300 && mode < 400) break; 1833 if (mode > 300 && mode < 400) break;
1825 1834
1835 case 316:
1836 test_hash_speed("rmd256", sec, generic_hash_speed_template);
1837 if (mode > 300 && mode < 400) break;
1838
1839 case 317:
1840 test_hash_speed("rmd320", sec, generic_hash_speed_template);
1841 if (mode > 300 && mode < 400) break;
1842
1826 case 399: 1843 case 399:
1827 break; 1844 break;
1828 1845