--- /dev/null
+From c637f3e4a59d710ffd80da1c11d2ebed162d8ff0 Mon Sep 17 00:00:00 2001
+From: Thorsten Blum <thorsten.blum@linux.dev>
+Date: Mon, 17 Nov 2025 12:44:26 +0100
+Subject: [PATCH] crypto: testmgr - Add missing DES weak and semi-weak key
+ tests
+
+Ever since commit da7f033ddc9f ("crypto: cryptomgr - Add test
+infrastructure"), the DES test suite has tested only one of the four
+weak keys and none of the twelve semi-weak keys.
+
+DES has four weak keys and twelve semi-weak keys, and the kernel's DES
+implementation correctly detects and rejects all of these keys when the
+CRYPTO_TFM_REQ_FORBID_WEAK_KEYS flag is set. However, only a single weak
+key was being tested. Add tests for all 16 weak and semi-weak keys.
+
+While DES is deprecated, it is still used in some legacy protocols, and
+weak/semi-weak key detection should be tested accordingly.
+
+Tested on arm64 with cryptographic self-tests.
+
+Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.h | 120 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 120 insertions(+)
+
+--- a/crypto/testmgr.h
++++ b/crypto/testmgr.h
+@@ -10330,6 +10330,126 @@ static const struct cipher_testvec des_t
+ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
+ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
+ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\xe0\xe0\xe0\xf1\xf1\xf1\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 1a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\xfe\x01\xfe\x01\xfe\x01\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 1b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\x01\xfe\x01\xfe\x01\xfe\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 2a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\xe0\x1f\xe0\x0e\xf1\x0e\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 2b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\x1f\xe0\x1f\xf1\x0e\xf1\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 3a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\xe0\x01\xe0\x01\xf1\x01\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 3b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\x01\xe0\x01\xf1\x01\xf1\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 4a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\xfe\x1f\xfe\x0e\xfe\x0e\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 4b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\x1f\xfe\x1f\xfe\x0e\xfe\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 5a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\x1f\x01\x1f\x01\x0e\x01\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 5b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\x01\x1f\x01\x0e\x01\x0e\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 6a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\xfe\xe0\xfe\xf1\xfe\xf1\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 6b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\xe0\xfe\xe0\xfe\xf1\xfe\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
+ }, { /* Two blocks -- for testing encryption across pages */
+ .key = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+ .klen = 8,
-From a22d48cbe55814061d46db2f87090ba5e36aaf7f Mon Sep 17 00:00:00 2001
+From 030218dedee2628ea3f035d71431e1b7c4191cfb Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Sat, 31 Jan 2026 18:43:03 +0100
+Date: Sat, 31 Jan 2026 18:38:47 +0100
Subject: [PATCH] crypto: testmgr - Add test vectors for
- authenc(hmac(sha224),cbc(aes))
+ authenc(hmac(sha384),cbc(aes))
Test vectors were generated starting from existing CBC(AES) test vectors
-(RFC3602, NIST SP800-38A) and adding HMAC(SHA224) computed with Python
+(RFC3602, NIST SP800-38A) and adding HMAC(SHA384) computed with Python
script. Then, the results were double-checked on Mediatek MT7981 (safexcel)
and NXP P2020 (talitos). Both platforms pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 7 ++
- crypto/testmgr.h | 285 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 292 insertions(+)
+ crypto/testmgr.h | 311 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 318 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4414,6 +4414,13 @@ static const struct alg_test_desc alg_te
+@@ -4453,6 +4453,13 @@ static const struct alg_test_desc alg_te
.test = alg_test_null,
.fips_allowed = 1,
}, {
-+ .alg = "authenc(hmac(sha224),cbc(aes))",
-+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
++ .alg = "authenc(hmac(sha384),cbc(aes))",
++ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
+ .suite = {
-+ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
++ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
+ }
+ }, {
- .alg = "authenc(hmac(sha224),cbc(des))",
+ .alg = "authenc(hmac(sha384),cbc(des))",
.test = alg_test_aead,
.suite = {
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17490,6 +17490,291 @@ static const struct aead_testvec hmac_sh
+@@ -17893,6 +17893,317 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha224_aes_cbc_tv_temp[] = {
++static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\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 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+ .assoc = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "Single block msg",
+ .plen = 16,
+ .ctext = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+ "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
-+ "\x17\xe8\x00\x76\x70\x71\xd1\x72"
-+ "\xf8\xd0\x91\x51\x67\xf9\xdf\xd6"
-+ "\x0d\x56\x1a\xb3\x52\x19\x85\xae"
-+ "\x46\x74\xb6\x98",
-+ .clen = 16 + 28,
++ "\x79\x1c\xf1\x22\x95\x80\xe0\x60"
++ "\x7f\xf9\x92\x60\x83\xbd\x60\x9c"
++ "\xf6\x62\x8b\xa9\x7d\x56\xe2\xaf"
++ "\x80\x43\xbc\x41\x4a\x63\x0b\xa0"
++ "\x16\x25\xe2\xfe\x0a\x96\xf6\xa5"
++ "\x6c\x0b\xc2\x53\xb4\x27\xd9\x42",
++ .clen = 16 + 48,
+ }, { /* RFC 3602 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+ "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+ .assoc = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+ "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+ "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
-+ "\xa1\x11\xfa\xbb\x1e\x04\x7e\xe7"
-+ "\x4c\x5f\x65\xbf\x68\x8d\x33\x9d"
-+ "\xbc\x74\x9b\xf3\x15\xf3\x8f\x8d"
-+ "\xe8\xaf\x33\xe0",
-+
-+ .clen = 32 + 28,
++ "\x4e\x5b\xa8\x65\x51\xc6\x58\xaf"
++ "\x31\x57\x50\x3d\x01\xa1\xa4\x3f"
++ "\x42\xd1\xd7\x31\x76\x8d\xf8\xc8"
++ "\xe4\xd2\x7e\xc5\x23\xe7\xc6\x2e"
++ "\x2d\xfd\x9d\xc1\xac\x50\x1e\xcf"
++ "\xa0\x10\xeb\x1a\x9c\xb7\xe1\xca",
++ .clen = 32 + 48,
+ }, { /* RFC 3602 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
+ "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
+ .assoc = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "This is a 48-byte message (exactly 3 AES blocks)",
+ .plen = 48,
+ .ctext = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
+ "\x50\x69\x39\x27\x67\x72\xf8\xd5"
+ "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
+ "\x85\x79\x69\x5d\x83\xba\x26\x84"
-+ "\x60\xb3\xca\x0e\xc1\xfe\xf2\x27"
-+ "\x5a\x41\xe4\x99\xa8\x19\x56\xf1"
-+ "\x44\x98\x27\x9f\x99\xb0\x4a\xad"
-+ "\x4d\xc1\x1e\x88",
-+ .clen = 48 + 28,
++ "\xa1\x52\xe7\xda\xf7\x05\xb6\xca"
++ "\xad\x0f\x51\xed\x5a\xd3\x0f\xdf"
++ "\xde\xeb\x3f\x31\xed\x3a\x43\x93"
++ "\x3b\xb7\xca\xc8\x1b\xe7\x3b\x61"
++ "\x6a\x05\xfd\x2d\x6a\x5c\xb1\x0d"
++ "\x6e\x7a\xeb\x1c\x84\xec\xdb\xde",
++ .clen = 48 + 48,
+ }, { /* RFC 3602 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
+ "\xbc\x46\x90\x3d\xba\x29\x03\x49",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
+ .assoc = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+ "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+ "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
+ "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
+ "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
-+ "\xbb\xe9\x38\xf8\xb9\xbf\xcb\x7b"
-+ "\xa8\x22\x91\xea\x1e\xaf\x13\xba"
-+ "\x24\x18\x64\x9c\xcb\xb4\xa9\x16"
-+ "\x4b\x83\x9c\xec",
-+ .clen = 64 + 28,
++ "\x85\x7b\x91\xe0\x29\xeb\xd3\x59"
++ "\x7c\xe3\x67\x14\xbe\x71\x2a\xd2"
++ "\x8a\x1a\xd2\x35\x78\x6b\x69\xba"
++ "\x64\xa5\x04\x00\x19\xc3\x4c\xae"
++ "\x71\xff\x76\x9f\xbb\xc3\x29\x22"
++ "\xc2\xc6\x51\xf1\xe6\x29\x5e\xa5",
++ .clen = 64 + 48,
+ }, { /* RFC 3602 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
+ "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
+ "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
+ .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01"
+ "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
+ "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
+ "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
-+ "\x04\x5e\x83\x45\xc5\x6a\x5b\xe2"
-+ "\x5e\xd8\x59\x06\xbd\xc7\xd2\x9b"
-+ "\x0b\x65\x1f\x31\xc7\xe6\x9c\x39"
-+ "\xa3\x66\xdb\xb8",
-+ .clen = 80 + 28,
++ "\x57\x5f\xb4\xd7\x74\x6f\x18\x97"
++ "\xb7\xde\xfc\xf3\x4e\x0d\x29\x4d"
++ "\xa0\xff\x39\x9e\x2d\xbf\x27\xac"
++ "\x54\xb9\x8a\x3e\xab\x3b\xac\xd3"
++ "\x36\x43\x74\xfc\xc2\x64\x81\x8a"
++ "\x2c\x15\x72\xdf\x3f\x9d\x5b\xa4",
++ .clen = 80 + 48,
+ }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+ "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+ "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-+ .klen = 8 + 28 + 24,
++ .klen = 8 + 48 + 24,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+ "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+ "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
-+ "\x67\x35\xcd\x86\x94\x51\x3b\x3a"
-+ "\xaa\x07\xb1\xed\x18\x55\x62\x01"
-+ "\x95\xb2\x53\xb5\x20\x78\x16\xd7"
-+ "\xb8\x49\x7f\x96",
-+
-+ .clen = 64 + 28,
++ "\x29\x9b\x42\x47\x0b\xbf\xf3\x54"
++ "\x54\x95\xb0\x89\xd5\xa0\xc3\x78"
++ "\x60\x6c\x18\x39\x6d\xc9\xfb\x2a"
++ "\x34\x1c\xed\x95\x10\x1e\x43\x0a"
++ "\x72\xce\x26\xbc\x74\xd9\x6f\xa2"
++ "\xf1\xd9\xd0\xb1\xdf\x3d\x93\x14",
++ .clen = 64 + 48,
+ }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+ "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+ "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+ "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
-+ .klen = 8 + 28 + 32,
++ .klen = 8 + 48 + 32,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\xa5\x30\xe2\x63\x04\x23\x14\x61"
+ "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
+ "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
-+ "\xe0\xe2\x3d\x3f\x55\x24\x2c\x4d"
-+ "\xb9\x13\x2a\xc0\x07\xbb\x3b\xda"
-+ "\xfd\xa4\x51\x32\x3f\x44\xb1\x13"
-+ "\x98\xf9\xbc\xb9",
-+ .clen = 64 + 28,
++ "\x9f\x50\xce\x64\xd9\xa3\xc9\x7a"
++ "\x15\x3a\x3d\x46\x9a\x90\xf3\x06"
++ "\x22\xad\xc5\x24\x77\x50\xb8\xfe"
++ "\xbe\x37\x16\x86\x34\x5f\xaf\x97"
++ "\x00\x9d\x86\xc8\x32\x4f\x72\x2f"
++ "\x48\x97\xad\xb6\xb9\x77\x33\xbc",
++ .clen = 64 + 48,
+ },
+};
+
- static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 030218dedee2628ea3f035d71431e1b7c4191cfb Mon Sep 17 00:00:00 2001
+From a22d48cbe55814061d46db2f87090ba5e36aaf7f Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Sat, 31 Jan 2026 18:38:47 +0100
+Date: Sat, 31 Jan 2026 18:43:03 +0100
Subject: [PATCH] crypto: testmgr - Add test vectors for
- authenc(hmac(sha384),cbc(aes))
+ authenc(hmac(sha224),cbc(aes))
Test vectors were generated starting from existing CBC(AES) test vectors
-(RFC3602, NIST SP800-38A) and adding HMAC(SHA384) computed with Python
+(RFC3602, NIST SP800-38A) and adding HMAC(SHA224) computed with Python
script. Then, the results were double-checked on Mediatek MT7981 (safexcel)
and NXP P2020 (talitos). Both platforms pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 7 ++
- crypto/testmgr.h | 311 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 318 insertions(+)
+ crypto/testmgr.h | 285 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 292 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4453,6 +4453,13 @@ static const struct alg_test_desc alg_te
+@@ -4414,6 +4414,13 @@ static const struct alg_test_desc alg_te
.test = alg_test_null,
.fips_allowed = 1,
}, {
-+ .alg = "authenc(hmac(sha384),cbc(aes))",
-+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
++ .alg = "authenc(hmac(sha224),cbc(aes))",
++ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
+ .suite = {
-+ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
++ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
+ }
+ }, {
- .alg = "authenc(hmac(sha384),cbc(des))",
+ .alg = "authenc(hmac(sha224),cbc(des))",
.test = alg_test_aead,
.suite = {
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17773,6 +17773,317 @@ static const struct aead_testvec hmac_sh
+@@ -17610,6 +17610,291 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
++static const struct aead_testvec hmac_sha224_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\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 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+ .assoc = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "Single block msg",
+ .plen = 16,
+ .ctext = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+ "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
-+ "\x79\x1c\xf1\x22\x95\x80\xe0\x60"
-+ "\x7f\xf9\x92\x60\x83\xbd\x60\x9c"
-+ "\xf6\x62\x8b\xa9\x7d\x56\xe2\xaf"
-+ "\x80\x43\xbc\x41\x4a\x63\x0b\xa0"
-+ "\x16\x25\xe2\xfe\x0a\x96\xf6\xa5"
-+ "\x6c\x0b\xc2\x53\xb4\x27\xd9\x42",
-+ .clen = 16 + 48,
++ "\x17\xe8\x00\x76\x70\x71\xd1\x72"
++ "\xf8\xd0\x91\x51\x67\xf9\xdf\xd6"
++ "\x0d\x56\x1a\xb3\x52\x19\x85\xae"
++ "\x46\x74\xb6\x98",
++ .clen = 16 + 28,
+ }, { /* RFC 3602 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x38\x39\x3a\x3b"
+ "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+ "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+ .assoc = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+ "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+ "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
-+ "\x4e\x5b\xa8\x65\x51\xc6\x58\xaf"
-+ "\x31\x57\x50\x3d\x01\xa1\xa4\x3f"
-+ "\x42\xd1\xd7\x31\x76\x8d\xf8\xc8"
-+ "\xe4\xd2\x7e\xc5\x23\xe7\xc6\x2e"
-+ "\x2d\xfd\x9d\xc1\xac\x50\x1e\xcf"
-+ "\xa0\x10\xeb\x1a\x9c\xb7\xe1\xca",
-+ .clen = 32 + 48,
++ "\xa1\x11\xfa\xbb\x1e\x04\x7e\xe7"
++ "\x4c\x5f\x65\xbf\x68\x8d\x33\x9d"
++ "\xbc\x74\x9b\xf3\x15\xf3\x8f\x8d"
++ "\xe8\xaf\x33\xe0",
++
++ .clen = 32 + 28,
+ }, { /* RFC 3602 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
+ "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
+ .assoc = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "This is a 48-byte message (exactly 3 AES blocks)",
+ .plen = 48,
+ .ctext = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
+ "\x50\x69\x39\x27\x67\x72\xf8\xd5"
+ "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
+ "\x85\x79\x69\x5d\x83\xba\x26\x84"
-+ "\xa1\x52\xe7\xda\xf7\x05\xb6\xca"
-+ "\xad\x0f\x51\xed\x5a\xd3\x0f\xdf"
-+ "\xde\xeb\x3f\x31\xed\x3a\x43\x93"
-+ "\x3b\xb7\xca\xc8\x1b\xe7\x3b\x61"
-+ "\x6a\x05\xfd\x2d\x6a\x5c\xb1\x0d"
-+ "\x6e\x7a\xeb\x1c\x84\xec\xdb\xde",
-+ .clen = 48 + 48,
++ "\x60\xb3\xca\x0e\xc1\xfe\xf2\x27"
++ "\x5a\x41\xe4\x99\xa8\x19\x56\xf1"
++ "\x44\x98\x27\x9f\x99\xb0\x4a\xad"
++ "\x4d\xc1\x1e\x88",
++ .clen = 48 + 28,
+ }, { /* RFC 3602 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
+ "\xbc\x46\x90\x3d\xba\x29\x03\x49",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
+ .assoc = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+ "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+ "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
+ "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
+ "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
-+ "\x85\x7b\x91\xe0\x29\xeb\xd3\x59"
-+ "\x7c\xe3\x67\x14\xbe\x71\x2a\xd2"
-+ "\x8a\x1a\xd2\x35\x78\x6b\x69\xba"
-+ "\x64\xa5\x04\x00\x19\xc3\x4c\xae"
-+ "\x71\xff\x76\x9f\xbb\xc3\x29\x22"
-+ "\xc2\xc6\x51\xf1\xe6\x29\x5e\xa5",
-+ .clen = 64 + 48,
++ "\xbb\xe9\x38\xf8\xb9\xbf\xcb\x7b"
++ "\xa8\x22\x91\xea\x1e\xaf\x13\xba"
++ "\x24\x18\x64\x9c\xcb\xb4\xa9\x16"
++ "\x4b\x83\x9c\xec",
++ .clen = 64 + 28,
+ }, { /* RFC 3602 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
+ "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
+ "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
+ .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01"
+ "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
+ "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
+ "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
-+ "\x57\x5f\xb4\xd7\x74\x6f\x18\x97"
-+ "\xb7\xde\xfc\xf3\x4e\x0d\x29\x4d"
-+ "\xa0\xff\x39\x9e\x2d\xbf\x27\xac"
-+ "\x54\xb9\x8a\x3e\xab\x3b\xac\xd3"
-+ "\x36\x43\x74\xfc\xc2\x64\x81\x8a"
-+ "\x2c\x15\x72\xdf\x3f\x9d\x5b\xa4",
-+ .clen = 80 + 48,
++ "\x04\x5e\x83\x45\xc5\x6a\x5b\xe2"
++ "\x5e\xd8\x59\x06\xbd\xc7\xd2\x9b"
++ "\x0b\x65\x1f\x31\xc7\xe6\x9c\x39"
++ "\xa3\x66\xdb\xb8",
++ .clen = 80 + 28,
+ }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+ "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+ "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-+ .klen = 8 + 48 + 24,
++ .klen = 8 + 28 + 24,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+ "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+ "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
-+ "\x29\x9b\x42\x47\x0b\xbf\xf3\x54"
-+ "\x54\x95\xb0\x89\xd5\xa0\xc3\x78"
-+ "\x60\x6c\x18\x39\x6d\xc9\xfb\x2a"
-+ "\x34\x1c\xed\x95\x10\x1e\x43\x0a"
-+ "\x72\xce\x26\xbc\x74\xd9\x6f\xa2"
-+ "\xf1\xd9\xd0\xb1\xdf\x3d\x93\x14",
-+ .clen = 64 + 48,
++ "\x67\x35\xcd\x86\x94\x51\x3b\x3a"
++ "\xaa\x07\xb1\xed\x18\x55\x62\x01"
++ "\x95\xb2\x53\xb5\x20\x78\x16\xd7"
++ "\xb8\x49\x7f\x96",
++
++ .clen = 64 + 28,
+ }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+ "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+ "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+ "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
-+ .klen = 8 + 48 + 32,
++ .klen = 8 + 28 + 32,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\xa5\x30\xe2\x63\x04\x23\x14\x61"
+ "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
+ "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
-+ "\x9f\x50\xce\x64\xd9\xa3\xc9\x7a"
-+ "\x15\x3a\x3d\x46\x9a\x90\xf3\x06"
-+ "\x22\xad\xc5\x24\x77\x50\xb8\xfe"
-+ "\xbe\x37\x16\x86\x34\x5f\xaf\x97"
-+ "\x00\x9d\x86\xc8\x32\x4f\x72\x2f"
-+ "\x48\x97\xad\xb6\xb9\x77\x33\xbc",
-+ .clen = 64 + 48,
++ "\xe0\xe2\x3d\x3f\x55\x24\x2c\x4d"
++ "\xb9\x13\x2a\xc0\x07\xbb\x3b\xda"
++ "\xfd\xa4\x51\x32\x3f\x44\xb1\x13"
++ "\x98\xf9\xbc\xb9",
++ .clen = 64 + 28,
+ },
+};
+
- static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
.suite = {
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -19021,6 +19021,65 @@ static const struct aead_testvec hmac_sh
+@@ -19141,6 +19141,65 @@ static const struct aead_testvec hmac_sh
},
};
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -18708,6 +18708,63 @@ static const struct aead_testvec hmac_sh
+@@ -18828,6 +18828,63 @@ static const struct aead_testvec hmac_sh
},
};
-From 3f4d32aff1d4e06501f909b1e5037ec8caa76d01 Mon Sep 17 00:00:00 2001
+From b45b4314d3e55be70b597baa1f0ab9283e68003b Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:21 +0100
-Subject: [PATCH 2/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha224),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:20 +0100
+Subject: [PATCH 1/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha1),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA224) computed with software implementation.
+vectors and adding HMAC(SHA1) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 235 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 240 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 221 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 226 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4452,8 +4452,12 @@ static const struct alg_test_desc alg_te
+@@ -4425,8 +4425,12 @@ static const struct alg_test_desc alg_te
}
}, {
- .alg = "authenc(hmac(sha224),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha224-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha1-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha224_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha1_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha256),cbc(aes))",
- .test = alg_test_aead,
+ .alg = "authenc(hmac(sha224),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17996,6 +17996,241 @@ static const struct aead_testvec hmac_sh
+@@ -17564,6 +17564,227 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha224_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha1_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x36\xb4\x3b\x9c\x62\xed\xcf\x77"
-+ "\xdc\x19\x27\x3f\x92\x80\x52\xce"
-+ "\x8f\xad\x01\x0b\x79\xda\x04\x83"
-+ "\xcb\x45\x1a\x52",
-+ .clen = 16 + 28,
++ "\x70\xdc\x6b\x62\x43\xa1\x2f\x08"
++ "\xf1\xec\x93\x7d\x69\xb2\x8e\x1f"
++ "\x0a\x97\x39\x86",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x7f\xe4\x8f\xa7\x06\x71\xe9\xe5"
-+ "\x16\x79\xef\xf9\x7e\x5c\x93\x4d"
-+ "\xa0\xf8\x3b\x3a\xaa\x1c\xc0\xd9"
-+ "\x6b\x48\x49\x01",
-+ .clen = 32 + 28,
++ "\x6b\x7b\x4d\x39\x36\x1c\x12\x5f"
++ "\x72\xd2\x88\xb2\x26\xa6\xa6\xb5"
++ "\x1d\x3a\x49\xa6",
++ .clen = 32 + 20,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
-+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\x22\x33\x44\x55"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\xb0\x19\x45\xee\xa7\x31\xd9\xd0"
-+ "\x74\x6b\xb8\xb1\x67\x61\x2f\x8c"
-+ "\x68\xde\xe3\xc9\x3b\x0c\x72\xda"
-+ "\x48\xba\x1b\x51",
-+ .clen = 36 + 28,
++ "\x2c\x86\xa0\x90\x8e\xc1\x02\x1d"
++ "\x51\xdc\xd6\x21\xc7\x30\xcc\x32"
++ "\x38\x55\x47\x64",
++ .clen = 36 + 20,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 28 + 28,
++ .klen = 8 + 20 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\xfd\xf5\x35\x26\x50\x3d\xdf\x80"
-+ "\x6e\xbe\xba\x8d\x56\xf3\x03\xb7"
-+ "\x27\xb8\x13\xe8\x72\x8f\xc9\x52"
-+ "\x4a\xb7\xc3\x3a",
-+ .clen = 16 + 28,
++ "\xe9\x4e\x49\xf0\x6b\x8d\x58\x2b"
++ "\x26\x7f\xf3\xab\xeb\x2f\x74\x2f"
++ "\x45\x43\x64\xc1",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 28 + 28,
++ .klen = 8 + 20 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x72\x89\xa8\x04\xa5\xac\x8f\x29"
-+ "\xe6\xb8\x58\xe8\xcf\x6a\x91\x89"
-+ "\xd3\x66\x3b\xdc\xce\x43\x23\xb7"
-+ "\x6a\xdd\x9d\xbd",
-+ .clen = 32 + 28,
++ "\xab\xc4\xfa\x6d\x20\xe1\xce\x72"
++ "\x0e\x92\x4e\x97\xaa\x4d\x30\x84"
++ "\xb6\xd8\x4d\x3b",
++ .clen = 32 + 20,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 28 + 36,
++ .klen = 8 + 20 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xfe\xdf\x6f\x62\x8a\x79\xb5\x34"
-+ "\xd0\x6f\x32\xaf\x31\x50\x5b\x1f"
-+ "\xe0\x6d\x0b\xbc\x02\x25\xee\x74"
-+ "\x7a\xdf\x97\x3c",
-+ .clen = 16 + 28,
++ "\x3d\x6c\x23\x27\xda\x0e\x7f\x29"
++ "\xfd\x8d\x3c\x1b\xf7\x7a\x63\xd9"
++ "\x7e\x0f\xe9\xf6",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 28 + 36,
++ .klen = 8 + 20 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\x19\x1e\x9c\x2c\x6d\x4e\x21\xda"
-+ "\x6c\x4d\x88\x90\xf8\x5f\xa5\x9d"
-+ "\xb4\xd4\x40\xad\xfa\x67\x3f\x0e"
-+ "\x11\x12\xd6\x10",
-+ .clen = 32 + 28,
++ "\xe7\xee\x22\xa4\xdd\xbf\x5d\x44"
++ "\x3b\x43\x1c\x69\x55\x11\xd5\xad"
++ "\x14\x5f\x44\xa6",
++ .clen = 32 + 20,
+ },
+};
+
- static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
- { /* RFC 3602 Case 1 */
+ static const struct aead_testvec hmac_sha1_ecb_cipher_null_tv_temp[] = {
+ { /* Input data from RFC 2410 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 65af3a0bff7264ab84f9e1f2099c658601ca1b66 Mon Sep 17 00:00:00 2001
+From d46c27c01f132082095342b5abf4e83e250b70b8 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:22 +0100
-Subject: [PATCH 3/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha256),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:21 +0100
+Subject: [PATCH 2/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha224),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA256) computed with software implementation.
+vectors and adding HMAC(SHA224) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4483,8 +4483,12 @@ static const struct alg_test_desc alg_te
- .fips_allowed = 1,
+@@ -4452,8 +4452,12 @@ static const struct alg_test_desc alg_te
+ }
}, {
- .alg = "authenc(hmac(sha256),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha224),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha256-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha224-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha256_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha224_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha384),cbc(aes))",
- .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .alg = "authenc(hmac(sha256),cbc(aes))",
+ .test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -18514,6 +18514,241 @@ static const struct aead_testvec hmac_sh
+@@ -18116,6 +18116,241 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha256_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha224_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x9b\xa2\x34\x62\xe5\xb3\xe8\x2d"
-+ "\x6d\xdb\x93\x64\xa5\x08\x2e\x77"
-+ "\x72\x1f\x21\x94\xc7\xbe\x14\xa6"
-+ "\xcd\xea\x96\xa1\x29\x8f\x30\xc3",
-+ .clen = 16 + 32,
++ "\x36\xb4\x3b\x9c\x62\xed\xcf\x77"
++ "\xdc\x19\x27\x3f\x92\x80\x52\xce"
++ "\x8f\xad\x01\x0b\x79\xda\x04\x83"
++ "\xcb\x45\x1a\x52",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x22\xf7\x95\xa8\xbb\xcd\x19\xf4"
-+ "\x58\x16\x54\x28\x2b\xf4\x52\xe7"
-+ "\x5c\x6c\xe1\x44\x0b\xd5\x10\x6e"
-+ "\xe1\xf7\x04\xc4\x2c\xab\x93\xdd",
-+ .clen = 32 + 32,
++ "\x7f\xe4\x8f\xa7\x06\x71\xe9\xe5"
++ "\x16\x79\xef\xf9\x7e\x5c\x93\x4d"
++ "\xa0\xf8\x3b\x3a\xaa\x1c\xc0\xd9"
++ "\x6b\x48\x49\x01",
++ .clen = 32 + 28,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\xaa\xbb\xcc\xdd"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x1d\x05\x5f\x77\x3b\x4f\x5c\x21"
-+ "\x29\xea\xf1\xa8\x71\x49\x7b\x0b"
-+ "\x66\x0d\xff\x18\x81\x63\xfc\xc3"
-+ "\x91\xb6\x38\xc8\xcd\x2d\x39\x83",
-+ .clen = 36 + 32,
++ "\xb0\x19\x45\xee\xa7\x31\xd9\xd0"
++ "\x74\x6b\xb8\xb1\x67\x61\x2f\x8c"
++ "\x68\xde\xe3\xc9\x3b\x0c\x72\xda"
++ "\x48\xba\x1b\x51",
++ .clen = 36 + 28,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 32 + 28,
++ .klen = 8 + 28 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x8d\x03\x77\xb2\x1c\xc9\xe0\xac"
-+ "\xde\x69\xbe\x8a\xef\x5b\x13\x74"
-+ "\x1d\x39\xbc\xdc\x95\xa4\xbf\xc3"
-+ "\xd5\xc6\xd1\xda\xda\x3b\xca\x78",
-+ .clen = 16 + 32,
++ "\xfd\xf5\x35\x26\x50\x3d\xdf\x80"
++ "\x6e\xbe\xba\x8d\x56\xf3\x03\xb7"
++ "\x27\xb8\x13\xe8\x72\x8f\xc9\x52"
++ "\x4a\xb7\xc3\x3a",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 32 + 28,
++ .klen = 8 + 28 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x34\x06\x2b\x3d\xf1\xa8\x3d\xf1"
-+ "\xa6\x5e\x5c\x1a\xdb\x0c\xb5\x1e"
-+ "\x8f\xdb\xf4\xca\x7d\x09\x5e\x81"
-+ "\xdb\x32\x07\x4a\x1d\x1c\x6d\x83",
-+ .clen = 32 + 32,
++ "\x72\x89\xa8\x04\xa5\xac\x8f\x29"
++ "\xe6\xb8\x58\xe8\xcf\x6a\x91\x89"
++ "\xd3\x66\x3b\xdc\xce\x43\x23\xb7"
++ "\x6a\xdd\x9d\xbd",
++ .clen = 32 + 28,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 32 + 36,
++ .klen = 8 + 28 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xc3\xb4\x5f\xb0\xbf\xf5\x1b\xff"
-+ "\x7c\xf1\x79\x00\x63\x50\xdd\x77"
-+ "\xc0\x4a\xba\xcd\xdc\x47\x05\x2a"
-+ "\x5d\x85\x2d\x83\x44\xca\x79\x2c",
-+ .clen = 16 + 32,
++ "\xfe\xdf\x6f\x62\x8a\x79\xb5\x34"
++ "\xd0\x6f\x32\xaf\x31\x50\x5b\x1f"
++ "\xe0\x6d\x0b\xbc\x02\x25\xee\x74"
++ "\x7a\xdf\x97\x3c",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 32 + 36,
++ .klen = 8 + 28 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xc8\x59\x5d\xe1\xba\xac\x13\x82"
-+ "\xfd\x21\x7c\x8c\x23\x31\x04\x02"
-+ "\x9e\x69\x5b\x57\xa8\x13\xe7\x21"
-+ "\x60\x0c\x24\xc2\x80\x4a\x93\x6e",
-+ .clen = 32 + 32,
++ "\x19\x1e\x9c\x2c\x6d\x4e\x21\xda"
++ "\x6c\x4d\x88\x90\xf8\x5f\xa5\x9d"
++ "\xb4\xd4\x40\xad\xfa\x67\x3f\x0e"
++ "\x11\x12\xd6\x10",
++ .clen = 32 + 28,
+ },
+};
+
- static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 07cbbf6f38e6a91a7fecab3d6f86485425748d3e Mon Sep 17 00:00:00 2001
+From 5ac6b904c70ff163fd2f9e152056300ce5ed6c26 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:23 +0100
-Subject: [PATCH 4/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha384),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:22 +0100
+Subject: [PATCH 3/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha256),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA384) computed with software implementation.
+vectors and adding HMAC(SHA256) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 263 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 268 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 235 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 240 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4514,8 +4514,12 @@ static const struct alg_test_desc alg_te
+@@ -4483,8 +4483,12 @@ static const struct alg_test_desc alg_te
.fips_allowed = 1,
}, {
- .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha256),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha384-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha256-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha384_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha256_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha512),cbc(aes))",
- .fips_allowed = 1,
+ .alg = "authenc(hmac(sha384),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -19060,6 +19060,269 @@ static const struct aead_testvec hmac_sh
+@@ -18634,6 +18634,241 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha384_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha256_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x45\x51\x59\x72\x16\xd3\xc6\x15"
-+ "\x25\x1e\xe8\x92\x2e\x47\x52\xcc"
-+ "\x91\x9c\x24\xef\x11\xb2\x53\x00"
-+ "\x10\x20\x43\x06\xe2\x35\x88\x9e"
-+ "\x18\x32\x5a\x79\x7d\x73\x7e\x89"
-+ "\xfe\xa1\xda\xa4\x86\xc4\x2a\x04",
-+ .clen = 16 + 48,
++ "\x9b\xa2\x34\x62\xe5\xb3\xe8\x2d"
++ "\x6d\xdb\x93\x64\xa5\x08\x2e\x77"
++ "\x72\x1f\x21\x94\xc7\xbe\x14\xa6"
++ "\xcd\xea\x96\xa1\x29\x8f\x30\xc3",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x83\x65\x32\x1e\x6b\x60\xe6\x4a"
-+ "\xe2\xab\x52\x2b\xa6\x70\x3a\xfa"
-+ "\xd2\xec\x83\xe4\x31\x0c\x28\x40"
-+ "\x9b\x5e\x18\xa4\xdc\x48\xb8\x56"
-+ "\x33\xab\x7f\x2b\xaf\xe4\x3a\xe3"
-+ "\x8a\x61\xf6\x22\xb4\x6b\xfe\x7d",
-+ .clen = 32 + 48,
++ "\x22\xf7\x95\xa8\xbb\xcd\x19\xf4"
++ "\x58\x16\x54\x28\x2b\xf4\x52\xe7"
++ "\x5c\x6c\xe1\x44\x0b\xd5\x10\x6e"
++ "\xe1\xf7\x04\xc4\x2c\xab\x93\xdd",
++ .clen = 32 + 32,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x4a\xaa\xad\x3b\x3b\xb6\x9a\xba"
-+ "\xa1\x7b\xc6\xce\x96\xc3\xff\x67"
-+ "\xf3\x0c\x33\x57\xf0\x51\x24\x08"
-+ "\xed\x4f\x6a\x9c\x22\x42\xbd\x18"
-+ "\x97\x74\x68\x36\x00\xf1\x69\x3a"
-+ "\x18\x77\x40\xf0\x56\xba\xba\xe0",
-+ .clen = 36 + 48,
++ "\x1d\x05\x5f\x77\x3b\x4f\x5c\x21"
++ "\x29\xea\xf1\xa8\x71\x49\x7b\x0b"
++ "\x66\x0d\xff\x18\x81\x63\xfc\xc3"
++ "\x91\xb6\x38\xc8\xcd\x2d\x39\x83",
++ .clen = 36 + 32,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 48 + 28,
++ .klen = 8 + 32 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x36\xd6\xc7\x55\xac\xb6\x0b\x14"
-+ "\x95\x71\xf9\x86\x30\xe3\x96\xc3"
-+ "\x76\x85\x6d\xa5\x06\xed\x6f\x34"
-+ "\xcc\x1f\xcc\x2d\x88\x06\xb0\x1d"
-+ "\xbe\xd9\xa2\xd3\x64\xf1\x33\x03"
-+ "\x13\x50\x8f\xae\x61\x2d\x82\xb8",
-+ .clen = 16 + 48,
++ "\x8d\x03\x77\xb2\x1c\xc9\xe0\xac"
++ "\xde\x69\xbe\x8a\xef\x5b\x13\x74"
++ "\x1d\x39\xbc\xdc\x95\xa4\xbf\xc3"
++ "\xd5\xc6\xd1\xda\xda\x3b\xca\x78",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 48 + 28,
++ .klen = 8 + 32 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x80\x12\x67\x22\xf2\x4d\x9b\xbf"
-+ "\xdc\x38\xd3\xaa\x12\xc0\x58\x1a"
-+ "\x9a\x62\x6e\x42\x3d\x44\x63\xdd"
-+ "\xee\x7e\xe3\xa3\xdf\x2a\x65\x05"
-+ "\xd0\xc1\xd2\x54\x55\x35\x5c\xc7"
-+ "\xb0\xb5\xb1\x36\xe0\x0b\xaf\x72",
-+ .clen = 32 + 48,
++ "\x34\x06\x2b\x3d\xf1\xa8\x3d\xf1"
++ "\xa6\x5e\x5c\x1a\xdb\x0c\xb5\x1e"
++ "\x8f\xdb\xf4\xca\x7d\x09\x5e\x81"
++ "\xdb\x32\x07\x4a\x1d\x1c\x6d\x83",
++ .clen = 32 + 32,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 48 + 36,
++ .klen = 8 + 32 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xb1\x7b\xb1\xec\xca\x94\x55\xc4"
-+ "\x3f\x2b\xb1\x70\x04\x91\xf5\x9d"
-+ "\x1a\xc0\xe1\x2a\x93\x5f\x96\x2a"
-+ "\x12\x85\x38\x36\xe1\xb2\xe9\xf0"
-+ "\xf2\x6e\x5d\x81\xcc\x49\x07\x9c"
-+ "\x5b\x88\xc8\xcc\xc4\x21\x4f\x32",
-+ .clen = 16 + 48,
++ "\xc3\xb4\x5f\xb0\xbf\xf5\x1b\xff"
++ "\x7c\xf1\x79\x00\x63\x50\xdd\x77"
++ "\xc0\x4a\xba\xcd\xdc\x47\x05\x2a"
++ "\x5d\x85\x2d\x83\x44\xca\x79\x2c",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 48 + 36,
++ .klen = 8 + 32 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xd6\x96\xbb\x12\x39\xc4\x4d\xe2"
-+ "\x4c\x02\xe7\x1f\xdc\xb2\xb1\x57"
-+ "\x38\x0d\xdd\x13\xb3\x89\x57\x9e"
-+ "\x1f\xb5\x48\x32\xc4\xd3\x9d\x1f"
-+ "\x68\xab\x8d\xc6\xa8\x05\x3a\xc2"
-+ "\x87\xaf\x23\xb3\xe4\x1b\xde\xb3",
-+ .clen = 32 + 48,
++ "\xc8\x59\x5d\xe1\xba\xac\x13\x82"
++ "\xfd\x21\x7c\x8c\x23\x31\x04\x02"
++ "\x9e\x69\x5b\x57\xa8\x13\xe7\x21"
++ "\x60\x0c\x24\xc2\x80\x4a\x93\x6e",
++ .clen = 32 + 32,
+ },
+};
+
- static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 07f1bc80c478c7198065d3896ed3685428314a9c Mon Sep 17 00:00:00 2001
+From 2f0814271715f974ae1fc6247c9918906c83e24b Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:24 +0100
-Subject: [PATCH 5/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha512),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:23 +0100
+Subject: [PATCH 4/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha384),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA512) computed with software implementation.
+vectors and adding HMAC(SHA384) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 291 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 296 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 263 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 268 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4545,8 +4545,12 @@ static const struct alg_test_desc alg_te
+@@ -4514,8 +4514,12 @@ static const struct alg_test_desc alg_te
.fips_allowed = 1,
}, {
- .alg = "authenc(hmac(sha512),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha512-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha384-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha512_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha384_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "blake2b-160",
- .test = alg_test_hash,
+ .alg = "authenc(hmac(sha512),cbc(aes))",
+ .fips_allowed = 1,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -19719,6 +19719,297 @@ static const struct aead_testvec hmac_md
+@@ -19180,6 +19180,269 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha512_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha384_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\xa4\x45\x3a\x44\x9c\xe5\x1c\xd9"
-+ "\x10\x43\x51\x2e\x76\x5e\xf8\x9d"
-+ "\x03\x12\x1a\x31\x00\x33\x10\xb4"
-+ "\x94\x4b\x70\x84\x6c\xda\xb1\x46"
-+ "\x24\xb6\x3b\x2a\xec\xd5\x67\xb8"
-+ "\x65\xa2\xbd\xac\x18\xe2\xf8\x55"
-+ "\xc6\x91\xb0\x92\x84\x2d\x74\x44"
-+ "\xa7\xee\xc3\x44\xa0\x07\x0e\x62",
-+ .clen = 16 + 64,
++ "\x45\x51\x59\x72\x16\xd3\xc6\x15"
++ "\x25\x1e\xe8\x92\x2e\x47\x52\xcc"
++ "\x91\x9c\x24\xef\x11\xb2\x53\x00"
++ "\x10\x20\x43\x06\xe2\x35\x88\x9e"
++ "\x18\x32\x5a\x79\x7d\x73\x7e\x89"
++ "\xfe\xa1\xda\xa4\x86\xc4\x2a\x04",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\xec\x67\x0d\xb3\xbd\x98\x13\x01"
-+ "\x2b\x04\x9b\xe6\x06\x67\x3c\x76"
-+ "\xcd\x41\xb7\xcc\x70\x6c\x7f\xc8"
-+ "\x67\xbd\x22\x39\xb2\xaa\xe8\x88"
-+ "\xe0\x4f\x81\x52\xdf\xc9\xc3\xd6"
-+ "\x44\xf4\x66\x33\x87\x64\x61\x02"
-+ "\x02\xa2\x64\x15\x2b\xe9\x0b\x3d"
-+ "\x4c\xea\xa1\xa5\xa7\xc9\xd3\x1b",
-+ .clen = 32 + 64,
++ "\x83\x65\x32\x1e\x6b\x60\xe6\x4a"
++ "\xe2\xab\x52\x2b\xa6\x70\x3a\xfa"
++ "\xd2\xec\x83\xe4\x31\x0c\x28\x40"
++ "\x9b\x5e\x18\xa4\xdc\x48\xb8\x56"
++ "\x33\xab\x7f\x2b\xaf\xe4\x3a\xe3"
++ "\x8a\x61\xf6\x22\xb4\x6b\xfe\x7d",
++ .clen = 32 + 48,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
-+ "\x44\x55\x66\x77\x88\x99\xaa\xbb"
-+ "\xcc\xdd\xee\xff\x11\x22\x33\x44"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x6f\x90\xb6\xa3\x35\x43\x59\xff"
-+ "\x1e\x32\xd6\xfe\xfa\x33\xf9\xf0"
-+ "\x31\x2f\x03\x2d\x88\x1d\xab\xbf"
-+ "\x0e\x19\x16\xd9\xf3\x98\x3e\xdd"
-+ "\x0c\xec\xfe\xe8\x89\x13\x91\x15"
-+ "\xf6\x61\x65\x5c\x1b\x7d\xde\xc0"
-+ "\xe4\xba\x6d\x27\xe2\x89\x23\x24"
-+ "\x15\x82\x37\x3d\x48\xd3\xc9\x32",
-+ .clen = 36 + 64,
++ "\x4a\xaa\xad\x3b\x3b\xb6\x9a\xba"
++ "\xa1\x7b\xc6\xce\x96\xc3\xff\x67"
++ "\xf3\x0c\x33\x57\xf0\x51\x24\x08"
++ "\xed\x4f\x6a\x9c\x22\x42\xbd\x18"
++ "\x97\x74\x68\x36\x00\xf1\x69\x3a"
++ "\x18\x77\x40\xf0\x56\xba\xba\xe0",
++ .clen = 36 + 48,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 64 + 28,
++ .klen = 8 + 48 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x25\xea\xdc\xad\x52\xb8\x0f\x70"
-+ "\xe7\x39\x83\x80\x10\x3f\x18\xc4"
-+ "\xf8\x59\x14\x25\x5f\xba\x20\x87"
-+ "\x0b\x04\x5e\xf7\xde\x41\x39\xff"
-+ "\xa2\xee\x84\x3f\x9d\x38\xfd\x17"
-+ "\xc0\x66\x5e\x74\x39\xe3\xd3\xd7"
-+ "\x3d\xbc\xe3\x99\x2f\xe7\xef\x37"
-+ "\x61\x03\xf3\x9e\x01\xaf\xba\x9d",
-+ .clen = 16 + 64,
++ "\x36\xd6\xc7\x55\xac\xb6\x0b\x14"
++ "\x95\x71\xf9\x86\x30\xe3\x96\xc3"
++ "\x76\x85\x6d\xa5\x06\xed\x6f\x34"
++ "\xcc\x1f\xcc\x2d\x88\x06\xb0\x1d"
++ "\xbe\xd9\xa2\xd3\x64\xf1\x33\x03"
++ "\x13\x50\x8f\xae\x61\x2d\x82\xb8",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 64 + 28,
++ .klen = 8 + 48 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x51\xa3\xe6\x1d\x23\x7d\xd1\x18"
-+ "\x55\x9c\x1c\x92\x2b\xc2\xcd\xfe"
-+ "\x8a\xa8\xa5\x96\x65\x2e\x9d\xdb"
-+ "\x06\xd2\x1c\x57\x2b\x76\xb5\x9c"
-+ "\xd4\x3e\x8b\x61\x54\x2d\x08\xe5"
-+ "\xb2\xf8\x88\x20\x0c\xad\xe8\x85"
-+ "\x61\x8e\x5c\xa4\x96\x2c\xe2\x7d"
-+ "\x4f\xb6\x1d\xb2\x8c\xd7\xe3\x38",
-+ .clen = 32 + 64,
++ "\x80\x12\x67\x22\xf2\x4d\x9b\xbf"
++ "\xdc\x38\xd3\xaa\x12\xc0\x58\x1a"
++ "\x9a\x62\x6e\x42\x3d\x44\x63\xdd"
++ "\xee\x7e\xe3\xa3\xdf\x2a\x65\x05"
++ "\xd0\xc1\xd2\x54\x55\x35\x5c\xc7"
++ "\xb0\xb5\xb1\x36\xe0\x0b\xaf\x72",
++ .clen = 32 + 48,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 64 + 36,
++ .klen = 8 + 48 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\x6b\x68\x0b\x99\x9a\x4d\xc8\xb9"
-+ "\x35\xea\xcd\x56\x3f\x40\xa2\xb6"
-+ "\x68\xda\x59\xd8\xa0\x89\xcd\x52"
-+ "\xb1\x6e\xed\xc1\x42\x10\xa5\x0f"
-+ "\x88\x0b\x80\xce\xc4\x67\xf0\x45"
-+ "\x5d\xb2\x9e\xde\x1c\x79\x52\x0d"
-+ "\xff\x75\x36\xd5\x0f\x52\x8e\xe5"
-+ "\x31\x85\xcf\x1d\x31\xf8\x62\x67",
-+ .clen = 16 + 64,
++ "\xb1\x7b\xb1\xec\xca\x94\x55\xc4"
++ "\x3f\x2b\xb1\x70\x04\x91\xf5\x9d"
++ "\x1a\xc0\xe1\x2a\x93\x5f\x96\x2a"
++ "\x12\x85\x38\x36\xe1\xb2\xe9\xf0"
++ "\xf2\x6e\x5d\x81\xcc\x49\x07\x9c"
++ "\x5b\x88\xc8\xcc\xc4\x21\x4f\x32",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 64 + 36,
++ .klen = 8 + 48 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\x9a\xac\x38\xbd\xf3\xcf\xd5\xd0"
-+ "\x09\x07\xa6\xe1\x7f\xd6\x79\x98"
-+ "\x4e\x90\x0e\xc0\x3d\xa0\xf2\x12"
-+ "\x52\x79\x9c\x17\xff\xb9\xb8\xe3"
-+ "\x2f\x31\xcb\xbd\x63\x70\x72\x7b"
-+ "\x4e\x1e\xd1\xde\xb5\x6b\x7d\x54"
-+ "\x68\x56\xdd\xe5\x53\xee\x29\xd2"
-+ "\x85\xa1\x73\x61\x00\xa9\x26\x8f",
-+ .clen = 32 + 64,
++ "\xd6\x96\xbb\x12\x39\xc4\x4d\xe2"
++ "\x4c\x02\xe7\x1f\xdc\xb2\xb1\x57"
++ "\x38\x0d\xdd\x13\xb3\x89\x57\x9e"
++ "\x1f\xb5\x48\x32\xc4\xd3\x9d\x1f"
++ "\x68\xab\x8d\xc6\xa8\x05\x3a\xc2"
++ "\x87\xaf\x23\xb3\xe4\x1b\xde\xb3",
++ .clen = 32 + 48,
+ },
+};
+
- static const struct aead_testvec hmac_sha1_des_cbc_tv_temp[] = {
- { /*Generated with cryptopp*/
+ static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
--- /dev/null
+From 82fc2b17fa5b9b12d34770afcc8e3c4288735429 Mon Sep 17 00:00:00 2001
+From: Aleksander Jan Bajkowski <olek2@wp.pl>
+Date: Thu, 5 Mar 2026 21:08:24 +0100
+Subject: [PATCH 5/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha512),rfc3686(ctr(aes)))
+
+Test vectors were generated starting from existing RFC3686(CTR(AES)) test
+vectors and adding HMAC(SHA512) computed with software implementation.
+Then, the results were double-checked on Mediatek MT7986 (safexcel).
+Platform pass self-tests.
+
+Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.c | 6 +-
+ crypto/testmgr.h | 291 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 296 insertions(+), 1 deletion(-)
+
+--- a/crypto/testmgr.c
++++ b/crypto/testmgr.c
+@@ -4545,8 +4545,12 @@ static const struct alg_test_desc alg_te
+ .fips_allowed = 1,
+ }, {
+ .alg = "authenc(hmac(sha512),rfc3686(ctr(aes)))",
+- .test = alg_test_null,
++ .generic_driver = "authenc(hmac-sha512-lib,rfc3686(ctr(aes-lib)))",
++ .test = alg_test_aead,
+ .fips_allowed = 1,
++ .suite = {
++ .aead = __VECS(hmac_sha512_aes_ctr_rfc3686_tv_temp)
++ }
+ }, {
+ .alg = "blake2b-160",
+ .test = alg_test_hash,
+--- a/crypto/testmgr.h
++++ b/crypto/testmgr.h
+@@ -19839,6 +19839,297 @@ static const struct aead_testvec hmac_md
+ },
+ };
+
++static const struct aead_testvec hmac_sha512_aes_ctr_rfc3686_tv_temp[] = {
++ { /* RFC 3686 Case 1 */
++#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\x14" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
++ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
++ "\x00\x00\x00\x30",
++ .klen = 8 + 64 + 20,
++ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
++ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
++ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
++ "\xa4\x45\x3a\x44\x9c\xe5\x1c\xd9"
++ "\x10\x43\x51\x2e\x76\x5e\xf8\x9d"
++ "\x03\x12\x1a\x31\x00\x33\x10\xb4"
++ "\x94\x4b\x70\x84\x6c\xda\xb1\x46"
++ "\x24\xb6\x3b\x2a\xec\xd5\x67\xb8"
++ "\x65\xa2\xbd\xac\x18\xe2\xf8\x55"
++ "\xc6\x91\xb0\x92\x84\x2d\x74\x44"
++ "\xa7\xee\xc3\x44\xa0\x07\x0e\x62",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 2 */
++#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\x14" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
++ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
++ "\x00\x6c\xb6\xdb",
++ .klen = 8 + 64 + 20,
++ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
++ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
++ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
++ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
++ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
++ "\xec\x67\x0d\xb3\xbd\x98\x13\x01"
++ "\x2b\x04\x9b\xe6\x06\x67\x3c\x76"
++ "\xcd\x41\xb7\xcc\x70\x6c\x7f\xc8"
++ "\x67\xbd\x22\x39\xb2\xaa\xe8\x88"
++ "\xe0\x4f\x81\x52\xdf\xc9\xc3\xd6"
++ "\x44\xf4\x66\x33\x87\x64\x61\x02"
++ "\x02\xa2\x64\x15\x2b\xe9\x0b\x3d"
++ "\x4c\xea\xa1\xa5\xa7\xc9\xd3\x1b",
++ .clen = 32 + 64,
++ }, { /* RFC 3686 Case 3 */
++#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\x14" /* enc key length */
++ "\x11\x22\x33\x44\x55\x66\x77\x88"
++ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
++ "\x22\x33\x44\x55\x66\x77\x88\x99"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\x44\x55\x66\x77\x88\x99\xaa\xbb"
++ "\xcc\xdd\xee\xff\x11\x22\x33\x44"
++ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
++ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
++ "\x00\xe0\x01\x7b",
++ .klen = 8 + 64 + 20,
++ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
++ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
++ "\x20\x21\x22\x23",
++ .plen = 36,
++ .ctext = "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9"
++ "\xcf\x46\x52\xe9\xef\xdb\x72\xd7"
++ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
++ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
++ "\x25\xb2\x07\x2f"
++ "\x6f\x90\xb6\xa3\x35\x43\x59\xff"
++ "\x1e\x32\xd6\xfe\xfa\x33\xf9\xf0"
++ "\x31\x2f\x03\x2d\x88\x1d\xab\xbf"
++ "\x0e\x19\x16\xd9\xf3\x98\x3e\xdd"
++ "\x0c\xec\xfe\xe8\x89\x13\x91\x15"
++ "\xf6\x61\x65\x5c\x1b\x7d\xde\xc0"
++ "\xe4\xba\x6d\x27\xe2\x89\x23\x24"
++ "\x15\x82\x37\x3d\x48\xd3\xc9\x32",
++ .clen = 36 + 64,
++ }, { /* RFC 3686 Case 4 */
++#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\x1c" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
++ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
++ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
++ "\x00\x00\x00\x48",
++ .klen = 8 + 64 + 28,
++ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
++ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
++ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
++ "\x25\xea\xdc\xad\x52\xb8\x0f\x70"
++ "\xe7\x39\x83\x80\x10\x3f\x18\xc4"
++ "\xf8\x59\x14\x25\x5f\xba\x20\x87"
++ "\x0b\x04\x5e\xf7\xde\x41\x39\xff"
++ "\xa2\xee\x84\x3f\x9d\x38\xfd\x17"
++ "\xc0\x66\x5e\x74\x39\xe3\xd3\xd7"
++ "\x3d\xbc\xe3\x99\x2f\xe7\xef\x37"
++ "\x61\x03\xf3\x9e\x01\xaf\xba\x9d",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 5 */
++#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\x1c" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
++ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
++ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
++ "\x00\x96\xb0\x3b",
++ .klen = 8 + 64 + 28,
++ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
++ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
++ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
++ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
++ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
++ "\x51\xa3\xe6\x1d\x23\x7d\xd1\x18"
++ "\x55\x9c\x1c\x92\x2b\xc2\xcd\xfe"
++ "\x8a\xa8\xa5\x96\x65\x2e\x9d\xdb"
++ "\x06\xd2\x1c\x57\x2b\x76\xb5\x9c"
++ "\xd4\x3e\x8b\x61\x54\x2d\x08\xe5"
++ "\xb2\xf8\x88\x20\x0c\xad\xe8\x85"
++ "\x61\x8e\x5c\xa4\x96\x2c\xe2\x7d"
++ "\x4f\xb6\x1d\xb2\x8c\xd7\xe3\x38",
++ .clen = 32 + 64,
++ }, { /* RFC 3686 Case 7 */
++#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\x24" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
++ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
++ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
++ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
++ "\x00\x00\x00\x60",
++ .klen = 8 + 64 + 36,
++ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
++ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
++ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
++ "\x6b\x68\x0b\x99\x9a\x4d\xc8\xb9"
++ "\x35\xea\xcd\x56\x3f\x40\xa2\xb6"
++ "\x68\xda\x59\xd8\xa0\x89\xcd\x52"
++ "\xb1\x6e\xed\xc1\x42\x10\xa5\x0f"
++ "\x88\x0b\x80\xce\xc4\x67\xf0\x45"
++ "\x5d\xb2\x9e\xde\x1c\x79\x52\x0d"
++ "\xff\x75\x36\xd5\x0f\x52\x8e\xe5"
++ "\x31\x85\xcf\x1d\x31\xf8\x62\x67",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 8 */
++#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\x24" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
++ "\x07\x96\x36\x58\x79\xef\xf8\x86"
++ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
++ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
++ "\x00\xfa\xac\x24",
++ .klen = 8 + 64 + 36,
++ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
++ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
++ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
++ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
++ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
++ "\x9a\xac\x38\xbd\xf3\xcf\xd5\xd0"
++ "\x09\x07\xa6\xe1\x7f\xd6\x79\x98"
++ "\x4e\x90\x0e\xc0\x3d\xa0\xf2\x12"
++ "\x52\x79\x9c\x17\xff\xb9\xb8\xe3"
++ "\x2f\x31\xcb\xbd\x63\x70\x72\x7b"
++ "\x4e\x1e\xd1\xde\xb5\x6b\x7d\x54"
++ "\x68\x56\xdd\xe5\x53\xee\x29\xd2"
++ "\x85\xa1\x73\x61\x00\xa9\x26\x8f",
++ .clen = 32 + 64,
++ },
++};
++
+ static const struct aead_testvec hmac_sha1_des_cbc_tv_temp[] = {
+ { /*Generated with cryptopp*/
+ #ifdef __LITTLE_ENDIAN
--- /dev/null
+From 0441ee8d35ad6998da5043c65c4124904e8daee2 Mon Sep 17 00:00:00 2001
+From: Aleksander Jan Bajkowski <olek2@wp.pl>
+Date: Fri, 6 Feb 2026 20:26:59 +0100
+Subject: [PATCH] crypto: tesmgr - allow authenc(hmac(sha224/sha384),cbc(aes))
+ in fips mode
+
+The remaining combinations of AES-CBC and SHA* have already been marked
+as allowed. This commit does the same for SHA224 and SHA384.
+
+Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/crypto/testmgr.c
++++ b/crypto/testmgr.c
+@@ -4435,6 +4435,7 @@ static const struct alg_test_desc alg_te
+ .alg = "authenc(hmac(sha224),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
++ .fips_allowed = 1,
+ .suite = {
+ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
+ }
+@@ -4493,6 +4494,7 @@ static const struct alg_test_desc alg_te
+ .alg = "authenc(hmac(sha384),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
++ .fips_allowed = 1,
+ .suite = {
+ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
+ }
-From 2a2468bf33d3fac5192429207a439d23e615173a Mon Sep 17 00:00:00 2001
+From d0c0a414cc1893b195b9523ecdfbeee00b98fd0d Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:20 +0100
-Subject: [PATCH 1/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha1),rfc3686(ctr(aes)))
+Date: Thu, 19 Mar 2026 18:11:21 +0100
+Subject: [PATCH] crypto: testmgr - Add test vectors for
+ authenc(hmac(md5),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA1) computed with software implementation.
+vectors and adding HMAC(MD5) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
- crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 221 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 226 insertions(+), 1 deletion(-)
+ crypto/testmgr.c | 7 ++
+ crypto/testmgr.h | 207 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 214 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4232,8 +4232,12 @@ static const struct alg_test_desc alg_te
+@@ -4395,6 +4395,13 @@ static const struct alg_test_desc alg_te
+ .aead = __VECS(hmac_md5_ecb_cipher_null_tv_template)
}
}, {
- .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))",
-- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha1-lib,rfc3686(ctr(aes-lib)))",
++ .alg = "authenc(hmac(md5),rfc3686(ctr(aes)))",
++ .generic_driver = "authenc(hmac-md5-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
- .fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha1_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_md5_aes_ctr_rfc3686_tv_temp)
+ }
- }, {
- .alg = "authenc(hmac(sha224),cbc(aes))",
- .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
++ }, {
+ .alg = "authenc(hmac(sha1),cbc(aes))",
+ .test = alg_test_aead,
+ .fips_allowed = 1,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -16137,6 +16137,227 @@ static const struct aead_testvec hmac_sh
+@@ -20443,6 +20443,213 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha1_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_md5_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x70\xdc\x6b\x62\x43\xa1\x2f\x08"
-+ "\xf1\xec\x93\x7d\x69\xb2\x8e\x1f"
-+ "\x0a\x97\x39\x86",
-+ .clen = 16 + 20,
++ "\xdd\x5f\xea\x13\x2a\xf2\xb0\xf1"
++ "\x91\x79\x46\x40\x62\x6c\x87\x5b",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x6b\x7b\x4d\x39\x36\x1c\x12\x5f"
-+ "\x72\xd2\x88\xb2\x26\xa6\xa6\xb5"
-+ "\x1d\x3a\x49\xa6",
-+ .clen = 32 + 20,
++ "\x03\x39\x23\xcd\x22\x5f\x1b\x8b"
++ "\x93\x70\xbc\x45\xf3\xba\xde\x2e",
++ .clen = 32 + 16,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
-+ "\x22\x33\x44\x55"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x2c\x86\xa0\x90\x8e\xc1\x02\x1d"
-+ "\x51\xdc\xd6\x21\xc7\x30\xcc\x32"
-+ "\x38\x55\x47\x64",
-+ .clen = 36 + 20,
++ "\xb4\x40\x0c\x7b\x4c\x55\x8a\x4b"
++ "\x04\xf7\x48\x9e\x0f\x9a\xae\x73",
++ .clen = 36 + 16,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 20 + 28,
++ .klen = 8 + 16 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\xe9\x4e\x49\xf0\x6b\x8d\x58\x2b"
-+ "\x26\x7f\xf3\xab\xeb\x2f\x74\x2f"
-+ "\x45\x43\x64\xc1",
-+ .clen = 16 + 20,
++ "\xc4\x5d\xa1\x16\x6c\x2d\xa5\x43"
++ "\x60\x7b\x58\x98\x11\x9b\x50\x06",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 20 + 28,
++ .klen = 8 + 16 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\xab\xc4\xfa\x6d\x20\xe1\xce\x72"
-+ "\x0e\x92\x4e\x97\xaa\x4d\x30\x84"
-+ "\xb6\xd8\x4d\x3b",
-+ .clen = 32 + 20,
++ "\xc5\xec\x47\x33\xae\x05\x28\x49"
++ "\xd5\x2b\x08\xad\x10\x98\x24\x01",
++ .clen = 32 + 16,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 20 + 36,
++ .klen = 8 + 16 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\x3d\x6c\x23\x27\xda\x0e\x7f\x29"
-+ "\xfd\x8d\x3c\x1b\xf7\x7a\x63\xd9"
-+ "\x7e\x0f\xe9\xf6",
-+ .clen = 16 + 20,
++ "\xc6\x26\xb2\x27\x0d\x21\xd4\x40"
++ "\x6c\x4f\x53\xea\x19\x75\xda\x8e",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 20 + 36,
++ .klen = 8 + 16 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xe7\xee\x22\xa4\xdd\xbf\x5d\x44"
-+ "\x3b\x43\x1c\x69\x55\x11\xd5\xad"
-+ "\x14\x5f\x44\xa6",
-+ .clen = 32 + 20,
++ "\x8c\x4d\x2a\x8d\x23\x47\x59\x6f"
++ "\x1e\x74\x62\x39\xed\x14\x50\x6c",
++ .clen = 32 + 16,
+ },
+};
+
- static const struct aead_testvec hmac_sha1_ecb_cipher_null_tv_temp[] = {
- { /* Input data from RFC 2410 Case 1 */
+ static const struct aead_testvec hmac_md5_des3_ede_cbc_tv_temp[] = {
+ { /*Generated with cryptopp*/
#ifdef __LITTLE_ENDIAN
-From dd227f442774a570ffccdfbc9536fec3b4666305 Mon Sep 17 00:00:00 2001
+From c8aadd63ab58ee75713ab487730563e7a160cc35 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Sat, 31 Jan 2026 12:35:30 +0100
+Date: Tue, 3 Mar 2026 19:48:44 +0100
Subject: [PATCH] crypto: testmgr - Add test vectors for
authenc(hmac(md5),cbc(aes))
and NXP P2020 (talitos). Both platforms pass self-tests.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 7 ++
crypto/testmgr.h | 255 +++++++++++++++++++++++++++++++++++++++++++++++
}
}, {
+ .alg = "authenc(hmac(md5),cbc(aes))",
-+ .generic_driver = "authenc(hmac-md5-lib,cbc(aes-generic))",
++ .generic_driver = "authenc(hmac-md5-lib,cbc(aes-lib))",
+ .test = alg_test_aead,
+ .suite = {
+ .aead = __VECS(hmac_md5_aes_cbc_tv_temp)
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17133,6 +17133,261 @@ static const struct cipher_testvec aes_c
+@@ -17253,6 +17253,261 @@ static const struct cipher_testvec aes_c
},
};
--- /dev/null
+From c637f3e4a59d710ffd80da1c11d2ebed162d8ff0 Mon Sep 17 00:00:00 2001
+From: Thorsten Blum <thorsten.blum@linux.dev>
+Date: Mon, 17 Nov 2025 12:44:26 +0100
+Subject: [PATCH] crypto: testmgr - Add missing DES weak and semi-weak key
+ tests
+
+Ever since commit da7f033ddc9f ("crypto: cryptomgr - Add test
+infrastructure"), the DES test suite has tested only one of the four
+weak keys and none of the twelve semi-weak keys.
+
+DES has four weak keys and twelve semi-weak keys, and the kernel's DES
+implementation correctly detects and rejects all of these keys when the
+CRYPTO_TFM_REQ_FORBID_WEAK_KEYS flag is set. However, only a single weak
+key was being tested. Add tests for all 16 weak and semi-weak keys.
+
+While DES is deprecated, it is still used in some legacy protocols, and
+weak/semi-weak key detection should be tested accordingly.
+
+Tested on arm64 with cryptographic self-tests.
+
+Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.h | 120 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 120 insertions(+)
+
+--- a/crypto/testmgr.h
++++ b/crypto/testmgr.h
+@@ -9023,6 +9023,126 @@ static const struct cipher_testvec des_t
+ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
+ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
+ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\xe0\xe0\xe0\xf1\xf1\xf1\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\x1f\x1f\x1f\x0e\x0e\x0e\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Weak key */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 1a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\xfe\x01\xfe\x01\xfe\x01\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 1b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\x01\xfe\x01\xfe\x01\xfe\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 2a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\xe0\x1f\xe0\x0e\xf1\x0e\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 2b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\x1f\xe0\x1f\xf1\x0e\xf1\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 3a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\xe0\x01\xe0\x01\xf1\x01\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 3b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\x01\xe0\x01\xf1\x01\xf1\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 4a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\xfe\x1f\xfe\x0e\xfe\x0e\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 4b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\x1f\xfe\x1f\xfe\x0e\xfe\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 5a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x01\x1f\x01\x1f\x01\x0e\x01\x0e",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 5b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\x1f\x01\x1f\x01\x0e\x01\x0e\x01",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 6a */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xe0\xfe\xe0\xfe\xf1\xfe\xf1\xfe",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
++ }, { /* Semi-weak key pair 6b */
++ .setkey_error = -EINVAL,
++ .wk = 1,
++ .key = "\xfe\xe0\xfe\xe0\xfe\xf1\xfe\xf1",
++ .klen = 8,
++ .ptext = "\x01\x23\x45\x67\x89\xab\xcd\xe7",
++ .ctext = "\xc9\x57\x44\x25\x6a\x5e\xd3\x1d",
++ .len = 8,
+ }, { /* Two blocks -- for testing encryption across pages */
+ .key = "\x01\x23\x45\x67\x89\xab\xcd\xef",
+ .klen = 8,
-From a22d48cbe55814061d46db2f87090ba5e36aaf7f Mon Sep 17 00:00:00 2001
+From 030218dedee2628ea3f035d71431e1b7c4191cfb Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Sat, 31 Jan 2026 18:43:03 +0100
+Date: Sat, 31 Jan 2026 18:38:47 +0100
Subject: [PATCH] crypto: testmgr - Add test vectors for
- authenc(hmac(sha224),cbc(aes))
+ authenc(hmac(sha384),cbc(aes))
Test vectors were generated starting from existing CBC(AES) test vectors
-(RFC3602, NIST SP800-38A) and adding HMAC(SHA224) computed with Python
+(RFC3602, NIST SP800-38A) and adding HMAC(SHA384) computed with Python
script. Then, the results were double-checked on Mediatek MT7981 (safexcel)
and NXP P2020 (talitos). Both platforms pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 7 ++
- crypto/testmgr.h | 285 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 292 insertions(+)
+ crypto/testmgr.h | 311 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 318 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4221,6 +4221,13 @@ static const struct alg_test_desc alg_te
+@@ -4272,6 +4272,13 @@ static const struct alg_test_desc alg_te
.test = alg_test_null,
.fips_allowed = 1,
}, {
-+ .alg = "authenc(hmac(sha224),cbc(aes))",
-+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
++ .alg = "authenc(hmac(sha384),cbc(aes))",
++ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
+ .suite = {
-+ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
++ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
+ }
+ }, {
- .alg = "authenc(hmac(sha224),cbc(des))",
- .generic_driver = "authenc(hmac-sha224-lib,cbc(des-generic))",
+ .alg = "authenc(hmac(sha384),cbc(des))",
+ .generic_driver = "authenc(hmac-sha384-lib,cbc(des-generic))",
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -16183,6 +16183,291 @@ static const struct aead_testvec hmac_sh
+@@ -16586,6 +16586,317 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha224_aes_cbc_tv_temp[] = {
++static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\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 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+ .assoc = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "Single block msg",
+ .plen = 16,
+ .ctext = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+ "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
-+ "\x17\xe8\x00\x76\x70\x71\xd1\x72"
-+ "\xf8\xd0\x91\x51\x67\xf9\xdf\xd6"
-+ "\x0d\x56\x1a\xb3\x52\x19\x85\xae"
-+ "\x46\x74\xb6\x98",
-+ .clen = 16 + 28,
++ "\x79\x1c\xf1\x22\x95\x80\xe0\x60"
++ "\x7f\xf9\x92\x60\x83\xbd\x60\x9c"
++ "\xf6\x62\x8b\xa9\x7d\x56\xe2\xaf"
++ "\x80\x43\xbc\x41\x4a\x63\x0b\xa0"
++ "\x16\x25\xe2\xfe\x0a\x96\xf6\xa5"
++ "\x6c\x0b\xc2\x53\xb4\x27\xd9\x42",
++ .clen = 16 + 48,
+ }, { /* RFC 3602 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+ "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+ .assoc = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+ "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+ "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
-+ "\xa1\x11\xfa\xbb\x1e\x04\x7e\xe7"
-+ "\x4c\x5f\x65\xbf\x68\x8d\x33\x9d"
-+ "\xbc\x74\x9b\xf3\x15\xf3\x8f\x8d"
-+ "\xe8\xaf\x33\xe0",
-+
-+ .clen = 32 + 28,
++ "\x4e\x5b\xa8\x65\x51\xc6\x58\xaf"
++ "\x31\x57\x50\x3d\x01\xa1\xa4\x3f"
++ "\x42\xd1\xd7\x31\x76\x8d\xf8\xc8"
++ "\xe4\xd2\x7e\xc5\x23\xe7\xc6\x2e"
++ "\x2d\xfd\x9d\xc1\xac\x50\x1e\xcf"
++ "\xa0\x10\xeb\x1a\x9c\xb7\xe1\xca",
++ .clen = 32 + 48,
+ }, { /* RFC 3602 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
+ "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
+ .assoc = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "This is a 48-byte message (exactly 3 AES blocks)",
+ .plen = 48,
+ .ctext = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
+ "\x50\x69\x39\x27\x67\x72\xf8\xd5"
+ "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
+ "\x85\x79\x69\x5d\x83\xba\x26\x84"
-+ "\x60\xb3\xca\x0e\xc1\xfe\xf2\x27"
-+ "\x5a\x41\xe4\x99\xa8\x19\x56\xf1"
-+ "\x44\x98\x27\x9f\x99\xb0\x4a\xad"
-+ "\x4d\xc1\x1e\x88",
-+ .clen = 48 + 28,
++ "\xa1\x52\xe7\xda\xf7\x05\xb6\xca"
++ "\xad\x0f\x51\xed\x5a\xd3\x0f\xdf"
++ "\xde\xeb\x3f\x31\xed\x3a\x43\x93"
++ "\x3b\xb7\xca\xc8\x1b\xe7\x3b\x61"
++ "\x6a\x05\xfd\x2d\x6a\x5c\xb1\x0d"
++ "\x6e\x7a\xeb\x1c\x84\xec\xdb\xde",
++ .clen = 48 + 48,
+ }, { /* RFC 3602 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
+ "\xbc\x46\x90\x3d\xba\x29\x03\x49",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
+ .assoc = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+ "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+ "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
+ "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
+ "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
-+ "\xbb\xe9\x38\xf8\xb9\xbf\xcb\x7b"
-+ "\xa8\x22\x91\xea\x1e\xaf\x13\xba"
-+ "\x24\x18\x64\x9c\xcb\xb4\xa9\x16"
-+ "\x4b\x83\x9c\xec",
-+ .clen = 64 + 28,
++ "\x85\x7b\x91\xe0\x29\xeb\xd3\x59"
++ "\x7c\xe3\x67\x14\xbe\x71\x2a\xd2"
++ "\x8a\x1a\xd2\x35\x78\x6b\x69\xba"
++ "\x64\xa5\x04\x00\x19\xc3\x4c\xae"
++ "\x71\xff\x76\x9f\xbb\xc3\x29\x22"
++ "\xc2\xc6\x51\xf1\xe6\x29\x5e\xa5",
++ .clen = 64 + 48,
+ }, { /* RFC 3602 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
+ "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
-+ .klen = 8 + 28 + 16,
++ .klen = 8 + 48 + 16,
+ .iv = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
+ "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
+ .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01"
+ "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
+ "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
+ "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
-+ "\x04\x5e\x83\x45\xc5\x6a\x5b\xe2"
-+ "\x5e\xd8\x59\x06\xbd\xc7\xd2\x9b"
-+ "\x0b\x65\x1f\x31\xc7\xe6\x9c\x39"
-+ "\xa3\x66\xdb\xb8",
-+ .clen = 80 + 28,
++ "\x57\x5f\xb4\xd7\x74\x6f\x18\x97"
++ "\xb7\xde\xfc\xf3\x4e\x0d\x29\x4d"
++ "\xa0\xff\x39\x9e\x2d\xbf\x27\xac"
++ "\x54\xb9\x8a\x3e\xab\x3b\xac\xd3"
++ "\x36\x43\x74\xfc\xc2\x64\x81\x8a"
++ "\x2c\x15\x72\xdf\x3f\x9d\x5b\xa4",
++ .clen = 80 + 48,
+ }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+ "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+ "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-+ .klen = 8 + 28 + 24,
++ .klen = 8 + 48 + 24,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+ "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+ "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
-+ "\x67\x35\xcd\x86\x94\x51\x3b\x3a"
-+ "\xaa\x07\xb1\xed\x18\x55\x62\x01"
-+ "\x95\xb2\x53\xb5\x20\x78\x16\xd7"
-+ "\xb8\x49\x7f\x96",
-+
-+ .clen = 64 + 28,
++ "\x29\x9b\x42\x47\x0b\xbf\xf3\x54"
++ "\x54\x95\xb0\x89\xd5\xa0\xc3\x78"
++ "\x60\x6c\x18\x39\x6d\xc9\xfb\x2a"
++ "\x34\x1c\xed\x95\x10\x1e\x43\x0a"
++ "\x72\xce\x26\xbc\x74\xd9\x6f\xa2"
++ "\xf1\xd9\xd0\xb1\xdf\x3d\x93\x14",
++ .clen = 64 + 48,
+ }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+ "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+ "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+ "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
-+ .klen = 8 + 28 + 32,
++ .klen = 8 + 48 + 32,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\xa5\x30\xe2\x63\x04\x23\x14\x61"
+ "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
+ "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
-+ "\xe0\xe2\x3d\x3f\x55\x24\x2c\x4d"
-+ "\xb9\x13\x2a\xc0\x07\xbb\x3b\xda"
-+ "\xfd\xa4\x51\x32\x3f\x44\xb1\x13"
-+ "\x98\xf9\xbc\xb9",
-+ .clen = 64 + 28,
++ "\x9f\x50\xce\x64\xd9\xa3\xc9\x7a"
++ "\x15\x3a\x3d\x46\x9a\x90\xf3\x06"
++ "\x22\xad\xc5\x24\x77\x50\xb8\xfe"
++ "\xbe\x37\x16\x86\x34\x5f\xaf\x97"
++ "\x00\x9d\x86\xc8\x32\x4f\x72\x2f"
++ "\x48\x97\xad\xb6\xb9\x77\x33\xbc",
++ .clen = 64 + 48,
+ },
+};
+
- static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 030218dedee2628ea3f035d71431e1b7c4191cfb Mon Sep 17 00:00:00 2001
+From a22d48cbe55814061d46db2f87090ba5e36aaf7f Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Sat, 31 Jan 2026 18:38:47 +0100
+Date: Sat, 31 Jan 2026 18:43:03 +0100
Subject: [PATCH] crypto: testmgr - Add test vectors for
- authenc(hmac(sha384),cbc(aes))
+ authenc(hmac(sha224),cbc(aes))
Test vectors were generated starting from existing CBC(AES) test vectors
-(RFC3602, NIST SP800-38A) and adding HMAC(SHA384) computed with Python
+(RFC3602, NIST SP800-38A) and adding HMAC(SHA224) computed with Python
script. Then, the results were double-checked on Mediatek MT7981 (safexcel)
and NXP P2020 (talitos). Both platforms pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 7 ++
- crypto/testmgr.h | 311 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 318 insertions(+)
+ crypto/testmgr.h | 285 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 292 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4272,6 +4272,13 @@ static const struct alg_test_desc alg_te
+@@ -4221,6 +4221,13 @@ static const struct alg_test_desc alg_te
.test = alg_test_null,
.fips_allowed = 1,
}, {
-+ .alg = "authenc(hmac(sha384),cbc(aes))",
-+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
++ .alg = "authenc(hmac(sha224),cbc(aes))",
++ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
+ .suite = {
-+ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
++ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
+ }
+ }, {
- .alg = "authenc(hmac(sha384),cbc(des))",
- .generic_driver = "authenc(hmac-sha384-lib,cbc(des-generic))",
+ .alg = "authenc(hmac(sha224),cbc(des))",
+ .generic_driver = "authenc(hmac-sha224-lib,cbc(des-generic))",
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -16466,6 +16466,317 @@ static const struct aead_testvec hmac_sh
+@@ -16303,6 +16303,291 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
++static const struct aead_testvec hmac_sha224_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\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 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
+ .assoc = "\x3d\xaf\xba\x42\x9d\x9e\xb4\x30"
+ "\xb4\x22\xda\x80\x2c\x9f\xac\x41",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "Single block msg",
+ .plen = 16,
+ .ctext = "\xe3\x53\x77\x9c\x10\x79\xae\xb8"
+ "\x27\x08\x94\x2d\xbe\x77\x18\x1a"
-+ "\x79\x1c\xf1\x22\x95\x80\xe0\x60"
-+ "\x7f\xf9\x92\x60\x83\xbd\x60\x9c"
-+ "\xf6\x62\x8b\xa9\x7d\x56\xe2\xaf"
-+ "\x80\x43\xbc\x41\x4a\x63\x0b\xa0"
-+ "\x16\x25\xe2\xfe\x0a\x96\xf6\xa5"
-+ "\x6c\x0b\xc2\x53\xb4\x27\xd9\x42",
-+ .clen = 16 + 48,
++ "\x17\xe8\x00\x76\x70\x71\xd1\x72"
++ "\xf8\xd0\x91\x51\x67\xf9\xdf\xd6"
++ "\x0d\x56\x1a\xb3\x52\x19\x85\xae"
++ "\x46\x74\xb6\x98",
++ .clen = 16 + 28,
+ }, { /* RFC 3602 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x38\x39\x3a\x3b"
+ "\xc2\x86\x69\x6d\x88\x7c\x9a\xa0"
+ "\x61\x1b\xbb\x3e\x20\x25\xa4\x5a",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
+ .assoc = "\x56\x2e\x17\x99\x6d\x09\x3d\x28"
+ "\xdd\xb3\xba\x69\x5a\x2e\x6f\x58",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x3a\x86\x30\x28\xb5\xe1\xdc\x0a"
+ "\x75\x86\x60\x2d\x25\x3c\xff\xf9"
+ "\x1b\x82\x66\xbe\xa6\xd6\x1a\xb1"
-+ "\x4e\x5b\xa8\x65\x51\xc6\x58\xaf"
-+ "\x31\x57\x50\x3d\x01\xa1\xa4\x3f"
-+ "\x42\xd1\xd7\x31\x76\x8d\xf8\xc8"
-+ "\xe4\xd2\x7e\xc5\x23\xe7\xc6\x2e"
-+ "\x2d\xfd\x9d\xc1\xac\x50\x1e\xcf"
-+ "\xa0\x10\xeb\x1a\x9c\xb7\xe1\xca",
-+ .clen = 32 + 48,
++ "\xa1\x11\xfa\xbb\x1e\x04\x7e\xe7"
++ "\x4c\x5f\x65\xbf\x68\x8d\x33\x9d"
++ "\xbc\x74\x9b\xf3\x15\xf3\x8f\x8d"
++ "\xe8\xaf\x33\xe0",
++
++ .clen = 32 + 28,
+ }, { /* RFC 3602 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x6c\x3e\xa0\x47\x76\x30\xce\x21"
+ "\xa2\xce\x33\x4a\xa7\x46\xc2\xcd",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
+ .assoc = "\xc7\x82\xdc\x4c\x09\x8c\x66\xcb"
+ "\xd9\xcd\x27\xd8\x25\x68\x2c\x81",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "This is a 48-byte message (exactly 3 AES blocks)",
+ .plen = 48,
+ .ctext = "\xd0\xa0\x2b\x38\x36\x45\x17\x53"
+ "\x50\x69\x39\x27\x67\x72\xf8\xd5"
+ "\x02\x1c\x19\x21\x6b\xad\x52\x5c"
+ "\x85\x79\x69\x5d\x83\xba\x26\x84"
-+ "\xa1\x52\xe7\xda\xf7\x05\xb6\xca"
-+ "\xad\x0f\x51\xed\x5a\xd3\x0f\xdf"
-+ "\xde\xeb\x3f\x31\xed\x3a\x43\x93"
-+ "\x3b\xb7\xca\xc8\x1b\xe7\x3b\x61"
-+ "\x6a\x05\xfd\x2d\x6a\x5c\xb1\x0d"
-+ "\x6e\x7a\xeb\x1c\x84\xec\xdb\xde",
-+ .clen = 48 + 48,
++ "\x60\xb3\xca\x0e\xc1\xfe\xf2\x27"
++ "\x5a\x41\xe4\x99\xa8\x19\x56\xf1"
++ "\x44\x98\x27\x9f\x99\xb0\x4a\xad"
++ "\x4d\xc1\x1e\x88",
++ .clen = 48 + 28,
+ }, { /* RFC 3602 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x56\xe4\x7a\x38\xc5\x59\x89\x74"
+ "\xbc\x46\x90\x3d\xba\x29\x03\x49",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
+ .assoc = "\x8c\xe8\x2e\xef\xbe\xa0\xda\x3c"
+ "\x44\x69\x9e\xd7\xdb\x51\xb7\xd9",
-+ .alen = 16,
++ .alen = 16,
+ .ptext = "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
+ "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
+ "\x86\x8b\xb7\xb2\x9d\x3d\x46\xad"
+ "\x83\xce\x9f\x9a\x10\x2e\xe9\x9d"
+ "\x49\xa5\x3e\x87\xf4\xc3\xda\x55"
-+ "\x85\x7b\x91\xe0\x29\xeb\xd3\x59"
-+ "\x7c\xe3\x67\x14\xbe\x71\x2a\xd2"
-+ "\x8a\x1a\xd2\x35\x78\x6b\x69\xba"
-+ "\x64\xa5\x04\x00\x19\xc3\x4c\xae"
-+ "\x71\xff\x76\x9f\xbb\xc3\x29\x22"
-+ "\xc2\xc6\x51\xf1\xe6\x29\x5e\xa5",
-+ .clen = 64 + 48,
++ "\xbb\xe9\x38\xf8\xb9\xbf\xcb\x7b"
++ "\xa8\x22\x91\xea\x1e\xaf\x13\xba"
++ "\x24\x18\x64\x9c\xcb\xb4\xa9\x16"
++ "\x4b\x83\x9c\xec",
++ .clen = 64 + 28,
+ }, { /* RFC 3602 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x90\xd3\x82\xb4\x10\xee\xba\x7a"
+ "\xd9\x38\xc4\x6c\xec\x1a\x82\xbf",
-+ .klen = 8 + 48 + 16,
++ .klen = 8 + 28 + 16,
+ .iv = "\xe9\x6e\x8c\x08\xab\x46\x57\x63"
+ "\xfd\x09\x8d\x45\xdd\x3f\xf8\x93",
+ .assoc = "\x00\x00\x43\x21\x00\x00\x00\x01"
+ "\x53\x8a\xb5\x0c\x55\x1b\x87\x4a"
+ "\xa2\x69\xad\xd0\x47\xad\x2d\x59"
+ "\x13\xac\x19\xb7\xcf\xba\xd4\xa6"
-+ "\x57\x5f\xb4\xd7\x74\x6f\x18\x97"
-+ "\xb7\xde\xfc\xf3\x4e\x0d\x29\x4d"
-+ "\xa0\xff\x39\x9e\x2d\xbf\x27\xac"
-+ "\x54\xb9\x8a\x3e\xab\x3b\xac\xd3"
-+ "\x36\x43\x74\xfc\xc2\x64\x81\x8a"
-+ "\x2c\x15\x72\xdf\x3f\x9d\x5b\xa4",
-+ .clen = 80 + 48,
++ "\x04\x5e\x83\x45\xc5\x6a\x5b\xe2"
++ "\x5e\xd8\x59\x06\xbd\xc7\xd2\x9b"
++ "\x0b\x65\x1f\x31\xc7\xe6\x9c\x39"
++ "\xa3\x66\xdb\xb8",
++ .clen = 80 + 28,
+ }, { /* NIST SP800-38A F.2.3 CBC-AES192.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x8e\x73\xb0\xf7\xda\x0e\x64\x52"
+ "\xc8\x10\xf3\x2b\x80\x90\x79\xe5"
+ "\x62\xf8\xea\xd2\x52\x2c\x6b\x7b",
-+ .klen = 8 + 48 + 24,
++ .klen = 8 + 28 + 24,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x7f\xa9\xba\xac\x3d\xf1\x02\xe0"
+ "\x08\xb0\xe2\x79\x88\x59\x88\x81"
+ "\xd9\x20\xa9\xe6\x4f\x56\x15\xcd"
-+ "\x29\x9b\x42\x47\x0b\xbf\xf3\x54"
-+ "\x54\x95\xb0\x89\xd5\xa0\xc3\x78"
-+ "\x60\x6c\x18\x39\x6d\xc9\xfb\x2a"
-+ "\x34\x1c\xed\x95\x10\x1e\x43\x0a"
-+ "\x72\xce\x26\xbc\x74\xd9\x6f\xa2"
-+ "\xf1\xd9\xd0\xb1\xdf\x3d\x93\x14",
-+ .clen = 64 + 48,
++ "\x67\x35\xcd\x86\x94\x51\x3b\x3a"
++ "\xaa\x07\xb1\xed\x18\x55\x62\x01"
++ "\x95\xb2\x53\xb5\x20\x78\x16\xd7"
++ "\xb8\x49\x7f\x96",
++
++ .clen = 64 + 28,
+ }, { /* NIST SP800-38A F.2.5 CBC-AES256.Encrypt */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\xaa\xbb\xcc\xdd"
+ "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+ "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+ "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+ "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
-+ .klen = 8 + 48 + 32,
++ .klen = 8 + 28 + 32,
+ .iv = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\xa5\x30\xe2\x63\x04\x23\x14\x61"
+ "\xb2\xeb\x05\xe2\xc3\x9b\xe9\xfc"
+ "\xda\x6c\x19\x07\x8c\x6a\x9d\x1b"
-+ "\x9f\x50\xce\x64\xd9\xa3\xc9\x7a"
-+ "\x15\x3a\x3d\x46\x9a\x90\xf3\x06"
-+ "\x22\xad\xc5\x24\x77\x50\xb8\xfe"
-+ "\xbe\x37\x16\x86\x34\x5f\xaf\x97"
-+ "\x00\x9d\x86\xc8\x32\x4f\x72\x2f"
-+ "\x48\x97\xad\xb6\xb9\x77\x33\xbc",
-+ .clen = 64 + 48,
++ "\xe0\xe2\x3d\x3f\x55\x24\x2c\x4d"
++ "\xb9\x13\x2a\xc0\x07\xbb\x3b\xda"
++ "\xfd\xa4\x51\x32\x3f\x44\xb1\x13"
++ "\x98\xf9\xbc\xb9",
++ .clen = 64 + 28,
+ },
+};
+
- static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17714,6 +17714,65 @@ static const struct aead_testvec hmac_sh
+@@ -17834,6 +17834,65 @@ static const struct aead_testvec hmac_sh
},
};
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17401,6 +17401,63 @@ static const struct aead_testvec hmac_sh
+@@ -17521,6 +17521,63 @@ static const struct aead_testvec hmac_sh
},
};
-From 3f4d32aff1d4e06501f909b1e5037ec8caa76d01 Mon Sep 17 00:00:00 2001
+From b45b4314d3e55be70b597baa1f0ab9283e68003b Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:21 +0100
-Subject: [PATCH 2/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha224),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:20 +0100
+Subject: [PATCH 1/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha1),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA224) computed with software implementation.
+vectors and adding HMAC(SHA1) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 235 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 240 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 221 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 226 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4261,8 +4261,12 @@ static const struct alg_test_desc alg_te
+@@ -4232,8 +4232,12 @@ static const struct alg_test_desc alg_te
}
}, {
- .alg = "authenc(hmac(sha224),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha224-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha1-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha224_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha1_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha256),cbc(aes))",
- .generic_driver = "authenc(hmac-sha256-lib,cbc(aes-generic))",
+ .alg = "authenc(hmac(sha224),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -16689,6 +16689,241 @@ static const struct aead_testvec hmac_sh
+@@ -16257,6 +16257,227 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha224_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha1_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x36\xb4\x3b\x9c\x62\xed\xcf\x77"
-+ "\xdc\x19\x27\x3f\x92\x80\x52\xce"
-+ "\x8f\xad\x01\x0b\x79\xda\x04\x83"
-+ "\xcb\x45\x1a\x52",
-+ .clen = 16 + 28,
++ "\x70\xdc\x6b\x62\x43\xa1\x2f\x08"
++ "\xf1\xec\x93\x7d\x69\xb2\x8e\x1f"
++ "\x0a\x97\x39\x86",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x7f\xe4\x8f\xa7\x06\x71\xe9\xe5"
-+ "\x16\x79\xef\xf9\x7e\x5c\x93\x4d"
-+ "\xa0\xf8\x3b\x3a\xaa\x1c\xc0\xd9"
-+ "\x6b\x48\x49\x01",
-+ .clen = 32 + 28,
++ "\x6b\x7b\x4d\x39\x36\x1c\x12\x5f"
++ "\x72\xd2\x88\xb2\x26\xa6\xa6\xb5"
++ "\x1d\x3a\x49\xa6",
++ .clen = 32 + 20,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
-+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd"
++ "\x22\x33\x44\x55"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 28 + 20,
++ .klen = 8 + 20 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\xb0\x19\x45\xee\xa7\x31\xd9\xd0"
-+ "\x74\x6b\xb8\xb1\x67\x61\x2f\x8c"
-+ "\x68\xde\xe3\xc9\x3b\x0c\x72\xda"
-+ "\x48\xba\x1b\x51",
-+ .clen = 36 + 28,
++ "\x2c\x86\xa0\x90\x8e\xc1\x02\x1d"
++ "\x51\xdc\xd6\x21\xc7\x30\xcc\x32"
++ "\x38\x55\x47\x64",
++ .clen = 36 + 20,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 28 + 28,
++ .klen = 8 + 20 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\xfd\xf5\x35\x26\x50\x3d\xdf\x80"
-+ "\x6e\xbe\xba\x8d\x56\xf3\x03\xb7"
-+ "\x27\xb8\x13\xe8\x72\x8f\xc9\x52"
-+ "\x4a\xb7\xc3\x3a",
-+ .clen = 16 + 28,
++ "\xe9\x4e\x49\xf0\x6b\x8d\x58\x2b"
++ "\x26\x7f\xf3\xab\xeb\x2f\x74\x2f"
++ "\x45\x43\x64\xc1",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 28 + 28,
++ .klen = 8 + 20 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x72\x89\xa8\x04\xa5\xac\x8f\x29"
-+ "\xe6\xb8\x58\xe8\xcf\x6a\x91\x89"
-+ "\xd3\x66\x3b\xdc\xce\x43\x23\xb7"
-+ "\x6a\xdd\x9d\xbd",
-+ .clen = 32 + 28,
++ "\xab\xc4\xfa\x6d\x20\xe1\xce\x72"
++ "\x0e\x92\x4e\x97\xaa\x4d\x30\x84"
++ "\xb6\xd8\x4d\x3b",
++ .clen = 32 + 20,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 28 + 36,
++ .klen = 8 + 20 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xfe\xdf\x6f\x62\x8a\x79\xb5\x34"
-+ "\xd0\x6f\x32\xaf\x31\x50\x5b\x1f"
-+ "\xe0\x6d\x0b\xbc\x02\x25\xee\x74"
-+ "\x7a\xdf\x97\x3c",
-+ .clen = 16 + 28,
++ "\x3d\x6c\x23\x27\xda\x0e\x7f\x29"
++ "\xfd\x8d\x3c\x1b\xf7\x7a\x63\xd9"
++ "\x7e\x0f\xe9\xf6",
++ .clen = 16 + 20,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b"
++ "\x30\x31\x32\x33"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 28 + 36,
++ .klen = 8 + 20 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\x19\x1e\x9c\x2c\x6d\x4e\x21\xda"
-+ "\x6c\x4d\x88\x90\xf8\x5f\xa5\x9d"
-+ "\xb4\xd4\x40\xad\xfa\x67\x3f\x0e"
-+ "\x11\x12\xd6\x10",
-+ .clen = 32 + 28,
++ "\xe7\xee\x22\xa4\xdd\xbf\x5d\x44"
++ "\x3b\x43\x1c\x69\x55\x11\xd5\xad"
++ "\x14\x5f\x44\xa6",
++ .clen = 32 + 20,
+ },
+};
+
- static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
- { /* RFC 3602 Case 1 */
+ static const struct aead_testvec hmac_sha1_ecb_cipher_null_tv_temp[] = {
+ { /* Input data from RFC 2410 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 65af3a0bff7264ab84f9e1f2099c658601ca1b66 Mon Sep 17 00:00:00 2001
+From d46c27c01f132082095342b5abf4e83e250b70b8 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:22 +0100
-Subject: [PATCH 3/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha256),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:21 +0100
+Subject: [PATCH 2/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha224),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA256) computed with software implementation.
+vectors and adding HMAC(SHA224) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4302,8 +4302,12 @@ static const struct alg_test_desc alg_te
+@@ -4261,8 +4261,12 @@ static const struct alg_test_desc alg_te
}
}, {
- .alg = "authenc(hmac(sha256),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha224),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha256-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha224-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha256_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha224_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha384),cbc(aes))",
- .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .alg = "authenc(hmac(sha256),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha256-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17207,6 +17207,241 @@ static const struct aead_testvec hmac_sh
+@@ -16809,6 +16809,241 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha256_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha224_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x9b\xa2\x34\x62\xe5\xb3\xe8\x2d"
-+ "\x6d\xdb\x93\x64\xa5\x08\x2e\x77"
-+ "\x72\x1f\x21\x94\xc7\xbe\x14\xa6"
-+ "\xcd\xea\x96\xa1\x29\x8f\x30\xc3",
-+ .clen = 16 + 32,
++ "\x36\xb4\x3b\x9c\x62\xed\xcf\x77"
++ "\xdc\x19\x27\x3f\x92\x80\x52\xce"
++ "\x8f\xad\x01\x0b\x79\xda\x04\x83"
++ "\xcb\x45\x1a\x52",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x22\xf7\x95\xa8\xbb\xcd\x19\xf4"
-+ "\x58\x16\x54\x28\x2b\xf4\x52\xe7"
-+ "\x5c\x6c\xe1\x44\x0b\xd5\x10\x6e"
-+ "\xe1\xf7\x04\xc4\x2c\xab\x93\xdd",
-+ .clen = 32 + 32,
++ "\x7f\xe4\x8f\xa7\x06\x71\xe9\xe5"
++ "\x16\x79\xef\xf9\x7e\x5c\x93\x4d"
++ "\xa0\xf8\x3b\x3a\xaa\x1c\xc0\xd9"
++ "\x6b\x48\x49\x01",
++ .clen = 32 + 28,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
-+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\xaa\xbb\xcc\xdd"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 32 + 20,
++ .klen = 8 + 28 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x1d\x05\x5f\x77\x3b\x4f\x5c\x21"
-+ "\x29\xea\xf1\xa8\x71\x49\x7b\x0b"
-+ "\x66\x0d\xff\x18\x81\x63\xfc\xc3"
-+ "\x91\xb6\x38\xc8\xcd\x2d\x39\x83",
-+ .clen = 36 + 32,
++ "\xb0\x19\x45\xee\xa7\x31\xd9\xd0"
++ "\x74\x6b\xb8\xb1\x67\x61\x2f\x8c"
++ "\x68\xde\xe3\xc9\x3b\x0c\x72\xda"
++ "\x48\xba\x1b\x51",
++ .clen = 36 + 28,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 32 + 28,
++ .klen = 8 + 28 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x8d\x03\x77\xb2\x1c\xc9\xe0\xac"
-+ "\xde\x69\xbe\x8a\xef\x5b\x13\x74"
-+ "\x1d\x39\xbc\xdc\x95\xa4\xbf\xc3"
-+ "\xd5\xc6\xd1\xda\xda\x3b\xca\x78",
-+ .clen = 16 + 32,
++ "\xfd\xf5\x35\x26\x50\x3d\xdf\x80"
++ "\x6e\xbe\xba\x8d\x56\xf3\x03\xb7"
++ "\x27\xb8\x13\xe8\x72\x8f\xc9\x52"
++ "\x4a\xb7\xc3\x3a",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 32 + 28,
++ .klen = 8 + 28 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x34\x06\x2b\x3d\xf1\xa8\x3d\xf1"
-+ "\xa6\x5e\x5c\x1a\xdb\x0c\xb5\x1e"
-+ "\x8f\xdb\xf4\xca\x7d\x09\x5e\x81"
-+ "\xdb\x32\x07\x4a\x1d\x1c\x6d\x83",
-+ .clen = 32 + 32,
++ "\x72\x89\xa8\x04\xa5\xac\x8f\x29"
++ "\xe6\xb8\x58\xe8\xcf\x6a\x91\x89"
++ "\xd3\x66\x3b\xdc\xce\x43\x23\xb7"
++ "\x6a\xdd\x9d\xbd",
++ .clen = 32 + 28,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 32 + 36,
++ .klen = 8 + 28 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xc3\xb4\x5f\xb0\xbf\xf5\x1b\xff"
-+ "\x7c\xf1\x79\x00\x63\x50\xdd\x77"
-+ "\xc0\x4a\xba\xcd\xdc\x47\x05\x2a"
-+ "\x5d\x85\x2d\x83\x44\xca\x79\x2c",
-+ .clen = 16 + 32,
++ "\xfe\xdf\x6f\x62\x8a\x79\xb5\x34"
++ "\xd0\x6f\x32\xaf\x31\x50\x5b\x1f"
++ "\xe0\x6d\x0b\xbc\x02\x25\xee\x74"
++ "\x7a\xdf\x97\x3c",
++ .clen = 16 + 28,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
-+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x38\x39\x3a\x3b"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 32 + 36,
++ .klen = 8 + 28 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xc8\x59\x5d\xe1\xba\xac\x13\x82"
-+ "\xfd\x21\x7c\x8c\x23\x31\x04\x02"
-+ "\x9e\x69\x5b\x57\xa8\x13\xe7\x21"
-+ "\x60\x0c\x24\xc2\x80\x4a\x93\x6e",
-+ .clen = 32 + 32,
++ "\x19\x1e\x9c\x2c\x6d\x4e\x21\xda"
++ "\x6c\x4d\x88\x90\xf8\x5f\xa5\x9d"
++ "\xb4\xd4\x40\xad\xfa\x67\x3f\x0e"
++ "\x11\x12\xd6\x10",
++ .clen = 32 + 28,
+ },
+};
+
- static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 07cbbf6f38e6a91a7fecab3d6f86485425748d3e Mon Sep 17 00:00:00 2001
+From 5ac6b904c70ff163fd2f9e152056300ce5ed6c26 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:23 +0100
-Subject: [PATCH 4/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha384),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:22 +0100
+Subject: [PATCH 3/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha256),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA384) computed with software implementation.
+vectors and adding HMAC(SHA256) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 263 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 268 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 235 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 240 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4342,8 +4342,12 @@ static const struct alg_test_desc alg_te
+@@ -4302,8 +4302,12 @@ static const struct alg_test_desc alg_te
}
}, {
- .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha256),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha384-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha256-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha384_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha256_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "authenc(hmac(sha512),cbc(aes))",
- .generic_driver = "authenc(hmac-sha512-lib,cbc(aes-generic))",
+ .alg = "authenc(hmac(sha384),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17753,6 +17753,269 @@ static const struct aead_testvec hmac_sh
+@@ -17327,6 +17327,241 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha384_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha256_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x45\x51\x59\x72\x16\xd3\xc6\x15"
-+ "\x25\x1e\xe8\x92\x2e\x47\x52\xcc"
-+ "\x91\x9c\x24\xef\x11\xb2\x53\x00"
-+ "\x10\x20\x43\x06\xe2\x35\x88\x9e"
-+ "\x18\x32\x5a\x79\x7d\x73\x7e\x89"
-+ "\xfe\xa1\xda\xa4\x86\xc4\x2a\x04",
-+ .clen = 16 + 48,
++ "\x9b\xa2\x34\x62\xe5\xb3\xe8\x2d"
++ "\x6d\xdb\x93\x64\xa5\x08\x2e\x77"
++ "\x72\x1f\x21\x94\xc7\xbe\x14\xa6"
++ "\xcd\xea\x96\xa1\x29\x8f\x30\xc3",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x83\x65\x32\x1e\x6b\x60\xe6\x4a"
-+ "\xe2\xab\x52\x2b\xa6\x70\x3a\xfa"
-+ "\xd2\xec\x83\xe4\x31\x0c\x28\x40"
-+ "\x9b\x5e\x18\xa4\xdc\x48\xb8\x56"
-+ "\x33\xab\x7f\x2b\xaf\xe4\x3a\xe3"
-+ "\x8a\x61\xf6\x22\xb4\x6b\xfe\x7d",
-+ .clen = 32 + 48,
++ "\x22\xf7\x95\xa8\xbb\xcd\x19\xf4"
++ "\x58\x16\x54\x28\x2b\xf4\x52\xe7"
++ "\x5c\x6c\xe1\x44\x0b\xd5\x10\x6e"
++ "\xe1\xf7\x04\xc4\x2c\xab\x93\xdd",
++ .clen = 32 + 32,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
+ "\x22\x33\x44\x55\x66\x77\x88\x99"
+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
-+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
-+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 48 + 20,
++ .klen = 8 + 32 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x4a\xaa\xad\x3b\x3b\xb6\x9a\xba"
-+ "\xa1\x7b\xc6\xce\x96\xc3\xff\x67"
-+ "\xf3\x0c\x33\x57\xf0\x51\x24\x08"
-+ "\xed\x4f\x6a\x9c\x22\x42\xbd\x18"
-+ "\x97\x74\x68\x36\x00\xf1\x69\x3a"
-+ "\x18\x77\x40\xf0\x56\xba\xba\xe0",
-+ .clen = 36 + 48,
++ "\x1d\x05\x5f\x77\x3b\x4f\x5c\x21"
++ "\x29\xea\xf1\xa8\x71\x49\x7b\x0b"
++ "\x66\x0d\xff\x18\x81\x63\xfc\xc3"
++ "\x91\xb6\x38\xc8\xcd\x2d\x39\x83",
++ .clen = 36 + 32,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 48 + 28,
++ .klen = 8 + 32 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x36\xd6\xc7\x55\xac\xb6\x0b\x14"
-+ "\x95\x71\xf9\x86\x30\xe3\x96\xc3"
-+ "\x76\x85\x6d\xa5\x06\xed\x6f\x34"
-+ "\xcc\x1f\xcc\x2d\x88\x06\xb0\x1d"
-+ "\xbe\xd9\xa2\xd3\x64\xf1\x33\x03"
-+ "\x13\x50\x8f\xae\x61\x2d\x82\xb8",
-+ .clen = 16 + 48,
++ "\x8d\x03\x77\xb2\x1c\xc9\xe0\xac"
++ "\xde\x69\xbe\x8a\xef\x5b\x13\x74"
++ "\x1d\x39\xbc\xdc\x95\xa4\xbf\xc3"
++ "\xd5\xc6\xd1\xda\xda\x3b\xca\x78",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 48 + 28,
++ .klen = 8 + 32 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x80\x12\x67\x22\xf2\x4d\x9b\xbf"
-+ "\xdc\x38\xd3\xaa\x12\xc0\x58\x1a"
-+ "\x9a\x62\x6e\x42\x3d\x44\x63\xdd"
-+ "\xee\x7e\xe3\xa3\xdf\x2a\x65\x05"
-+ "\xd0\xc1\xd2\x54\x55\x35\x5c\xc7"
-+ "\xb0\xb5\xb1\x36\xe0\x0b\xaf\x72",
-+ .clen = 32 + 48,
++ "\x34\x06\x2b\x3d\xf1\xa8\x3d\xf1"
++ "\xa6\x5e\x5c\x1a\xdb\x0c\xb5\x1e"
++ "\x8f\xdb\xf4\xca\x7d\x09\x5e\x81"
++ "\xdb\x32\x07\x4a\x1d\x1c\x6d\x83",
++ .clen = 32 + 32,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 48 + 36,
++ .klen = 8 + 32 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\xb1\x7b\xb1\xec\xca\x94\x55\xc4"
-+ "\x3f\x2b\xb1\x70\x04\x91\xf5\x9d"
-+ "\x1a\xc0\xe1\x2a\x93\x5f\x96\x2a"
-+ "\x12\x85\x38\x36\xe1\xb2\xe9\xf0"
-+ "\xf2\x6e\x5d\x81\xcc\x49\x07\x9c"
-+ "\x5b\x88\xc8\xcc\xc4\x21\x4f\x32",
-+ .clen = 16 + 48,
++ "\xc3\xb4\x5f\xb0\xbf\xf5\x1b\xff"
++ "\x7c\xf1\x79\x00\x63\x50\xdd\x77"
++ "\xc0\x4a\xba\xcd\xdc\x47\x05\x2a"
++ "\x5d\x85\x2d\x83\x44\xca\x79\x2c",
++ .clen = 16 + 32,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+ "\x30\x31\x32\x33\x34\x35\x36\x37"
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-+ "\x40\x41\x42\x43\x44\x45\x46\x47"
-+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 48 + 36,
++ .klen = 8 + 32 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xd6\x96\xbb\x12\x39\xc4\x4d\xe2"
-+ "\x4c\x02\xe7\x1f\xdc\xb2\xb1\x57"
-+ "\x38\x0d\xdd\x13\xb3\x89\x57\x9e"
-+ "\x1f\xb5\x48\x32\xc4\xd3\x9d\x1f"
-+ "\x68\xab\x8d\xc6\xa8\x05\x3a\xc2"
-+ "\x87\xaf\x23\xb3\xe4\x1b\xde\xb3",
-+ .clen = 32 + 48,
++ "\xc8\x59\x5d\xe1\xba\xac\x13\x82"
++ "\xfd\x21\x7c\x8c\x23\x31\x04\x02"
++ "\x9e\x69\x5b\x57\xa8\x13\xe7\x21"
++ "\x60\x0c\x24\xc2\x80\x4a\x93\x6e",
++ .clen = 32 + 32,
+ },
+};
+
- static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ static const struct aead_testvec hmac_sha384_aes_cbc_tv_temp[] = {
{ /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
-From 07f1bc80c478c7198065d3896ed3685428314a9c Mon Sep 17 00:00:00 2001
+From 2f0814271715f974ae1fc6247c9918906c83e24b Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:24 +0100
-Subject: [PATCH 5/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha512),rfc3686(ctr(aes)))
+Date: Thu, 5 Mar 2026 21:08:23 +0100
+Subject: [PATCH 4/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha384),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA512) computed with software implementation.
+vectors and adding HMAC(SHA384) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 291 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 296 insertions(+), 1 deletion(-)
+ crypto/testmgr.h | 263 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 268 insertions(+), 1 deletion(-)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4376,8 +4376,12 @@ static const struct alg_test_desc alg_te
- .fips_allowed = 1,
+@@ -4342,8 +4342,12 @@ static const struct alg_test_desc alg_te
+ }
}, {
- .alg = "authenc(hmac(sha512),rfc3686(ctr(aes)))",
+ .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))",
- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha512-lib,rfc3686(ctr(aes-lib)))",
++ .generic_driver = "authenc(hmac-sha384-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
.fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha512_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_sha384_aes_ctr_rfc3686_tv_temp)
+ }
}, {
- .alg = "blake2b-160",
- .test = alg_test_hash,
+ .alg = "authenc(hmac(sha512),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha512-lib,cbc(aes-generic))",
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -18412,6 +18412,297 @@ static const struct aead_testvec hmac_md
+@@ -17873,6 +17873,269 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha512_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_sha384_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\xa4\x45\x3a\x44\x9c\xe5\x1c\xd9"
-+ "\x10\x43\x51\x2e\x76\x5e\xf8\x9d"
-+ "\x03\x12\x1a\x31\x00\x33\x10\xb4"
-+ "\x94\x4b\x70\x84\x6c\xda\xb1\x46"
-+ "\x24\xb6\x3b\x2a\xec\xd5\x67\xb8"
-+ "\x65\xa2\xbd\xac\x18\xe2\xf8\x55"
-+ "\xc6\x91\xb0\x92\x84\x2d\x74\x44"
-+ "\xa7\xee\xc3\x44\xa0\x07\x0e\x62",
-+ .clen = 16 + 64,
++ "\x45\x51\x59\x72\x16\xd3\xc6\x15"
++ "\x25\x1e\xe8\x92\x2e\x47\x52\xcc"
++ "\x91\x9c\x24\xef\x11\xb2\x53\x00"
++ "\x10\x20\x43\x06\xe2\x35\x88\x9e"
++ "\x18\x32\x5a\x79\x7d\x73\x7e\x89"
++ "\xfe\xa1\xda\xa4\x86\xc4\x2a\x04",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\xec\x67\x0d\xb3\xbd\x98\x13\x01"
-+ "\x2b\x04\x9b\xe6\x06\x67\x3c\x76"
-+ "\xcd\x41\xb7\xcc\x70\x6c\x7f\xc8"
-+ "\x67\xbd\x22\x39\xb2\xaa\xe8\x88"
-+ "\xe0\x4f\x81\x52\xdf\xc9\xc3\xd6"
-+ "\x44\xf4\x66\x33\x87\x64\x61\x02"
-+ "\x02\xa2\x64\x15\x2b\xe9\x0b\x3d"
-+ "\x4c\xea\xa1\xa5\xa7\xc9\xd3\x1b",
-+ .clen = 32 + 64,
++ "\x83\x65\x32\x1e\x6b\x60\xe6\x4a"
++ "\xe2\xab\x52\x2b\xa6\x70\x3a\xfa"
++ "\xd2\xec\x83\xe4\x31\x0c\x28\x40"
++ "\x9b\x5e\x18\xa4\xdc\x48\xb8\x56"
++ "\x33\xab\x7f\x2b\xaf\xe4\x3a\xe3"
++ "\x8a\x61\xf6\x22\xb4\x6b\xfe\x7d",
++ .clen = 32 + 48,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
+ "\x33\x44\x55\x66\x77\x88\x99\xaa"
+ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
-+ "\x44\x55\x66\x77\x88\x99\xaa\xbb"
-+ "\xcc\xdd\xee\xff\x11\x22\x33\x44"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 64 + 20,
++ .klen = 8 + 48 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x6f\x90\xb6\xa3\x35\x43\x59\xff"
-+ "\x1e\x32\xd6\xfe\xfa\x33\xf9\xf0"
-+ "\x31\x2f\x03\x2d\x88\x1d\xab\xbf"
-+ "\x0e\x19\x16\xd9\xf3\x98\x3e\xdd"
-+ "\x0c\xec\xfe\xe8\x89\x13\x91\x15"
-+ "\xf6\x61\x65\x5c\x1b\x7d\xde\xc0"
-+ "\xe4\xba\x6d\x27\xe2\x89\x23\x24"
-+ "\x15\x82\x37\x3d\x48\xd3\xc9\x32",
-+ .clen = 36 + 64,
++ "\x4a\xaa\xad\x3b\x3b\xb6\x9a\xba"
++ "\xa1\x7b\xc6\xce\x96\xc3\xff\x67"
++ "\xf3\x0c\x33\x57\xf0\x51\x24\x08"
++ "\xed\x4f\x6a\x9c\x22\x42\xbd\x18"
++ "\x97\x74\x68\x36\x00\xf1\x69\x3a"
++ "\x18\x77\x40\xf0\x56\xba\xba\xe0",
++ .clen = 36 + 48,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 64 + 28,
++ .klen = 8 + 48 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\x25\xea\xdc\xad\x52\xb8\x0f\x70"
-+ "\xe7\x39\x83\x80\x10\x3f\x18\xc4"
-+ "\xf8\x59\x14\x25\x5f\xba\x20\x87"
-+ "\x0b\x04\x5e\xf7\xde\x41\x39\xff"
-+ "\xa2\xee\x84\x3f\x9d\x38\xfd\x17"
-+ "\xc0\x66\x5e\x74\x39\xe3\xd3\xd7"
-+ "\x3d\xbc\xe3\x99\x2f\xe7\xef\x37"
-+ "\x61\x03\xf3\x9e\x01\xaf\xba\x9d",
-+ .clen = 16 + 64,
++ "\x36\xd6\xc7\x55\xac\xb6\x0b\x14"
++ "\x95\x71\xf9\x86\x30\xe3\x96\xc3"
++ "\x76\x85\x6d\xa5\x06\xed\x6f\x34"
++ "\xcc\x1f\xcc\x2d\x88\x06\xb0\x1d"
++ "\xbe\xd9\xa2\xd3\x64\xf1\x33\x03"
++ "\x13\x50\x8f\xae\x61\x2d\x82\xb8",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 64 + 28,
++ .klen = 8 + 48 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\x51\xa3\xe6\x1d\x23\x7d\xd1\x18"
-+ "\x55\x9c\x1c\x92\x2b\xc2\xcd\xfe"
-+ "\x8a\xa8\xa5\x96\x65\x2e\x9d\xdb"
-+ "\x06\xd2\x1c\x57\x2b\x76\xb5\x9c"
-+ "\xd4\x3e\x8b\x61\x54\x2d\x08\xe5"
-+ "\xb2\xf8\x88\x20\x0c\xad\xe8\x85"
-+ "\x61\x8e\x5c\xa4\x96\x2c\xe2\x7d"
-+ "\x4f\xb6\x1d\xb2\x8c\xd7\xe3\x38",
-+ .clen = 32 + 64,
++ "\x80\x12\x67\x22\xf2\x4d\x9b\xbf"
++ "\xdc\x38\xd3\xaa\x12\xc0\x58\x1a"
++ "\x9a\x62\x6e\x42\x3d\x44\x63\xdd"
++ "\xee\x7e\xe3\xa3\xdf\x2a\x65\x05"
++ "\xd0\xc1\xd2\x54\x55\x35\x5c\xc7"
++ "\xb0\xb5\xb1\x36\xe0\x0b\xaf\x72",
++ .clen = 32 + 48,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 64 + 36,
++ .klen = 8 + 48 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\x6b\x68\x0b\x99\x9a\x4d\xc8\xb9"
-+ "\x35\xea\xcd\x56\x3f\x40\xa2\xb6"
-+ "\x68\xda\x59\xd8\xa0\x89\xcd\x52"
-+ "\xb1\x6e\xed\xc1\x42\x10\xa5\x0f"
-+ "\x88\x0b\x80\xce\xc4\x67\xf0\x45"
-+ "\x5d\xb2\x9e\xde\x1c\x79\x52\x0d"
-+ "\xff\x75\x36\xd5\x0f\x52\x8e\xe5"
-+ "\x31\x85\xcf\x1d\x31\xf8\x62\x67",
-+ .clen = 16 + 64,
++ "\xb1\x7b\xb1\xec\xca\x94\x55\xc4"
++ "\x3f\x2b\xb1\x70\x04\x91\xf5\x9d"
++ "\x1a\xc0\xe1\x2a\x93\x5f\x96\x2a"
++ "\x12\x85\x38\x36\xe1\xb2\xe9\xf0"
++ "\xf2\x6e\x5d\x81\xcc\x49\x07\x9c"
++ "\x5b\x88\xc8\xcc\xc4\x21\x4f\x32",
++ .clen = 16 + 48,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+ "\x40\x41\x42\x43\x44\x45\x46\x47"
+ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-+ "\x50\x51\x52\x53\x54\x55\x56\x57"
-+ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 64 + 36,
++ .klen = 8 + 48 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\x9a\xac\x38\xbd\xf3\xcf\xd5\xd0"
-+ "\x09\x07\xa6\xe1\x7f\xd6\x79\x98"
-+ "\x4e\x90\x0e\xc0\x3d\xa0\xf2\x12"
-+ "\x52\x79\x9c\x17\xff\xb9\xb8\xe3"
-+ "\x2f\x31\xcb\xbd\x63\x70\x72\x7b"
-+ "\x4e\x1e\xd1\xde\xb5\x6b\x7d\x54"
-+ "\x68\x56\xdd\xe5\x53\xee\x29\xd2"
-+ "\x85\xa1\x73\x61\x00\xa9\x26\x8f",
-+ .clen = 32 + 64,
++ "\xd6\x96\xbb\x12\x39\xc4\x4d\xe2"
++ "\x4c\x02\xe7\x1f\xdc\xb2\xb1\x57"
++ "\x38\x0d\xdd\x13\xb3\x89\x57\x9e"
++ "\x1f\xb5\x48\x32\xc4\xd3\x9d\x1f"
++ "\x68\xab\x8d\xc6\xa8\x05\x3a\xc2"
++ "\x87\xaf\x23\xb3\xe4\x1b\xde\xb3",
++ .clen = 32 + 48,
+ },
+};
+
- static const struct aead_testvec hmac_sha1_des_cbc_tv_temp[] = {
- { /*Generated with cryptopp*/
+ static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = {
+ { /* RFC 3602 Case 1 */
#ifdef __LITTLE_ENDIAN
--- /dev/null
+From 82fc2b17fa5b9b12d34770afcc8e3c4288735429 Mon Sep 17 00:00:00 2001
+From: Aleksander Jan Bajkowski <olek2@wp.pl>
+Date: Thu, 5 Mar 2026 21:08:24 +0100
+Subject: [PATCH 5/5] crypto: testmgr - Add test vectors for
+ authenc(hmac(sha512),rfc3686(ctr(aes)))
+
+Test vectors were generated starting from existing RFC3686(CTR(AES)) test
+vectors and adding HMAC(SHA512) computed with software implementation.
+Then, the results were double-checked on Mediatek MT7986 (safexcel).
+Platform pass self-tests.
+
+Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.c | 6 +-
+ crypto/testmgr.h | 291 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 296 insertions(+), 1 deletion(-)
+
+--- a/crypto/testmgr.c
++++ b/crypto/testmgr.c
+@@ -4376,8 +4376,12 @@ static const struct alg_test_desc alg_te
+ .fips_allowed = 1,
+ }, {
+ .alg = "authenc(hmac(sha512),rfc3686(ctr(aes)))",
+- .test = alg_test_null,
++ .generic_driver = "authenc(hmac-sha512-lib,rfc3686(ctr(aes-lib)))",
++ .test = alg_test_aead,
+ .fips_allowed = 1,
++ .suite = {
++ .aead = __VECS(hmac_sha512_aes_ctr_rfc3686_tv_temp)
++ }
+ }, {
+ .alg = "blake2b-160",
+ .test = alg_test_hash,
+--- a/crypto/testmgr.h
++++ b/crypto/testmgr.h
+@@ -18532,6 +18532,297 @@ static const struct aead_testvec hmac_md
+ },
+ };
+
++static const struct aead_testvec hmac_sha512_aes_ctr_rfc3686_tv_temp[] = {
++ { /* RFC 3686 Case 1 */
++#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\x14" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
++ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
++ "\x00\x00\x00\x30",
++ .klen = 8 + 64 + 20,
++ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
++ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
++ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
++ "\xa4\x45\x3a\x44\x9c\xe5\x1c\xd9"
++ "\x10\x43\x51\x2e\x76\x5e\xf8\x9d"
++ "\x03\x12\x1a\x31\x00\x33\x10\xb4"
++ "\x94\x4b\x70\x84\x6c\xda\xb1\x46"
++ "\x24\xb6\x3b\x2a\xec\xd5\x67\xb8"
++ "\x65\xa2\xbd\xac\x18\xe2\xf8\x55"
++ "\xc6\x91\xb0\x92\x84\x2d\x74\x44"
++ "\xa7\xee\xc3\x44\xa0\x07\x0e\x62",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 2 */
++#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\x14" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
++ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
++ "\x00\x6c\xb6\xdb",
++ .klen = 8 + 64 + 20,
++ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
++ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\x51\x04\xa1\x06\x16\x8a\x72\xd9"
++ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
++ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
++ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
++ "\xec\x67\x0d\xb3\xbd\x98\x13\x01"
++ "\x2b\x04\x9b\xe6\x06\x67\x3c\x76"
++ "\xcd\x41\xb7\xcc\x70\x6c\x7f\xc8"
++ "\x67\xbd\x22\x39\xb2\xaa\xe8\x88"
++ "\xe0\x4f\x81\x52\xdf\xc9\xc3\xd6"
++ "\x44\xf4\x66\x33\x87\x64\x61\x02"
++ "\x02\xa2\x64\x15\x2b\xe9\x0b\x3d"
++ "\x4c\xea\xa1\xa5\xa7\xc9\xd3\x1b",
++ .clen = 32 + 64,
++ }, { /* RFC 3686 Case 3 */
++#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\x14" /* enc key length */
++ "\x11\x22\x33\x44\x55\x66\x77\x88"
++ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
++ "\x22\x33\x44\x55\x66\x77\x88\x99"
++ "\xaa\xbb\xcc\xdd\xee\xff\x11\x22"
++ "\x33\x44\x55\x66\x77\x88\x99\xaa"
++ "\xbb\xcc\xdd\xee\xff\x11\x22\x33"
++ "\x44\x55\x66\x77\x88\x99\xaa\xbb"
++ "\xcc\xdd\xee\xff\x11\x22\x33\x44"
++ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
++ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
++ "\x00\xe0\x01\x7b",
++ .klen = 8 + 64 + 20,
++ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
++ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
++ "\x20\x21\x22\x23",
++ .plen = 36,
++ .ctext = "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9"
++ "\xcf\x46\x52\xe9\xef\xdb\x72\xd7"
++ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
++ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
++ "\x25\xb2\x07\x2f"
++ "\x6f\x90\xb6\xa3\x35\x43\x59\xff"
++ "\x1e\x32\xd6\xfe\xfa\x33\xf9\xf0"
++ "\x31\x2f\x03\x2d\x88\x1d\xab\xbf"
++ "\x0e\x19\x16\xd9\xf3\x98\x3e\xdd"
++ "\x0c\xec\xfe\xe8\x89\x13\x91\x15"
++ "\xf6\x61\x65\x5c\x1b\x7d\xde\xc0"
++ "\xe4\xba\x6d\x27\xe2\x89\x23\x24"
++ "\x15\x82\x37\x3d\x48\xd3\xc9\x32",
++ .clen = 36 + 64,
++ }, { /* RFC 3686 Case 4 */
++#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\x1c" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
++ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
++ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
++ "\x00\x00\x00\x48",
++ .klen = 8 + 64 + 28,
++ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
++ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
++ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
++ "\x25\xea\xdc\xad\x52\xb8\x0f\x70"
++ "\xe7\x39\x83\x80\x10\x3f\x18\xc4"
++ "\xf8\x59\x14\x25\x5f\xba\x20\x87"
++ "\x0b\x04\x5e\xf7\xde\x41\x39\xff"
++ "\xa2\xee\x84\x3f\x9d\x38\xfd\x17"
++ "\xc0\x66\x5e\x74\x39\xe3\xd3\xd7"
++ "\x3d\xbc\xe3\x99\x2f\xe7\xef\x37"
++ "\x61\x03\xf3\x9e\x01\xaf\xba\x9d",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 5 */
++#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\x1c" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
++ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
++ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
++ "\x00\x96\xb0\x3b",
++ .klen = 8 + 64 + 28,
++ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
++ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\x45\x32\x43\xfc\x60\x9b\x23\x32"
++ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
++ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
++ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
++ "\x51\xa3\xe6\x1d\x23\x7d\xd1\x18"
++ "\x55\x9c\x1c\x92\x2b\xc2\xcd\xfe"
++ "\x8a\xa8\xa5\x96\x65\x2e\x9d\xdb"
++ "\x06\xd2\x1c\x57\x2b\x76\xb5\x9c"
++ "\xd4\x3e\x8b\x61\x54\x2d\x08\xe5"
++ "\xb2\xf8\x88\x20\x0c\xad\xe8\x85"
++ "\x61\x8e\x5c\xa4\x96\x2c\xe2\x7d"
++ "\x4f\xb6\x1d\xb2\x8c\xd7\xe3\x38",
++ .clen = 32 + 64,
++ }, { /* RFC 3686 Case 7 */
++#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\x24" /* enc key length */
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x00\x00\x00\x00\x00\x00\x00\x00"
++ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
++ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
++ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
++ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
++ "\x00\x00\x00\x60",
++ .klen = 8 + 64 + 36,
++ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
++ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
++ .alen = 8,
++ .ptext = "Single block msg",
++ .plen = 16,
++ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
++ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
++ "\x6b\x68\x0b\x99\x9a\x4d\xc8\xb9"
++ "\x35\xea\xcd\x56\x3f\x40\xa2\xb6"
++ "\x68\xda\x59\xd8\xa0\x89\xcd\x52"
++ "\xb1\x6e\xed\xc1\x42\x10\xa5\x0f"
++ "\x88\x0b\x80\xce\xc4\x67\xf0\x45"
++ "\x5d\xb2\x9e\xde\x1c\x79\x52\x0d"
++ "\xff\x75\x36\xd5\x0f\x52\x8e\xe5"
++ "\x31\x85\xcf\x1d\x31\xf8\x62\x67",
++ .clen = 16 + 64,
++ }, { /* RFC 3686 Case 8 */
++#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\x24" /* enc key length */
++ "\x20\x21\x22\x23\x24\x25\x26\x27"
++ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
++ "\x30\x31\x32\x33\x34\x35\x36\x37"
++ "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
++ "\x40\x41\x42\x43\x44\x45\x46\x47"
++ "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
++ "\x50\x51\x52\x53\x54\x55\x56\x57"
++ "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
++ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
++ "\x07\x96\x36\x58\x79\xef\xf8\x86"
++ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
++ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
++ "\x00\xfa\xac\x24",
++ .klen = 8 + 64 + 36,
++ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
++ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
++ .alen = 8,
++ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
++ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
++ "\x10\x11\x12\x13\x14\x15\x16\x17"
++ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
++ .plen = 32,
++ .ctext = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c"
++ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
++ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
++ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
++ "\x9a\xac\x38\xbd\xf3\xcf\xd5\xd0"
++ "\x09\x07\xa6\xe1\x7f\xd6\x79\x98"
++ "\x4e\x90\x0e\xc0\x3d\xa0\xf2\x12"
++ "\x52\x79\x9c\x17\xff\xb9\xb8\xe3"
++ "\x2f\x31\xcb\xbd\x63\x70\x72\x7b"
++ "\x4e\x1e\xd1\xde\xb5\x6b\x7d\x54"
++ "\x68\x56\xdd\xe5\x53\xee\x29\xd2"
++ "\x85\xa1\x73\x61\x00\xa9\x26\x8f",
++ .clen = 32 + 64,
++ },
++};
++
+ static const struct aead_testvec hmac_sha1_des_cbc_tv_temp[] = {
+ { /*Generated with cryptopp*/
+ #ifdef __LITTLE_ENDIAN
--- /dev/null
+From 0441ee8d35ad6998da5043c65c4124904e8daee2 Mon Sep 17 00:00:00 2001
+From: Aleksander Jan Bajkowski <olek2@wp.pl>
+Date: Fri, 6 Feb 2026 20:26:59 +0100
+Subject: [PATCH] crypto: tesmgr - allow authenc(hmac(sha224/sha384),cbc(aes))
+ in fips mode
+
+The remaining combinations of AES-CBC and SHA* have already been marked
+as allowed. This commit does the same for SHA224 and SHA384.
+
+Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ crypto/testmgr.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/crypto/testmgr.c
++++ b/crypto/testmgr.c
+@@ -4242,6 +4242,7 @@ static const struct alg_test_desc alg_te
+ .alg = "authenc(hmac(sha224),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
++ .fips_allowed = 1,
+ .suite = {
+ .aead = __VECS(hmac_sha224_aes_cbc_tv_temp)
+ }
+@@ -4312,6 +4313,7 @@ static const struct alg_test_desc alg_te
+ .alg = "authenc(hmac(sha384),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha384-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
++ .fips_allowed = 1,
+ .suite = {
+ .aead = __VECS(hmac_sha384_aes_cbc_tv_temp)
+ }
-From 2a2468bf33d3fac5192429207a439d23e615173a Mon Sep 17 00:00:00 2001
+From d0c0a414cc1893b195b9523ecdfbeee00b98fd0d Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
-Date: Thu, 5 Mar 2026 21:08:20 +0100
-Subject: [PATCH 1/5] crypto: testmgr - Add test vectors for
- authenc(hmac(sha1),rfc3686(ctr(aes)))
+Date: Thu, 19 Mar 2026 18:11:21 +0100
+Subject: [PATCH] crypto: testmgr - Add test vectors for
+ authenc(hmac(md5),rfc3686(ctr(aes)))
Test vectors were generated starting from existing RFC3686(CTR(AES)) test
-vectors and adding HMAC(SHA1) computed with software implementation.
+vectors and adding HMAC(MD5) computed with software implementation.
Then, the results were double-checked on Mediatek MT7986 (safexcel).
Platform pass self-tests.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
- crypto/testmgr.c | 6 +-
- crypto/testmgr.h | 221 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 226 insertions(+), 1 deletion(-)
+ crypto/testmgr.c | 7 ++
+ crypto/testmgr.h | 207 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 214 insertions(+)
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
-@@ -4425,8 +4425,12 @@ static const struct alg_test_desc alg_te
+@@ -4198,6 +4198,13 @@ static const struct alg_test_desc alg_te
+ .aead = __VECS(hmac_md5_ecb_cipher_null_tv_template)
}
}, {
- .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))",
-- .test = alg_test_null,
-+ .generic_driver = "authenc(hmac-sha1-lib,rfc3686(ctr(aes-lib)))",
++ .alg = "authenc(hmac(md5),rfc3686(ctr(aes)))",
++ .generic_driver = "authenc(hmac-md5-lib,rfc3686(ctr(aes-lib)))",
+ .test = alg_test_aead,
- .fips_allowed = 1,
+ .suite = {
-+ .aead = __VECS(hmac_sha1_aes_ctr_rfc3686_tv_temp)
++ .aead = __VECS(hmac_md5_aes_ctr_rfc3686_tv_temp)
+ }
- }, {
- .alg = "authenc(hmac(sha224),cbc(aes))",
- .generic_driver = "authenc(hmac-sha224-lib,cbc(aes-generic))",
++ }, {
+ .alg = "authenc(hmac(sha1),cbc(aes))",
+ .generic_driver = "authenc(hmac-sha1-lib,cbc(aes-generic))",
+ .test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -17444,6 +17444,227 @@ static const struct aead_testvec hmac_sh
+@@ -19136,6 +19136,213 @@ static const struct aead_testvec hmac_sh
},
};
-+static const struct aead_testvec hmac_sha1_aes_ctr_rfc3686_tv_temp[] = {
++static const struct aead_testvec hmac_md5_aes_ctr_rfc3686_tv_temp[] = {
+ { /* RFC 3686 Case 1 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79"
+ "\x2d\x61\x75\xa3\x26\x13\x11\xb8"
-+ "\x70\xdc\x6b\x62\x43\xa1\x2f\x08"
-+ "\xf1\xec\x93\x7d\x69\xb2\x8e\x1f"
-+ "\x0a\x97\x39\x86",
-+ .clen = 16 + 20,
++ "\xdd\x5f\xea\x13\x2a\xf2\xb0\xf1"
++ "\x91\x79\x46\x40\x62\x6c\x87\x5b",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 2 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .alen = 8,
+ "\x79\x0d\x41\xee\x8e\xda\xd3\x88"
+ "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8"
+ "\xfc\xe6\x30\xdf\x91\x41\xbe\x28"
-+ "\x6b\x7b\x4d\x39\x36\x1c\x12\x5f"
-+ "\x72\xd2\x88\xb2\x26\xa6\xa6\xb5"
-+ "\x1d\x3a\x49\xa6",
-+ .clen = 32 + 20,
++ "\x03\x39\x23\xcd\x22\x5f\x1b\x8b"
++ "\x93\x70\xbc\x45\xf3\xba\xde\x2e",
++ .clen = 32 + 16,
+ }, { /* RFC 3686 Case 3 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x14" /* enc key length */
+ "\x11\x22\x33\x44\x55\x66\x77\x88"
+ "\x99\xaa\xbb\xcc\xdd\xee\xff\x11"
-+ "\x22\x33\x44\x55"
+ "\x76\x91\xbe\x03\x5e\x50\x20\xa8"
+ "\xac\x6e\x61\x85\x29\xf9\xa0\xdc"
+ "\x00\xe0\x01\x7b",
-+ .klen = 8 + 20 + 20,
++ .klen = 8 + 16 + 20,
+ .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0",
+ .alen = 8,
+ "\x45\x40\xa4\x2b\xde\x6d\x78\x36"
+ "\xd5\x9a\x5c\xea\xae\xf3\x10\x53"
+ "\x25\xb2\x07\x2f"
-+ "\x2c\x86\xa0\x90\x8e\xc1\x02\x1d"
-+ "\x51\xdc\xd6\x21\xc7\x30\xcc\x32"
-+ "\x38\x55\x47\x64",
-+ .clen = 36 + 20,
++ "\xb4\x40\x0c\x7b\x4c\x55\x8a\x4b"
++ "\x04\xf7\x48\x9e\x0f\x9a\xae\x73",
++ .clen = 36 + 16,
+ }, { /* RFC 3686 Case 4 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
-+ .klen = 8 + 20 + 28,
++ .klen = 8 + 16 + 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8"
+ "\x4e\x79\x35\xa0\x03\xcb\xe9\x28"
-+ "\xe9\x4e\x49\xf0\x6b\x8d\x58\x2b"
-+ "\x26\x7f\xf3\xab\xeb\x2f\x74\x2f"
-+ "\x45\x43\x64\xc1",
-+ .clen = 16 + 20,
++ "\xc4\x5d\xa1\x16\x6c\x2d\xa5\x43"
++ "\x60\x7b\x58\x98\x11\x9b\x50\x06",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 5 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x1c" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
-+ .klen = 8 + 20 + 28,
++ .klen = 8 + 16 + 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .alen = 8,
+ "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f"
+ "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c"
+ "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00"
-+ "\xab\xc4\xfa\x6d\x20\xe1\xce\x72"
-+ "\x0e\x92\x4e\x97\xaa\x4d\x30\x84"
-+ "\xb6\xd8\x4d\x3b",
-+ .clen = 32 + 20,
++ "\xc5\xec\x47\x33\xae\x05\x28\x49"
++ "\xd5\x2b\x08\xad\x10\x98\x24\x01",
++ .clen = 32 + 16,
+ }, { /* RFC 3686 Case 7 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
-+ "\x00\x00\x00\x00"
+ "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
-+ .klen = 8 + 20 + 36,
++ .klen = 8 + 16 + 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .alen = 8,
+ .plen = 16,
+ .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7"
+ "\x56\x08\x63\xdc\x71\xe3\xe0\xc0"
-+ "\x3d\x6c\x23\x27\xda\x0e\x7f\x29"
-+ "\xfd\x8d\x3c\x1b\xf7\x7a\x63\xd9"
-+ "\x7e\x0f\xe9\xf6",
-+ .clen = 16 + 20,
++ "\xc6\x26\xb2\x27\x0d\x21\xd4\x40"
++ "\x6c\x4f\x53\xea\x19\x75\xda\x8e",
++ .clen = 16 + 16,
+ }, { /* RFC 3686 Case 8 */
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x00\x00\x00\x24" /* enc key length */
+ "\x20\x21\x22\x23\x24\x25\x26\x27"
+ "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-+ "\x30\x31\x32\x33"
+ "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
-+ .klen = 8 + 20 + 36,
++ .klen = 8 + 16 + 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .alen = 8,
+ "\x49\xee\x00\x0b\x80\x4e\xb2\xa9"
+ "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a"
+ "\x55\x30\x83\x1d\x93\x44\xaf\x1c"
-+ "\xe7\xee\x22\xa4\xdd\xbf\x5d\x44"
-+ "\x3b\x43\x1c\x69\x55\x11\xd5\xad"
-+ "\x14\x5f\x44\xa6",
-+ .clen = 32 + 20,
++ "\x8c\x4d\x2a\x8d\x23\x47\x59\x6f"
++ "\x1e\x74\x62\x39\xed\x14\x50\x6c",
++ .clen = 32 + 16,
+ },
+};
+
- static const struct aead_testvec hmac_sha1_ecb_cipher_null_tv_temp[] = {
- { /* Input data from RFC 2410 Case 1 */
+ static const struct aead_testvec hmac_md5_des3_ede_cbc_tv_temp[] = {
+ { /*Generated with cryptopp*/
#ifdef __LITTLE_ENDIAN
.test = alg_test_aead,
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
-@@ -15826,6 +15826,261 @@ static const struct cipher_testvec aes_c
+@@ -15946,6 +15946,261 @@ static const struct cipher_testvec aes_c
},
};