aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorAdrian-Ken Rueegsegger <rueegsegger@swiss-it.ch>2008-05-07 10:16:36 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 08:35:10 -0400
commitfd4adf1a0b1923f6126835e1097b2997eb0d27e2 (patch)
treef670130dc1fbd42d197c4d49061a4bcb993fe68e /crypto/tcrypt.c
parentc6580eb8b17d64f0d6ad25c86a034adbda5ab4e1 (diff)
[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: 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.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index e47f6e02133c..f6220b351977 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -13,6 +13,7 @@
13 * Software Foundation; either version 2 of the License, or (at your option) 13 * Software Foundation; either version 2 of the License, or (at your option)
14 * any later version. 14 * any later version.
15 * 15 *
16 * 2008-04-27 Added RIPEMD tests
16 * 2007-11-13 Added GCM tests 17 * 2007-11-13 Added GCM tests
17 * 2007-11-13 Added AEAD support 18 * 2007-11-13 Added AEAD support
18 * 2007-11-06 Added SHA-224 and SHA-224-HMAC tests 19 * 2007-11-06 Added SHA-224 and SHA-224-HMAC tests
@@ -83,7 +84,7 @@ static char *check[] = {
83 "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", 84 "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
84 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 85 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
85 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", 86 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
86 "camellia", "seed", "salsa20", "lzo", "cts", NULL 87 "camellia", "seed", "salsa20", "rmd128", "rmd160", "lzo", "cts", NULL
87}; 88};
88 89
89static void hexdump(unsigned char *buf, unsigned int len) 90static void hexdump(unsigned char *buf, unsigned int len)
@@ -1615,6 +1616,14 @@ static void do_test(void)
1615 CTS_MODE_DEC_TEST_VECTORS); 1616 CTS_MODE_DEC_TEST_VECTORS);
1616 break; 1617 break;
1617 1618
1619 case 39:
1620 test_hash("rmd128", rmd128_tv_template, RMD128_TEST_VECTORS);
1621 break;
1622
1623 case 40:
1624 test_hash("rmd160", rmd160_tv_template, RMD160_TEST_VECTORS);
1625 break;
1626
1618 case 100: 1627 case 100:
1619 test_hash("hmac(md5)", hmac_md5_tv_template, 1628 test_hash("hmac(md5)", hmac_md5_tv_template,
1620 HMAC_MD5_TEST_VECTORS); 1629 HMAC_MD5_TEST_VECTORS);
@@ -1650,6 +1659,16 @@ static void do_test(void)
1650 XCBC_AES_TEST_VECTORS); 1659 XCBC_AES_TEST_VECTORS);
1651 break; 1660 break;
1652 1661
1662 case 107:
1663 test_hash("hmac(rmd128)", hmac_rmd128_tv_template,
1664 HMAC_RMD128_TEST_VECTORS);
1665 break;
1666
1667 case 108:
1668 test_hash("hmac(rmd160)", hmac_rmd160_tv_template,
1669 HMAC_RMD160_TEST_VECTORS);
1670 break;
1671
1653 case 200: 1672 case 200:
1654 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, 1673 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
1655 speed_template_16_24_32); 1674 speed_template_16_24_32);
@@ -1788,6 +1807,14 @@ static void do_test(void)
1788 test_hash_speed("sha224", sec, generic_hash_speed_template); 1807 test_hash_speed("sha224", sec, generic_hash_speed_template);
1789 if (mode > 300 && mode < 400) break; 1808 if (mode > 300 && mode < 400) break;
1790 1809
1810 case 314:
1811 test_hash_speed("rmd128", sec, generic_hash_speed_template);
1812 if (mode > 300 && mode < 400) break;
1813
1814 case 315:
1815 test_hash_speed("rmd160", sec, generic_hash_speed_template);
1816 if (mode > 300 && mode < 400) break;
1817
1791 case 399: 1818 case 399:
1792 break; 1819 break;
1793 1820