Skip to contentSkip to conversation

crypto: testmgr - add aead cbc des, des3_ede tests.

PATCH In review Vakul Garg 2 participants 2 messages Jan 9, 2013 – Feb 27, 2013

Subsystems (2)
lore
Share & tools
lore

Vakul Garg

author
#0 lore raw

PATCH 1/1 crypto: testmgr - add aead cbc des, des3_ede tests.

Test vectors were taken from existing test for CBC(DES3_EDE). Associated data has been added to test vectors. HMAC computed with Crypto++ has been used. Following algos have been covered.

	(a) "authenc(hmac(sha1),cbc(des))"
	(b) "authenc(hmac(sha1),cbc(des3_ede))"
	(c) "authenc(hmac(sha224),cbc(des))"
	(d) "authenc(hmac(sha224),cbc(des3_ede))"
	(e) "authenc(hmac(sha256),cbc(des))"
	(f) "authenc(hmac(sha256),cbc(des3_ede))"
	(g) "authenc(hmac(sha384),cbc(des))"
	(h) "authenc(hmac(sha384),cbc(des3_ede))"
	(i) "authenc(hmac(sha512),cbc(des))"
	(j) "authenc(hmac(sha512),cbc(des3_ede))"
---
 crypto/testmgr.c |  120 ++++++++++
 crypto/testmgr.h |  647 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 767 insertions(+), 0 deletions(-)
crypto/testmgr.c +120 -0
index edf4a08..3f364a0 100644
@@ -1721,6 +1721,54 @@ static const struct alg_test_desc alg_test_descs[] = {
 			}
 		}
 	}, {
+		.alg = "authenc(hmac(sha1),cbc(des))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha1_des_cbc_enc_tv_template,
+					.count = HMAC_SHA1_DES_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha1),cbc(des3_ede))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha1_des3_ede_cbc_enc_tv_template,
+					.count = HMAC_SHA1_DES3_EDE_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha224),cbc(des))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha224_des_cbc_enc_tv_template,
+					.count = HMAC_SHA224_DES_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha224),cbc(des3_ede))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha224_des3_ede_cbc_enc_tv_template,
+					.count = HMAC_SHA224_DES3_EDE_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
 		.alg = "authenc(hmac(sha256),cbc(aes))",
 		.test = alg_test_aead,
 		.fips_allowed = 1,
@@ -1733,6 +1781,54 @@ static const struct alg_test_desc alg_test_descs[] = {
 			}
 		}
 	}, {
+		.alg = "authenc(hmac(sha256),cbc(des))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha256_des_cbc_enc_tv_template,
+					.count = HMAC_SHA256_DES_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha256),cbc(des3_ede))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha256_des3_ede_cbc_enc_tv_template,
+					.count = HMAC_SHA256_DES3_EDE_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha384),cbc(des))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha384_des_cbc_enc_tv_template,
+					.count = HMAC_SHA384_DES_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha384),cbc(des3_ede))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha384_des3_ede_cbc_enc_tv_template,
+					.count = HMAC_SHA384_DES3_EDE_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
 		.alg = "authenc(hmac(sha512),cbc(aes))",
 		.test = alg_test_aead,
 		.fips_allowed = 1,
@@ -1745,6 +1841,30 @@ static const struct alg_test_desc alg_test_descs[] = {
 			}
 		}
 	}, {
+		.alg = "authenc(hmac(sha512),cbc(des))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha512_des_cbc_enc_tv_template,
+					.count = HMAC_SHA512_DES_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
+		.alg = "authenc(hmac(sha512),cbc(des3_ede))",
+		.test = alg_test_aead,
+		.fips_allowed = 1,
+		.suite = {
+			.aead = {
+				.enc = {
+					.vecs = hmac_sha512_des3_ede_cbc_enc_tv_template,
+					.count = HMAC_SHA512_DES3_EDE_CBC_ENC_TEST_VECTORS
+				}
+			}
+		}
+	}, {
 		.alg = "cbc(aes)",
 		.test = alg_test_skcipher,
 		.fips_allowed = 1,
crypto/testmgr.h +647 -0

653 lines not on this page · raw message

Signature · 1 line
1.7.7
#1 lore raw
Quoted 16 lines · Vakul Garg

Test vectors were taken from existing test for CBC(DES3_EDE). Associated data has been added to test vectors. HMAC computed with Crypto++ has been used. Following algos have been covered.

	(a) "authenc(hmac(sha1),cbc(des))"
	(b) "authenc(hmac(sha1),cbc(des3_ede))"
	(c) "authenc(hmac(sha224),cbc(des))"
	(d) "authenc(hmac(sha224),cbc(des3_ede))"
	(e) "authenc(hmac(sha256),cbc(des))"
	(f) "authenc(hmac(sha256),cbc(des3_ede))"
	(g) "authenc(hmac(sha384),cbc(des))"
	(h) "authenc(hmac(sha384),cbc(des3_ede))"
	(i) "authenc(hmac(sha512),cbc(des))"
	(j) "authenc(hmac(sha512),cbc(des3_ede))"
Quoted 5 lines
---
  crypto/testmgr.c |  120 ++++++++++
  crypto/testmgr.h |  647 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 767 insertions(+), 0 deletions(-)

A good idea would be to cross-check by verifying that both caam and talitos pass these builtin tests, if you haven't done so already. If you have other platforms at hand, the more the better.

Some time ago I wanted to add support for cbc(des), but Kim argued it ain't worth the effort due to low interest in des algo. But since you already did the work and submitted the patch, I guess it's fine.

Regards,
Horia