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(sha384),rfc3686(ctr(aes)))

Test vectors were generated starting from existing RFC3686(CTR(AES)) test
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: 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
2f081427 5ac6b904

+268 -1
+5 -1
crypto/testmgr.c
··· 4247 4247 } 4248 4248 }, { 4249 4249 .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))", 4250 - .test = alg_test_null, 4250 + .generic_driver = "authenc(hmac-sha384-lib,rfc3686(ctr(aes-lib)))", 4251 + .test = alg_test_aead, 4251 4252 .fips_allowed = 1, 4253 + .suite = { 4254 + .aead = __VECS(hmac_sha384_aes_ctr_rfc3686_tv_temp) 4255 + } 4252 4256 }, { 4253 4257 .alg = "authenc(hmac(sha512),cbc(aes))", 4254 4258 .generic_driver = "authenc(hmac-sha512-lib,cbc(aes-lib))",
+263
crypto/testmgr.h
··· 16489 16489 }, 16490 16490 }; 16491 16491 16492 + static const struct aead_testvec hmac_sha384_aes_ctr_rfc3686_tv_temp[] = { 16493 + { /* RFC 3686 Case 1 */ 16494 + #ifdef __LITTLE_ENDIAN 16495 + .key = "\x08\x00" /* rta length */ 16496 + "\x01\x00" /* rta type */ 16497 + #else 16498 + .key = "\x00\x08" /* rta length */ 16499 + "\x00\x01" /* rta type */ 16500 + #endif 16501 + "\x00\x00\x00\x14" /* enc key length */ 16502 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16503 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16504 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16505 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16506 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16507 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16508 + "\xae\x68\x52\xf8\x12\x10\x67\xcc" 16509 + "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e" 16510 + "\x00\x00\x00\x30", 16511 + .klen = 8 + 48 + 20, 16512 + .iv = "\x00\x00\x00\x00\x00\x00\x00\x00", 16513 + .assoc = "\x00\x00\x00\x00\x00\x00\x00\x00", 16514 + .alen = 8, 16515 + .ptext = "Single block msg", 16516 + .plen = 16, 16517 + .ctext = "\xe4\x09\x5d\x4f\xb7\xa7\xb3\x79" 16518 + "\x2d\x61\x75\xa3\x26\x13\x11\xb8" 16519 + "\x45\x51\x59\x72\x16\xd3\xc6\x15" 16520 + "\x25\x1e\xe8\x92\x2e\x47\x52\xcc" 16521 + "\x91\x9c\x24\xef\x11\xb2\x53\x00" 16522 + "\x10\x20\x43\x06\xe2\x35\x88\x9e" 16523 + "\x18\x32\x5a\x79\x7d\x73\x7e\x89" 16524 + "\xfe\xa1\xda\xa4\x86\xc4\x2a\x04", 16525 + .clen = 16 + 48, 16526 + }, { /* RFC 3686 Case 2 */ 16527 + #ifdef __LITTLE_ENDIAN 16528 + .key = "\x08\x00" /* rta length */ 16529 + "\x01\x00" /* rta type */ 16530 + #else 16531 + .key = "\x00\x08" /* rta length */ 16532 + "\x00\x01" /* rta type */ 16533 + #endif 16534 + "\x00\x00\x00\x14" /* enc key length */ 16535 + "\x20\x21\x22\x23\x24\x25\x26\x27" 16536 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 16537 + "\x30\x31\x32\x33\x34\x35\x36\x37" 16538 + "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" 16539 + "\x40\x41\x42\x43\x44\x45\x46\x47" 16540 + "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" 16541 + "\x7e\x24\x06\x78\x17\xfa\xe0\xd7" 16542 + "\x43\xd6\xce\x1f\x32\x53\x91\x63" 16543 + "\x00\x6c\xb6\xdb", 16544 + .klen = 8 + 48 + 20, 16545 + .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 16546 + .assoc = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b", 16547 + .alen = 8, 16548 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 16549 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 16550 + "\x10\x11\x12\x13\x14\x15\x16\x17" 16551 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 16552 + .plen = 32, 16553 + .ctext = "\x51\x04\xa1\x06\x16\x8a\x72\xd9" 16554 + "\x79\x0d\x41\xee\x8e\xda\xd3\x88" 16555 + "\xeb\x2e\x1e\xfc\x46\xda\x57\xc8" 16556 + "\xfc\xe6\x30\xdf\x91\x41\xbe\x28" 16557 + "\x83\x65\x32\x1e\x6b\x60\xe6\x4a" 16558 + "\xe2\xab\x52\x2b\xa6\x70\x3a\xfa" 16559 + "\xd2\xec\x83\xe4\x31\x0c\x28\x40" 16560 + "\x9b\x5e\x18\xa4\xdc\x48\xb8\x56" 16561 + "\x33\xab\x7f\x2b\xaf\xe4\x3a\xe3" 16562 + "\x8a\x61\xf6\x22\xb4\x6b\xfe\x7d", 16563 + .clen = 32 + 48, 16564 + }, { /* RFC 3686 Case 3 */ 16565 + #ifdef __LITTLE_ENDIAN 16566 + .key = "\x08\x00" /* rta length */ 16567 + "\x01\x00" /* rta type */ 16568 + #else 16569 + .key = "\x00\x08" /* rta length */ 16570 + "\x00\x01" /* rta type */ 16571 + #endif 16572 + "\x00\x00\x00\x14" /* enc key length */ 16573 + "\x11\x22\x33\x44\x55\x66\x77\x88" 16574 + "\x99\xaa\xbb\xcc\xdd\xee\xff\x11" 16575 + "\x22\x33\x44\x55\x66\x77\x88\x99" 16576 + "\xaa\xbb\xcc\xdd\xee\xff\x11\x22" 16577 + "\x33\x44\x55\x66\x77\x88\x99\xaa" 16578 + "\xbb\xcc\xdd\xee\xff\x11\x22\x33" 16579 + "\x76\x91\xbe\x03\x5e\x50\x20\xa8" 16580 + "\xac\x6e\x61\x85\x29\xf9\xa0\xdc" 16581 + "\x00\xe0\x01\x7b", 16582 + .klen = 8 + 48 + 20, 16583 + .iv = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 16584 + .assoc = "\x27\x77\x7f\x3f\x4a\x17\x86\xf0", 16585 + .alen = 8, 16586 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 16587 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 16588 + "\x10\x11\x12\x13\x14\x15\x16\x17" 16589 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" 16590 + "\x20\x21\x22\x23", 16591 + .plen = 36, 16592 + .ctext = "\xc1\xcf\x48\xa8\x9f\x2f\xfd\xd9" 16593 + "\xcf\x46\x52\xe9\xef\xdb\x72\xd7" 16594 + "\x45\x40\xa4\x2b\xde\x6d\x78\x36" 16595 + "\xd5\x9a\x5c\xea\xae\xf3\x10\x53" 16596 + "\x25\xb2\x07\x2f" 16597 + "\x4a\xaa\xad\x3b\x3b\xb6\x9a\xba" 16598 + "\xa1\x7b\xc6\xce\x96\xc3\xff\x67" 16599 + "\xf3\x0c\x33\x57\xf0\x51\x24\x08" 16600 + "\xed\x4f\x6a\x9c\x22\x42\xbd\x18" 16601 + "\x97\x74\x68\x36\x00\xf1\x69\x3a" 16602 + "\x18\x77\x40\xf0\x56\xba\xba\xe0", 16603 + .clen = 36 + 48, 16604 + }, { /* RFC 3686 Case 4 */ 16605 + #ifdef __LITTLE_ENDIAN 16606 + .key = "\x08\x00" /* rta length */ 16607 + "\x01\x00" /* rta type */ 16608 + #else 16609 + .key = "\x00\x08" /* rta length */ 16610 + "\x00\x01" /* rta type */ 16611 + #endif 16612 + "\x00\x00\x00\x1c" /* enc key length */ 16613 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16614 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16615 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16616 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16617 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16618 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16619 + "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79" 16620 + "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed" 16621 + "\x86\x3d\x06\xcc\xfd\xb7\x85\x15" 16622 + "\x00\x00\x00\x48", 16623 + .klen = 8 + 48 + 28, 16624 + .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 16625 + .assoc = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb", 16626 + .alen = 8, 16627 + .ptext = "Single block msg", 16628 + .plen = 16, 16629 + .ctext = "\x4b\x55\x38\x4f\xe2\x59\xc9\xc8" 16630 + "\x4e\x79\x35\xa0\x03\xcb\xe9\x28" 16631 + "\x36\xd6\xc7\x55\xac\xb6\x0b\x14" 16632 + "\x95\x71\xf9\x86\x30\xe3\x96\xc3" 16633 + "\x76\x85\x6d\xa5\x06\xed\x6f\x34" 16634 + "\xcc\x1f\xcc\x2d\x88\x06\xb0\x1d" 16635 + "\xbe\xd9\xa2\xd3\x64\xf1\x33\x03" 16636 + "\x13\x50\x8f\xae\x61\x2d\x82\xb8", 16637 + .clen = 16 + 48, 16638 + }, { /* RFC 3686 Case 5 */ 16639 + #ifdef __LITTLE_ENDIAN 16640 + .key = "\x08\x00" /* rta length */ 16641 + "\x01\x00" /* rta type */ 16642 + #else 16643 + .key = "\x00\x08" /* rta length */ 16644 + "\x00\x01" /* rta type */ 16645 + #endif 16646 + "\x00\x00\x00\x1c" /* enc key length */ 16647 + "\x20\x21\x22\x23\x24\x25\x26\x27" 16648 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 16649 + "\x30\x31\x32\x33\x34\x35\x36\x37" 16650 + "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" 16651 + "\x40\x41\x42\x43\x44\x45\x46\x47" 16652 + "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" 16653 + "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c" 16654 + "\x19\xe7\x34\x08\x19\xe0\xf6\x9c" 16655 + "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a" 16656 + "\x00\x96\xb0\x3b", 16657 + .klen = 8 + 48 + 28, 16658 + .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 16659 + .assoc = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d", 16660 + .alen = 8, 16661 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 16662 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 16663 + "\x10\x11\x12\x13\x14\x15\x16\x17" 16664 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 16665 + .plen = 32, 16666 + .ctext = "\x45\x32\x43\xfc\x60\x9b\x23\x32" 16667 + "\x7e\xdf\xaa\xfa\x71\x31\xcd\x9f" 16668 + "\x84\x90\x70\x1c\x5a\xd4\xa7\x9c" 16669 + "\xfc\x1f\xe0\xff\x42\xf4\xfb\x00" 16670 + "\x80\x12\x67\x22\xf2\x4d\x9b\xbf" 16671 + "\xdc\x38\xd3\xaa\x12\xc0\x58\x1a" 16672 + "\x9a\x62\x6e\x42\x3d\x44\x63\xdd" 16673 + "\xee\x7e\xe3\xa3\xdf\x2a\x65\x05" 16674 + "\xd0\xc1\xd2\x54\x55\x35\x5c\xc7" 16675 + "\xb0\xb5\xb1\x36\xe0\x0b\xaf\x72", 16676 + .clen = 32 + 48, 16677 + }, { /* RFC 3686 Case 7 */ 16678 + #ifdef __LITTLE_ENDIAN 16679 + .key = "\x08\x00" /* rta length */ 16680 + "\x01\x00" /* rta type */ 16681 + #else 16682 + .key = "\x00\x08" /* rta length */ 16683 + "\x00\x01" /* rta type */ 16684 + #endif 16685 + "\x00\x00\x00\x24" /* enc key length */ 16686 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16687 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16688 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16689 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16690 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16691 + "\x00\x00\x00\x00\x00\x00\x00\x00" 16692 + "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f" 16693 + "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c" 16694 + "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3" 16695 + "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04" 16696 + "\x00\x00\x00\x60", 16697 + .klen = 8 + 48 + 36, 16698 + .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 16699 + .assoc = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2", 16700 + .alen = 8, 16701 + .ptext = "Single block msg", 16702 + .plen = 16, 16703 + .ctext = "\x14\x5a\xd0\x1d\xbf\x82\x4e\xc7" 16704 + "\x56\x08\x63\xdc\x71\xe3\xe0\xc0" 16705 + "\xb1\x7b\xb1\xec\xca\x94\x55\xc4" 16706 + "\x3f\x2b\xb1\x70\x04\x91\xf5\x9d" 16707 + "\x1a\xc0\xe1\x2a\x93\x5f\x96\x2a" 16708 + "\x12\x85\x38\x36\xe1\xb2\xe9\xf0" 16709 + "\xf2\x6e\x5d\x81\xcc\x49\x07\x9c" 16710 + "\x5b\x88\xc8\xcc\xc4\x21\x4f\x32", 16711 + .clen = 16 + 48, 16712 + }, { /* RFC 3686 Case 8 */ 16713 + #ifdef __LITTLE_ENDIAN 16714 + .key = "\x08\x00" /* rta length */ 16715 + "\x01\x00" /* rta type */ 16716 + #else 16717 + .key = "\x00\x08" /* rta length */ 16718 + "\x00\x01" /* rta type */ 16719 + #endif 16720 + "\x00\x00\x00\x24" /* enc key length */ 16721 + "\x20\x21\x22\x23\x24\x25\x26\x27" 16722 + "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" 16723 + "\x30\x31\x32\x33\x34\x35\x36\x37" 16724 + "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" 16725 + "\x40\x41\x42\x43\x44\x45\x46\x47" 16726 + "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" 16727 + "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb" 16728 + "\x07\x96\x36\x58\x79\xef\xf8\x86" 16729 + "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74" 16730 + "\x4b\x50\x59\x0c\x87\xa2\x38\x84" 16731 + "\x00\xfa\xac\x24", 16732 + .klen = 8 + 48 + 36, 16733 + .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 16734 + .assoc = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75", 16735 + .alen = 8, 16736 + .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07" 16737 + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" 16738 + "\x10\x11\x12\x13\x14\x15\x16\x17" 16739 + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", 16740 + .plen = 32, 16741 + .ctext = "\xf0\x5e\x23\x1b\x38\x94\x61\x2c" 16742 + "\x49\xee\x00\x0b\x80\x4e\xb2\xa9" 16743 + "\xb8\x30\x6b\x50\x8f\x83\x9d\x6a" 16744 + "\x55\x30\x83\x1d\x93\x44\xaf\x1c" 16745 + "\xd6\x96\xbb\x12\x39\xc4\x4d\xe2" 16746 + "\x4c\x02\xe7\x1f\xdc\xb2\xb1\x57" 16747 + "\x38\x0d\xdd\x13\xb3\x89\x57\x9e" 16748 + "\x1f\xb5\x48\x32\xc4\xd3\x9d\x1f" 16749 + "\x68\xab\x8d\xc6\xa8\x05\x3a\xc2" 16750 + "\x87\xaf\x23\xb3\xe4\x1b\xde\xb3", 16751 + .clen = 32 + 48, 16752 + }, 16753 + }; 16754 + 16492 16755 static const struct aead_testvec hmac_sha512_aes_cbc_tv_temp[] = { 16493 16756 { /* RFC 3602 Case 1 */ 16494 16757 #ifdef __LITTLE_ENDIAN