aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorAndrew Donofrio <linuxbugzilla@kriptik.org>2006-12-09 20:10:20 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-02-06 17:20:58 -0500
commita28091ae170cd06695bf461905c5b97a165633ba (patch)
tree803dc9a817188d82c33c14b338da6a531ba30299 /crypto/tcrypt.c
parentfb469840b8c34b2f95b40a64b271f245cc1075b7 (diff)
[CRYPTO] tcrypt: Added test vectors for sha384/sha512
This patch adds tests for SHA384 HMAC and SHA512 HMAC to the tcrypt module. Test data was taken from RFC4231. This patch is a follow-up to the discovery (bug 7646) that the kernel SHA384 HMAC implementation was not generating proper SHA384 HMACs. Signed-off-by: Andrew Donofrio <linuxbugzilla@kriptik.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index d671e8942b1f..ff489423b2cf 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -12,6 +12,7 @@
12 * Software Foundation; either version 2 of the License, or (at your option) 12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version. 13 * any later version.
14 * 14 *
15 * 2006-12-07 Added SHA384 HMAC and SHA512 HMAC tests
15 * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>) 16 * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>)
16 * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt 17 * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt
17 * 18 *
@@ -980,6 +981,10 @@ static void do_test(void)
980 HMAC_SHA1_TEST_VECTORS); 981 HMAC_SHA1_TEST_VECTORS);
981 test_hash("hmac(sha256)", hmac_sha256_tv_template, 982 test_hash("hmac(sha256)", hmac_sha256_tv_template,
982 HMAC_SHA256_TEST_VECTORS); 983 HMAC_SHA256_TEST_VECTORS);
984 test_hash("hmac(sha384)", hmac_sha384_tv_template,
985 HMAC_SHA384_TEST_VECTORS);
986 test_hash("hmac(sha512)", hmac_sha512_tv_template,
987 HMAC_SHA512_TEST_VECTORS);
983 988
984 test_hash("xcbc(aes)", aes_xcbc128_tv_template, 989 test_hash("xcbc(aes)", aes_xcbc128_tv_template,
985 XCBC_AES_TEST_VECTORS); 990 XCBC_AES_TEST_VECTORS);
@@ -1192,6 +1197,16 @@ static void do_test(void)
1192 HMAC_SHA256_TEST_VECTORS); 1197 HMAC_SHA256_TEST_VECTORS);
1193 break; 1198 break;
1194 1199
1200 case 103:
1201 test_hash("hmac(sha384)", hmac_sha384_tv_template,
1202 HMAC_SHA384_TEST_VECTORS);
1203 break;
1204
1205 case 104:
1206 test_hash("hmac(sha512)", hmac_sha512_tv_template,
1207 HMAC_SHA512_TEST_VECTORS);
1208 break;
1209
1195 1210
1196 case 200: 1211 case 200:
1197 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, 1212 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,