Skip to content

Commit dc8f3d9

Browse files
abajkherbertx
authored andcommitted
crypto: testmgr - Add test vectors for authenc(hmac(md5),cbc(des3_ede))
Test vector was generated using a software implementation and then double checked using a hardware implementation on NXP P2020 (talitos). The encryption part is identical to authenc(hmac(sha1),cbc(des3_ede)), only HMAC is different. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent cd966e4 commit dc8f3d9

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

crypto/testmgr.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,6 +4079,13 @@ static const struct alg_test_desc alg_test_descs[] = {
40794079
.suite = {
40804080
.aead = __VECS(aegis128_tv_template)
40814081
}
4082+
}, {
4083+
.alg = "authenc(hmac(md5),cbc(des3_ede))",
4084+
.generic_driver = "authenc(hmac-md5-lib,cbc(des3_ede-generic))",
4085+
.test = alg_test_aead,
4086+
.suite = {
4087+
.aead = __VECS(hmac_md5_des3_ede_cbc_tv_temp)
4088+
}
40824089
}, {
40834090
.alg = "authenc(hmac(md5),ecb(cipher_null))",
40844091
.generic_driver = "authenc(hmac-md5-lib,ecb-cipher_null)",

crypto/testmgr.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17822,6 +17822,65 @@ static const struct aead_testvec hmac_sha512_des_cbc_tv_temp[] = {
1782217822
},
1782317823
};
1782417824

17825+
static const struct aead_testvec hmac_md5_des3_ede_cbc_tv_temp[] = {
17826+
{ /*Generated with cryptopp*/
17827+
#ifdef __LITTLE_ENDIAN
17828+
.key = "\x08\x00" /* rta length */
17829+
"\x01\x00" /* rta type */
17830+
#else
17831+
.key = "\x00\x08" /* rta length */
17832+
"\x00\x01" /* rta type */
17833+
#endif
17834+
"\x00\x00\x00\x18" /* enc key length */
17835+
"\x11\x22\x33\x44\x55\x66\x77\x88"
17836+
"\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
17837+
"\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
17838+
"\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
17839+
"\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
17840+
.klen = 8 + 16 + 24,
17841+
.iv = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
17842+
.assoc = "\x00\x00\x43\x21\x00\x00\x00\x01"
17843+
"\x7D\x33\x88\x93\x0F\x93\xB2\x42",
17844+
.alen = 16,
17845+
.ptext = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
17846+
"\x53\x20\x63\x65\x65\x72\x73\x74"
17847+
"\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
17848+
"\x20\x79\x65\x53\x72\x63\x74\x65"
17849+
"\x20\x73\x6f\x54\x20\x6f\x61\x4d"
17850+
"\x79\x6e\x53\x20\x63\x65\x65\x72"
17851+
"\x73\x74\x54\x20\x6f\x6f\x4d\x20"
17852+
"\x6e\x61\x20\x79\x65\x53\x72\x63"
17853+
"\x74\x65\x20\x73\x6f\x54\x20\x6f"
17854+
"\x61\x4d\x79\x6e\x53\x20\x63\x65"
17855+
"\x65\x72\x73\x74\x54\x20\x6f\x6f"
17856+
"\x4d\x20\x6e\x61\x20\x79\x65\x53"
17857+
"\x72\x63\x74\x65\x20\x73\x6f\x54"
17858+
"\x20\x6f\x61\x4d\x79\x6e\x53\x20"
17859+
"\x63\x65\x65\x72\x73\x74\x54\x20"
17860+
"\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
17861+
.plen = 128,
17862+
.ctext = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
17863+
"\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
17864+
"\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
17865+
"\x12\x56\x5c\x53\x96\xb6\x00\x7d"
17866+
"\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
17867+
"\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
17868+
"\x76\xd1\xda\x0c\x94\x67\xbb\x04"
17869+
"\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
17870+
"\x22\x64\x47\xaa\x8f\x75\x13\xbf"
17871+
"\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
17872+
"\x71\x63\x2e\x89\x7b\x1e\x12\xca"
17873+
"\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
17874+
"\xd6\xf9\x21\x31\x62\x44\x45\xa6"
17875+
"\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
17876+
"\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
17877+
"\x6b\xfa\xb1\x91\x13\xb0\xd9\x19"
17878+
"\x99\x09\xfb\x05\x35\xc8\xcc\x38"
17879+
"\xc3\x1e\x5e\xe1\xe6\x96\x84\xc8",
17880+
.clen = 128 + 16,
17881+
},
17882+
};
17883+
1782517884
static const struct aead_testvec hmac_sha1_des3_ede_cbc_tv_temp[] = {
1782617885
{ /*Generated with cryptopp*/
1782717886
#ifdef __LITTLE_ENDIAN

0 commit comments

Comments
 (0)