Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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(SHA224) 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>

authored by

Aleksander Jan Bajkowski and committed by
Herbert Xu
d46c27c0 b45b4314

+240 -1
+5 -1
crypto/testmgr.c
··· 4165 4165 } 4166 4166 }, { 4167 4167 .alg = "authenc(hmac(sha224),rfc3686(ctr(aes)))", 4168 - .test = alg_test_null, 4168 + .generic_driver = "authenc(hmac-sha224-lib,rfc3686(ctr(aes-lib)))", 4169 + .test = alg_test_aead, 4169 4170 .fips_allowed = 1, 4171 + .suite = { 4172 + .aead = __VECS(hmac_sha224_aes_ctr_rfc3686_tv_temp) 4173 + } 4170 4174 }, { 4171 4175 .alg = "authenc(hmac(sha256),cbc(aes))", 4172 4176 .generic_driver = "authenc(hmac-sha256-lib,cbc(aes-lib))",
+235
crypto/testmgr.h
··· 15425 15425 }, 15426 15426 }; 15427 15427 15428 + static const struct aead_testvec hmac_sha224_aes_ctr_rfc3686_tv_temp[] = { 15429 + { /* RFC 3686 Case 1 */ 15430 + #ifdef __LITTLE_ENDIAN 15431 + .key = "\x08\x00" /* rta length */ 15432 + "\x01\x00" /* rta type */ 15433 + #else 15434 + .key = "\x00\x08" /* rta length */ 15435 + "\x00\x01" /* rta type */ 15436 + #endif 15437 + "\x00\x00\x00\x14" /* enc key length */ 15438 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15439 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15440 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15441 + "\x00\x00\x00\x00" 15442 + "\xae\x68\x52\xf8\x12\x10\x67\xcc" 15443 + "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e" 15444 + "\x00\x00\x00\x30", 15445 + .klen = 8 + 28 + 20, 15446 + .iv = "\x00\x00\x00\x00\x00\x00\x00\x00", 15447 + .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00", 15448 + .alen = 8, 15449 + .ptext = "Single block msg", 15450 + .plen = 16, 15451 + .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79" 15452 + "\x2d\x61\x75\xa3\x26\x13\x11\xb8" 15453 + "\x36\xb4\x3b\x9c\x62\xed\xcf\x77" 15454 + "\xdc\x19\x27\x3f\x92\x80\x52\xce" 15455 + "\x8f\xad\x01\x0b\x79\xda\x04\x83" 15456 + "\xcb\x45\x1a\x52", 15457 + .clen = 16 + 28, 15458 + }, { /* RFC 3686 Case 2 */ 15459 + #ifdef __LITTLE_ENDIAN 15460 + .key = "\x08\x00" /* rta length */ 15461 + "\x01\x00" /* rta type */ 15462 + #else 15463 + .key = "\x00\x08" /* rta length */ 15464 + "\x00\x01" /* rta type */ 15465 + #endif 15466 + "\x00\x00\x00\x14" /* enc key length */ 15467 + "\x20\x21\x22\x23\x24\x25\x26\x27" 15468 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 15469 + "\x30\x31\x32\x33\x34\x35\x36\x37" 15470 + "\x38\x39\x3a\x3b" 15471 + "\x7e\x24\x06\x78\x17\xfa\xe0\xd7" 15472 + "\x43\xd6\xce\x1f\x32\x53\x91\x63" 15473 + "\x00\x6c\xb6\xdb", 15474 + .klen = 8 + 28 + 20, 15475 + .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 15476 + .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 15477 + .alen = 8, 15478 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15479 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15480 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15481 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 15482 + .plen = 32, 15483 + .ctext = "\x51\x04\xa1\x06\x16\x8a\x72\xd9" 15484 + "\x79\x0d\x41\xee\x8e\xda\xd3\x88" 15485 + "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8" 15486 + "\xfc\xe6\x30\xdf\x91\x41\xbe\x28" 15487 + "\x7f\xe4\x8f\xa7\x06\x71\xe9\xe5" 15488 + "\x16\x79\xef\xf9\x7e\x5c\x93\x4d" 15489 + "\xa0\xf8\x3b\x3a\xaa\x1c\xc0\xd9" 15490 + "\x6b\x48\x49\x01", 15491 + .clen = 32 + 28, 15492 + }, { /* RFC 3686 Case 3 */ 15493 + #ifdef __LITTLE_ENDIAN 15494 + .key = "\x08\x00" /* rta length */ 15495 + "\x01\x00" /* rta type */ 15496 + #else 15497 + .key = "\x00\x08" /* rta length */ 15498 + "\x00\x01" /* rta type */ 15499 + #endif 15500 + "\x00\x00\x00\x14" /* enc key length */ 15501 + "\x11\x22\x33\x44\x55\x66\x77\x88" 15502 + "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" 15503 + "\x22\x33\x44\x55\x66\x77\x88\x99" 15504 + "\xaa\xbb\xcc\xdd" 15505 + "\x76\x91\xbe\x03\x5e\x50\x20\xa8" 15506 + "\xac\x6e\x61\x85\x29\xf9\xa0\xdc" 15507 + "\x00\xe0\x01\x7b", 15508 + .klen = 8 + 28 + 20, 15509 + .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 15510 + .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 15511 + .alen = 8, 15512 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15513 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15514 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15515 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" 15516 + "\x20\x21\x22\x23", 15517 + .plen = 36, 15518 + .ctext = "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9" 15519 + "\xcf\x46\x52\xe9\xef\xdb\x72\xd7" 15520 + "\x45\x40\xa4\x2b\xde\x6d\x78\x36" 15521 + "\xd5\x9a\x5c\xea\xae\xf3\x10\x53" 15522 + "\x25\xb2\x07\x2f" 15523 + "\xb0\x19\x45\xee\xa7\x31\xd9\xd0" 15524 + "\x74\x6b\xb8\xb1\x67\x61\x2f\x8c" 15525 + "\x68\xde\xe3\xc9\x3b\x0c\x72\xda" 15526 + "\x48\xba\x1b\x51", 15527 + .clen = 36 + 28, 15528 + }, { /* RFC 3686 Case 4 */ 15529 + #ifdef __LITTLE_ENDIAN 15530 + .key = "\x08\x00" /* rta length */ 15531 + "\x01\x00" /* rta type */ 15532 + #else 15533 + .key = "\x00\x08" /* rta length */ 15534 + "\x00\x01" /* rta type */ 15535 + #endif 15536 + "\x00\x00\x00\x1c" /* enc key length */ 15537 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15538 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15539 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15540 + "\x00\x00\x00\x00" 15541 + "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79" 15542 + "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed" 15543 + "\x86\x3d\x06\xcc\xfd\xb7\x85\x15" 15544 + "\x00\x00\x00\x48", 15545 + .klen = 8 + 28 + 28, 15546 + .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 15547 + .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 15548 + .alen = 8, 15549 + .ptext = "Single block msg", 15550 + .plen = 16, 15551 + .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8" 15552 + "\x4e\x79\x35\xa0\x03\xcb\xe9\x28" 15553 + "\xfd\xf5\x35\x26\x50\x3d\xdf\x80" 15554 + "\x6e\xbe\xba\x8d\x56\xf3\x03\xb7" 15555 + "\x27\xb8\x13\xe8\x72\x8f\xc9\x52" 15556 + "\x4a\xb7\xc3\x3a", 15557 + .clen = 16 + 28, 15558 + }, { /* RFC 3686 Case 5 */ 15559 + #ifdef __LITTLE_ENDIAN 15560 + .key = "\x08\x00" /* rta length */ 15561 + "\x01\x00" /* rta type */ 15562 + #else 15563 + .key = "\x00\x08" /* rta length */ 15564 + "\x00\x01" /* rta type */ 15565 + #endif 15566 + "\x00\x00\x00\x1c" /* enc key length */ 15567 + "\x20\x21\x22\x23\x24\x25\x26\x27" 15568 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 15569 + "\x30\x31\x32\x33\x34\x35\x36\x37" 15570 + "\x38\x39\x3a\x3b" 15571 + "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c" 15572 + "\x19\xe7\x34\x08\x19\xe0\xf6\x9c" 15573 + "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a" 15574 + "\x00\x96\xb0\x3b", 15575 + .klen = 8 + 28 + 28, 15576 + .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 15577 + .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 15578 + .alen = 8, 15579 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15580 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15581 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15582 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 15583 + .plen = 32, 15584 + .ctext = "\x45\x32\x43\xfc\x60\x9b\x23\x32" 15585 + "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f" 15586 + "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c" 15587 + "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00" 15588 + "\x72\x89\xa8\x04\xa5\xac\x8f\x29" 15589 + "\xe6\xb8\x58\xe8\xcf\x6a\x91\x89" 15590 + "\xd3\x66\x3b\xdc\xce\x43\x23\xb7" 15591 + "\x6a\xdd\x9d\xbd", 15592 + .clen = 32 + 28, 15593 + }, { /* RFC 3686 Case 7 */ 15594 + #ifdef __LITTLE_ENDIAN 15595 + .key = "\x08\x00" /* rta length */ 15596 + "\x01\x00" /* rta type */ 15597 + #else 15598 + .key = "\x00\x08" /* rta length */ 15599 + "\x00\x01" /* rta type */ 15600 + #endif 15601 + "\x00\x00\x00\x24" /* enc key length */ 15602 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15603 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15604 + "\x00\x00\x00\x00\x00\x00\x00\x00" 15605 + "\x00\x00\x00\x00" 15606 + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f" 15607 + "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c" 15608 + "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3" 15609 + "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04" 15610 + "\x00\x00\x00\x60", 15611 + .klen = 8 + 28 + 36, 15612 + .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 15613 + .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 15614 + .alen = 8, 15615 + .ptext = "Single block msg", 15616 + .plen = 16, 15617 + .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7" 15618 + "\x56\x08\x63\xdc\x71\xe3\xe0\xc0" 15619 + "\xfe\xdf\x6f\x62\x8a\x79\xb5\x34" 15620 + "\xd0\x6f\x32\xaf\x31\x50\x5b\x1f" 15621 + "\xe0\x6d\x0b\xbc\x02\x25\xee\x74" 15622 + "\x7a\xdf\x97\x3c", 15623 + .clen = 16 + 28, 15624 + }, { /* RFC 3686 Case 8 */ 15625 + #ifdef __LITTLE_ENDIAN 15626 + .key = "\x08\x00" /* rta length */ 15627 + "\x01\x00" /* rta type */ 15628 + #else 15629 + .key = "\x00\x08" /* rta length */ 15630 + "\x00\x01" /* rta type */ 15631 + #endif 15632 + "\x00\x00\x00\x24" /* enc key length */ 15633 + "\x20\x21\x22\x23\x24\x25\x26\x27" 15634 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 15635 + "\x30\x31\x32\x33\x34\x35\x36\x37" 15636 + "\x38\x39\x3a\x3b" 15637 + "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb" 15638 + "\x07\x96\x36\x58\x79\xef\xf8\x86" 15639 + "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74" 15640 + "\x4b\x50\x59\x0c\x87\xa2\x38\x84" 15641 + "\x00\xfa\xac\x24", 15642 + .klen = 8 + 28 + 36, 15643 + .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 15644 + .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 15645 + .alen = 8, 15646 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 15647 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 15648 + "\x10\x11\x12\x13\x14\x15\x16\x17" 15649 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 15650 + .plen = 32, 15651 + .ctext = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c" 15652 + "\x49\xee\x00\x0b\x80\x4e\xb2\xa9" 15653 + "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a" 15654 + "\x55\x30\x83\x1d\x93\x44\xaf\x1c" 15655 + "\x19\x1e\x9c\x2c\x6d\x4e\x21\xda" 15656 + "\x6c\x4d\x88\x90\xf8\x5f\xa5\x9d" 15657 + "\xb4\xd4\x40\xad\xfa\x67\x3f\x0e" 15658 + "\x11\x12\xd6\x10", 15659 + .clen = 32 + 28, 15660 + }, 15661 + }; 15662 + 15428 15663 static const struct aead_testvec hmac_sha256_aes_cbc_tv_temp[] = { 15429 15664 { /* RFC 3602 Case 1 */ 15430 15665 #ifdef __LITTLE_ENDIAN