summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorWinston Hudson (b45308) <winston.h.hudson@freescale.com>2013-09-18 08:45:43 -0700
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:20:52 -0500
commitc3200988800341bfa5050b88fdcd0452b241edb7 (patch)
tree5aa21833ee4210fa7dcbe2159f5a66921f750a6b /crypto
parentd2b1aaa890836371f52f3a01bea34fe7c22ed9cb (diff)
MLK-9710-6 AEAD CBC AES MD5 Test Support
This patch adds support for the following tcrypt test: (a) "authenc(hmac(md5),cbc(aes))" Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ). Thus the property names are often tied to the sec-4.0+ nomenclature. Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com> (cherry picked from commit a8ad8329282f7381c7768b7f3d544864b8e9df33)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.c12
-rw-r--r--crypto/testmgr.h31
2 files changed, 43 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 7870d51af31b..ee5ebceb6536 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1889,6 +1889,18 @@ static const struct alg_test_desc alg_test_descs[] = {
}
}
}, {
+ .alg = "authenc(hmac(md5),cbc(aes))",
+ .test = alg_test_aead,
+ .fips_allowed = 1,
+ .suite = {
+ .aead = {
+ .enc = {
+ .vecs = hmac_md5_aes_cbc_enc_tv_template,
+ .count = HMAC_MD5_AES_CBC_ENC_TEST_VECTORS
+ }
+ }
+ }
+ }, {
.alg = "cbc(aes)",
.test = alg_test_skcipher,
.fips_allowed = 1,
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 26bce4609cd3..cd20cd1f05e4 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -94,6 +94,37 @@ struct cprng_testvec {
static char zeroed_string[48];
+#define HMAC_MD5_AES_CBC_ENC_TEST_VECTORS 1
+
+static struct aead_testvec hmac_md5_aes_cbc_enc_tv_template[] = {
+ {
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x01\x00" /* rta type */
+#else
+ .key = "\x00\x08" /* rta length */
+ "\x00\x01" /* rta type */
+#endif
+ "\x00\x00\x00\x10" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
+ "\x51\x2e\x03\xd5\x34\x12\x00\x06",
+ .klen = 8 + 16 + 16,
+ .iv = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+ .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01",
+ .alen = 8,
+ .input = "Single block msg",
+ .ilen = 16,
+ .result = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+ "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
+ "\x76\xa8\x43\x89\xbd\xfe\xf9\x79"
+ "\x96\x64\x77\x02\x95\x21\x08\x4c",
+ .rlen = 16 + 16,
+ },
+};
+
/*
* MD4 test vectors from RFC1320
*/