Skip to contentSkip to conversation

crypto: add sha384 hmac and sha512 hmac tests to tcrypt in 2.6.19 kernel

PATCH In review Andrew Donofrio 2 participants 2 messages Dec 8, 2006 – Dec 10, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: add sha384 hmac and sha512 hmac tests to tcrypt in 2.6.19 kernel

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.

---

usr/src/linux/crypto/tcrypt.c renamed from home/despot/linux-2.6.19/crypto/tcrypt.c +15 -0
diff -up /home/despot/linux-2.6.19/crypto/tcrypt.c /usr/src/linux/crypto/tcrypt.c
@@ -12,6 +12,7 @@
  * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
  *
+ * 2006-12-07 Added SHA384 HMAC and SHA512 HMAC tests
  * 2004-08-09 Added cipher speed tests (Reyk Floeter <[email protected]>)
  * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt
  *
@@ -976,6 +977,10 @@ static void do_test(void)
 			  HMAC_SHA1_TEST_VECTORS);
 		test_hash("hmac(sha256)", hmac_sha256_tv_template,
 			  HMAC_SHA256_TEST_VECTORS);
+		test_hash("hmac(sha384)", hmac_sha384_tv_template,
+			  HMAC_SHA384_TEST_VECTORS);
+		test_hash("hmac(sha512)", hmac_sha512_tv_template,
+			  HMAC_SHA512_TEST_VECTORS);
 
 		test_hash("michael_mic", michael_mic_tv_template, MICHAEL_MIC_TEST_VECTORS);
 		break;
@@ -1181,6 +1186,16 @@ static void do_test(void)
 			  HMAC_SHA256_TEST_VECTORS);
 		break;
 
+	case 103:
+		test_hash("hmac(sha384)", hmac_sha384_tv_template,
+			  HMAC_SHA384_TEST_VECTORS);
+		break;
+
+	case 104:
+		test_hash("hmac(sha512)", hmac_sha512_tv_template,
+			  HMAC_SHA512_TEST_VECTORS);
+		break;
+
 
 	case 200:
 		test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
usr/src/linux/crypto/tcrypt.h renamed from home/despot/linux-2.6.19/crypto/tcrypt.h +244 -1

263 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Andrew Donofrio

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.

I've applied the patch to cryptodev-2.6 with some editorial changes.

Thanks!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt