]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: testmgr - Add test vectors for authenc(hmac(md5),cbc(des3_ede))
authorAleksander Jan Bajkowski <olek2@wp.pl>
Sun, 1 Feb 2026 11:27:08 +0000 (12:27 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 7 Feb 2026 01:31:39 +0000 (09:31 +0800)
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>
crypto/testmgr.c
crypto/testmgr.h

index 1306c7df20f9ee2bb4b128a70e35917237558e2f..3d60d9ae9416b77ae401f4a4a99384e1eace3ede 100644 (file)
@@ -4079,6 +4079,13 @@ static const struct alg_test_desc alg_test_descs[] = {
                .suite = {
                        .aead = __VECS(aegis128_tv_template)
                }
+       }, {
+               .alg = "authenc(hmac(md5),cbc(des3_ede))",
+               .generic_driver = "authenc(hmac-md5-lib,cbc(des3_ede-generic))",
+               .test = alg_test_aead,
+               .suite = {
+                       .aead = __VECS(hmac_md5_des3_ede_cbc_tv_temp)
+               }
        }, {
                .alg = "authenc(hmac(md5),ecb(cipher_null))",
                .generic_driver = "authenc(hmac-md5-lib,ecb-cipher_null)",
index 0f47058e42ad475d2cc31ef4b83d8230b7c5ea70..92b54038d24a2b137528a56204f39bc4abd3aca0 100644 (file)
@@ -17822,6 +17822,65 @@ static const struct aead_testvec hmac_sha512_des_cbc_tv_temp[] = {
        },
 };
 
+static const struct aead_testvec hmac_md5_des3_ede_cbc_tv_temp[] = {
+       { /*Generated with cryptopp*/
+#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\x18"    /* enc key length */
+                         "\x11\x22\x33\x44\x55\x66\x77\x88"
+                         "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+                         "\xE9\xC0\xFF\x2E\x76\x0B\x64\x24"
+                         "\x44\x4D\x99\x5A\x12\xD6\x40\xC0"
+                         "\xEA\xC2\x84\xE8\x14\x95\xDB\xE8",
+               .klen   = 8 + 16 + 24,
+               .iv     = "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
+               .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x01"
+                         "\x7D\x33\x88\x93\x0F\x93\xB2\x42",
+               .alen   = 16,
+               .ptext  = "\x6f\x54\x20\x6f\x61\x4d\x79\x6e"
+                         "\x53\x20\x63\x65\x65\x72\x73\x74"
+                         "\x54\x20\x6f\x6f\x4d\x20\x6e\x61"
+                         "\x20\x79\x65\x53\x72\x63\x74\x65"
+                         "\x20\x73\x6f\x54\x20\x6f\x61\x4d"
+                         "\x79\x6e\x53\x20\x63\x65\x65\x72"
+                         "\x73\x74\x54\x20\x6f\x6f\x4d\x20"
+                         "\x6e\x61\x20\x79\x65\x53\x72\x63"
+                         "\x74\x65\x20\x73\x6f\x54\x20\x6f"
+                         "\x61\x4d\x79\x6e\x53\x20\x63\x65"
+                         "\x65\x72\x73\x74\x54\x20\x6f\x6f"
+                         "\x4d\x20\x6e\x61\x20\x79\x65\x53"
+                         "\x72\x63\x74\x65\x20\x73\x6f\x54"
+                         "\x20\x6f\x61\x4d\x79\x6e\x53\x20"
+                         "\x63\x65\x65\x72\x73\x74\x54\x20"
+                         "\x6f\x6f\x4d\x20\x6e\x61\x0a\x79",
+               .plen   = 128,
+               .ctext  = "\x0e\x2d\xb6\x97\x3c\x56\x33\xf4"
+                         "\x67\x17\x21\xc7\x6e\x8a\xd5\x49"
+                         "\x74\xb3\x49\x05\xc5\x1c\xd0\xed"
+                         "\x12\x56\x5c\x53\x96\xb6\x00\x7d"
+                         "\x90\x48\xfc\xf5\x8d\x29\x39\xcc"
+                         "\x8a\xd5\x35\x18\x36\x23\x4e\xd7"
+                         "\x76\xd1\xda\x0c\x94\x67\xbb\x04"
+                         "\x8b\xf2\x03\x6c\xa8\xcf\xb6\xea"
+                         "\x22\x64\x47\xaa\x8f\x75\x13\xbf"
+                         "\x9f\xc2\xc3\xf0\xc9\x56\xc5\x7a"
+                         "\x71\x63\x2e\x89\x7b\x1e\x12\xca"
+                         "\xe2\x5f\xaf\xd8\xa4\xf8\xc9\x7a"
+                         "\xd6\xf9\x21\x31\x62\x44\x45\xa6"
+                         "\xd6\xbc\x5a\xd3\x2d\x54\x43\xcc"
+                         "\x9d\xde\xa5\x70\xe9\x42\x45\x8a"
+                         "\x6b\xfa\xb1\x91\x13\xb0\xd9\x19"
+                         "\x99\x09\xfb\x05\x35\xc8\xcc\x38"
+                         "\xc3\x1e\x5e\xe1\xe6\x96\x84\xc8",
+                         .clen = 128 + 16,
+       },
+};
+
 static const struct aead_testvec hmac_sha1_des3_ede_cbc_tv_temp[] = {
        { /*Generated with cryptopp*/
 #ifdef __LITTLE_ENDIAN