aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c260
1 files changed, 101 insertions, 159 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 09f2f0f582bf..e4f3f5f688e7 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -77,10 +77,8 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
77#define DECRYPT 0 77#define DECRYPT 0
78 78
79struct aead_test_suite { 79struct aead_test_suite {
80 struct { 80 const struct aead_testvec *vecs;
81 const struct aead_testvec *vecs; 81 unsigned int count;
82 unsigned int count;
83 } enc, dec;
84}; 82};
85 83
86struct cipher_test_suite { 84struct cipher_test_suite {
@@ -616,9 +614,6 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
616 const char *e, *d; 614 const char *e, *d;
617 struct crypto_wait wait; 615 struct crypto_wait wait;
618 unsigned int authsize, iv_len; 616 unsigned int authsize, iv_len;
619 void *input;
620 void *output;
621 void *assoc;
622 char *iv; 617 char *iv;
623 char *xbuf[XBUFSIZE]; 618 char *xbuf[XBUFSIZE];
624 char *xoutbuf[XBUFSIZE]; 619 char *xoutbuf[XBUFSIZE];
@@ -669,27 +664,41 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
669 iv_len = crypto_aead_ivsize(tfm); 664 iv_len = crypto_aead_ivsize(tfm);
670 665
671 for (i = 0, j = 0; i < tcount; i++) { 666 for (i = 0, j = 0; i < tcount; i++) {
667 const char *input, *expected_output;
668 unsigned int inlen, outlen;
669 char *inbuf, *outbuf, *assocbuf;
670
672 if (template[i].np) 671 if (template[i].np)
673 continue; 672 continue;
674 if (enc && template[i].novrfy) 673 if (enc) {
675 continue; 674 if (template[i].novrfy)
675 continue;
676 input = template[i].ptext;
677 inlen = template[i].plen;
678 expected_output = template[i].ctext;
679 outlen = template[i].clen;
680 } else {
681 input = template[i].ctext;
682 inlen = template[i].clen;
683 expected_output = template[i].ptext;
684 outlen = template[i].plen;
685 }
676 686
677 j++; 687 j++;
678 688
679 /* some templates have no input data but they will 689 /* some templates have no input data but they will
680 * touch input 690 * touch input
681 */ 691 */
682 input = xbuf[0]; 692 inbuf = xbuf[0] + align_offset;
683 input += align_offset; 693 assocbuf = axbuf[0];
684 assoc = axbuf[0];
685 694
686 ret = -EINVAL; 695 ret = -EINVAL;
687 if (WARN_ON(align_offset + template[i].ilen > 696 if (WARN_ON(align_offset + template[i].clen > PAGE_SIZE ||
688 PAGE_SIZE || template[i].alen > PAGE_SIZE)) 697 template[i].alen > PAGE_SIZE))
689 goto out; 698 goto out;
690 699
691 memcpy(input, template[i].input, template[i].ilen); 700 memcpy(inbuf, input, inlen);
692 memcpy(assoc, template[i].assoc, template[i].alen); 701 memcpy(assocbuf, template[i].assoc, template[i].alen);
693 if (template[i].iv) 702 if (template[i].iv)
694 memcpy(iv, template[i].iv, iv_len); 703 memcpy(iv, template[i].iv, iv_len);
695 else 704 else
@@ -716,7 +725,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
716 } else if (ret) 725 } else if (ret)
717 continue; 726 continue;
718 727
719 authsize = abs(template[i].rlen - template[i].ilen); 728 authsize = template[i].clen - template[i].plen;
720 ret = crypto_aead_setauthsize(tfm, authsize); 729 ret = crypto_aead_setauthsize(tfm, authsize);
721 if (ret) { 730 if (ret) {
722 pr_err("alg: aead%s: Failed to set authsize to %u on test %d for %s\n", 731 pr_err("alg: aead%s: Failed to set authsize to %u on test %d for %s\n",
@@ -726,23 +735,20 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
726 735
727 k = !!template[i].alen; 736 k = !!template[i].alen;
728 sg_init_table(sg, k + 1); 737 sg_init_table(sg, k + 1);
729 sg_set_buf(&sg[0], assoc, template[i].alen); 738 sg_set_buf(&sg[0], assocbuf, template[i].alen);
730 sg_set_buf(&sg[k], input, 739 sg_set_buf(&sg[k], inbuf, template[i].clen);
731 template[i].ilen + (enc ? authsize : 0)); 740 outbuf = inbuf;
732 output = input;
733 741
734 if (diff_dst) { 742 if (diff_dst) {
735 sg_init_table(sgout, k + 1); 743 sg_init_table(sgout, k + 1);
736 sg_set_buf(&sgout[0], assoc, template[i].alen); 744 sg_set_buf(&sgout[0], assocbuf, template[i].alen);
737 745
738 output = xoutbuf[0]; 746 outbuf = xoutbuf[0] + align_offset;
739 output += align_offset; 747 sg_set_buf(&sgout[k], outbuf, template[i].clen);
740 sg_set_buf(&sgout[k], output,
741 template[i].rlen + (enc ? 0 : authsize));
742 } 748 }
743 749
744 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, 750 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, inlen,
745 template[i].ilen, iv); 751 iv);
746 752
747 aead_request_set_ad(req, template[i].alen); 753 aead_request_set_ad(req, template[i].alen);
748 754
@@ -771,17 +777,19 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
771 goto out; 777 goto out;
772 } 778 }
773 779
774 q = output; 780 if (memcmp(outbuf, expected_output, outlen)) {
775 if (memcmp(q, template[i].result, template[i].rlen)) {
776 pr_err("alg: aead%s: Test %d failed on %s for %s\n", 781 pr_err("alg: aead%s: Test %d failed on %s for %s\n",
777 d, j, e, algo); 782 d, j, e, algo);
778 hexdump(q, template[i].rlen); 783 hexdump(outbuf, outlen);
779 ret = -EINVAL; 784 ret = -EINVAL;
780 goto out; 785 goto out;
781 } 786 }
782 } 787 }
783 788
784 for (i = 0, j = 0; i < tcount; i++) { 789 for (i = 0, j = 0; i < tcount; i++) {
790 const char *input, *expected_output;
791 unsigned int inlen, outlen;
792
785 /* alignment tests are only done with continuous buffers */ 793 /* alignment tests are only done with continuous buffers */
786 if (align_offset != 0) 794 if (align_offset != 0)
787 break; 795 break;
@@ -789,8 +797,19 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
789 if (!template[i].np) 797 if (!template[i].np)
790 continue; 798 continue;
791 799
792 if (enc && template[i].novrfy) 800 if (enc) {
793 continue; 801 if (template[i].novrfy)
802 continue;
803 input = template[i].ptext;
804 inlen = template[i].plen;
805 expected_output = template[i].ctext;
806 outlen = template[i].clen;
807 } else {
808 input = template[i].ctext;
809 inlen = template[i].clen;
810 expected_output = template[i].ptext;
811 outlen = template[i].plen;
812 }
794 813
795 j++; 814 j++;
796 815
@@ -818,7 +837,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
818 } else if (ret) 837 } else if (ret)
819 continue; 838 continue;
820 839
821 authsize = abs(template[i].rlen - template[i].ilen); 840 authsize = template[i].clen - template[i].plen;
822 841
823 ret = -EINVAL; 842 ret = -EINVAL;
824 sg_init_table(sg, template[i].anp + template[i].np); 843 sg_init_table(sg, template[i].anp + template[i].np);
@@ -845,32 +864,32 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
845 } 864 }
846 865
847 for (k = 0, temp = 0; k < template[i].np; k++) { 866 for (k = 0, temp = 0; k < template[i].np; k++) {
848 if (WARN_ON(offset_in_page(IDX[k]) + 867 n = template[i].tap[k];
849 template[i].tap[k] > PAGE_SIZE)) 868 if (k == template[i].np - 1 && !enc)
869 n += authsize;
870
871 if (WARN_ON(offset_in_page(IDX[k]) + n > PAGE_SIZE))
850 goto out; 872 goto out;
851 873
852 q = xbuf[IDX[k] >> PAGE_SHIFT] + offset_in_page(IDX[k]); 874 q = xbuf[IDX[k] >> PAGE_SHIFT] + offset_in_page(IDX[k]);
853 memcpy(q, template[i].input + temp, template[i].tap[k]); 875 memcpy(q, input + temp, n);
854 sg_set_buf(&sg[template[i].anp + k], 876 sg_set_buf(&sg[template[i].anp + k], q, n);
855 q, template[i].tap[k]);
856 877
857 if (diff_dst) { 878 if (diff_dst) {
858 q = xoutbuf[IDX[k] >> PAGE_SHIFT] + 879 q = xoutbuf[IDX[k] >> PAGE_SHIFT] +
859 offset_in_page(IDX[k]); 880 offset_in_page(IDX[k]);
860 881
861 memset(q, 0, template[i].tap[k]); 882 memset(q, 0, n);
862 883
863 sg_set_buf(&sgout[template[i].anp + k], 884 sg_set_buf(&sgout[template[i].anp + k], q, n);
864 q, template[i].tap[k]);
865 } 885 }
866 886
867 n = template[i].tap[k];
868 if (k == template[i].np - 1 && enc) 887 if (k == template[i].np - 1 && enc)
869 n += authsize; 888 n += authsize;
870 if (offset_in_page(q) + n < PAGE_SIZE) 889 if (offset_in_page(q) + n < PAGE_SIZE)
871 q[n] = 0; 890 q[n] = 0;
872 891
873 temp += template[i].tap[k]; 892 temp += n;
874 } 893 }
875 894
876 ret = crypto_aead_setauthsize(tfm, authsize); 895 ret = crypto_aead_setauthsize(tfm, authsize);
@@ -895,8 +914,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
895 } 914 }
896 915
897 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, 916 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg,
898 template[i].ilen, 917 inlen, iv);
899 iv);
900 918
901 aead_request_set_ad(req, template[i].alen); 919 aead_request_set_ad(req, template[i].alen);
902 920
@@ -935,10 +953,10 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
935 offset_in_page(IDX[k]); 953 offset_in_page(IDX[k]);
936 954
937 n = template[i].tap[k]; 955 n = template[i].tap[k];
938 if (k == template[i].np - 1) 956 if (k == template[i].np - 1 && enc)
939 n += enc ? authsize : -authsize; 957 n += authsize;
940 958
941 if (memcmp(q, template[i].result + temp, n)) { 959 if (memcmp(q, expected_output + temp, n)) {
942 pr_err("alg: aead%s: Chunk test %d failed on %s at page %u for %s\n", 960 pr_err("alg: aead%s: Chunk test %d failed on %s at page %u for %s\n",
943 d, j, e, k, algo); 961 d, j, e, k, algo);
944 hexdump(q, n); 962 hexdump(q, n);
@@ -947,9 +965,8 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
947 965
948 q += n; 966 q += n;
949 if (k == template[i].np - 1 && !enc) { 967 if (k == template[i].np - 1 && !enc) {
950 if (!diff_dst && 968 if (!diff_dst && memcmp(q, input + temp + n,
951 memcmp(q, template[i].input + 969 authsize))
952 temp + n, authsize))
953 n = authsize; 970 n = authsize;
954 else 971 else
955 n = 0; 972 n = 0;
@@ -1721,8 +1738,9 @@ out:
1721static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, 1738static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
1722 u32 type, u32 mask) 1739 u32 type, u32 mask)
1723{ 1740{
1741 const struct aead_test_suite *suite = &desc->suite.aead;
1724 struct crypto_aead *tfm; 1742 struct crypto_aead *tfm;
1725 int err = 0; 1743 int err;
1726 1744
1727 tfm = crypto_alloc_aead(driver, type, mask); 1745 tfm = crypto_alloc_aead(driver, type, mask);
1728 if (IS_ERR(tfm)) { 1746 if (IS_ERR(tfm)) {
@@ -1731,18 +1749,10 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
1731 return PTR_ERR(tfm); 1749 return PTR_ERR(tfm);
1732 } 1750 }
1733 1751
1734 if (desc->suite.aead.enc.vecs) { 1752 err = test_aead(tfm, ENCRYPT, suite->vecs, suite->count);
1735 err = test_aead(tfm, ENCRYPT, desc->suite.aead.enc.vecs, 1753 if (!err)
1736 desc->suite.aead.enc.count); 1754 err = test_aead(tfm, DECRYPT, suite->vecs, suite->count);
1737 if (err)
1738 goto out;
1739 }
1740
1741 if (!err && desc->suite.aead.dec.vecs)
1742 err = test_aead(tfm, DECRYPT, desc->suite.aead.dec.vecs,
1743 desc->suite.aead.dec.count);
1744 1755
1745out:
1746 crypto_free_aead(tfm); 1756 crypto_free_aead(tfm);
1747 return err; 1757 return err;
1748} 1758}
@@ -2452,28 +2462,19 @@ static const struct alg_test_desc alg_test_descs[] = {
2452 .alg = "aegis128", 2462 .alg = "aegis128",
2453 .test = alg_test_aead, 2463 .test = alg_test_aead,
2454 .suite = { 2464 .suite = {
2455 .aead = { 2465 .aead = __VECS(aegis128_tv_template)
2456 .enc = __VECS(aegis128_enc_tv_template),
2457 .dec = __VECS(aegis128_dec_tv_template),
2458 }
2459 } 2466 }
2460 }, { 2467 }, {
2461 .alg = "aegis128l", 2468 .alg = "aegis128l",
2462 .test = alg_test_aead, 2469 .test = alg_test_aead,
2463 .suite = { 2470 .suite = {
2464 .aead = { 2471 .aead = __VECS(aegis128l_tv_template)
2465 .enc = __VECS(aegis128l_enc_tv_template),
2466 .dec = __VECS(aegis128l_dec_tv_template),
2467 }
2468 } 2472 }
2469 }, { 2473 }, {
2470 .alg = "aegis256", 2474 .alg = "aegis256",
2471 .test = alg_test_aead, 2475 .test = alg_test_aead,
2472 .suite = { 2476 .suite = {
2473 .aead = { 2477 .aead = __VECS(aegis256_tv_template)
2474 .enc = __VECS(aegis256_enc_tv_template),
2475 .dec = __VECS(aegis256_dec_tv_template),
2476 }
2477 } 2478 }
2478 }, { 2479 }, {
2479 .alg = "ansi_cprng", 2480 .alg = "ansi_cprng",
@@ -2485,36 +2486,27 @@ static const struct alg_test_desc alg_test_descs[] = {
2485 .alg = "authenc(hmac(md5),ecb(cipher_null))", 2486 .alg = "authenc(hmac(md5),ecb(cipher_null))",
2486 .test = alg_test_aead, 2487 .test = alg_test_aead,
2487 .suite = { 2488 .suite = {
2488 .aead = { 2489 .aead = __VECS(hmac_md5_ecb_cipher_null_tv_template)
2489 .enc = __VECS(hmac_md5_ecb_cipher_null_enc_tv_template),
2490 .dec = __VECS(hmac_md5_ecb_cipher_null_dec_tv_template)
2491 }
2492 } 2490 }
2493 }, { 2491 }, {
2494 .alg = "authenc(hmac(sha1),cbc(aes))", 2492 .alg = "authenc(hmac(sha1),cbc(aes))",
2495 .test = alg_test_aead, 2493 .test = alg_test_aead,
2496 .fips_allowed = 1, 2494 .fips_allowed = 1,
2497 .suite = { 2495 .suite = {
2498 .aead = { 2496 .aead = __VECS(hmac_sha1_aes_cbc_tv_temp)
2499 .enc = __VECS(hmac_sha1_aes_cbc_enc_tv_temp)
2500 }
2501 } 2497 }
2502 }, { 2498 }, {
2503 .alg = "authenc(hmac(sha1),cbc(des))", 2499 .alg = "authenc(hmac(sha1),cbc(des))",
2504 .test = alg_test_aead, 2500 .test = alg_test_aead,
2505 .suite = { 2501 .suite = {
2506 .aead = { 2502 .aead = __VECS(hmac_sha1_des_cbc_tv_temp)
2507 .enc = __VECS(hmac_sha1_des_cbc_enc_tv_temp)
2508 }
2509 } 2503 }
2510 }, { 2504 }, {
2511 .alg = "authenc(hmac(sha1),cbc(des3_ede))", 2505 .alg = "authenc(hmac(sha1),cbc(des3_ede))",
2512 .test = alg_test_aead, 2506 .test = alg_test_aead,
2513 .fips_allowed = 1, 2507 .fips_allowed = 1,
2514 .suite = { 2508 .suite = {
2515 .aead = { 2509 .aead = __VECS(hmac_sha1_des3_ede_cbc_tv_temp)
2516 .enc = __VECS(hmac_sha1_des3_ede_cbc_enc_tv_temp)
2517 }
2518 } 2510 }
2519 }, { 2511 }, {
2520 .alg = "authenc(hmac(sha1),ctr(aes))", 2512 .alg = "authenc(hmac(sha1),ctr(aes))",
@@ -2524,10 +2516,7 @@ static const struct alg_test_desc alg_test_descs[] = {
2524 .alg = "authenc(hmac(sha1),ecb(cipher_null))", 2516 .alg = "authenc(hmac(sha1),ecb(cipher_null))",
2525 .test = alg_test_aead, 2517 .test = alg_test_aead,
2526 .suite = { 2518 .suite = {
2527 .aead = { 2519 .aead = __VECS(hmac_sha1_ecb_cipher_null_tv_temp)
2528 .enc = __VECS(hmac_sha1_ecb_cipher_null_enc_tv_temp),
2529 .dec = __VECS(hmac_sha1_ecb_cipher_null_dec_tv_temp)
2530 }
2531 } 2520 }
2532 }, { 2521 }, {
2533 .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))", 2522 .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))",
@@ -2537,44 +2526,34 @@ static const struct alg_test_desc alg_test_descs[] = {
2537 .alg = "authenc(hmac(sha224),cbc(des))", 2526 .alg = "authenc(hmac(sha224),cbc(des))",
2538 .test = alg_test_aead, 2527 .test = alg_test_aead,
2539 .suite = { 2528 .suite = {
2540 .aead = { 2529 .aead = __VECS(hmac_sha224_des_cbc_tv_temp)
2541 .enc = __VECS(hmac_sha224_des_cbc_enc_tv_temp)
2542 }
2543 } 2530 }
2544 }, { 2531 }, {
2545 .alg = "authenc(hmac(sha224),cbc(des3_ede))", 2532 .alg = "authenc(hmac(sha224),cbc(des3_ede))",
2546 .test = alg_test_aead, 2533 .test = alg_test_aead,
2547 .fips_allowed = 1, 2534 .fips_allowed = 1,
2548 .suite = { 2535 .suite = {
2549 .aead = { 2536 .aead = __VECS(hmac_sha224_des3_ede_cbc_tv_temp)
2550 .enc = __VECS(hmac_sha224_des3_ede_cbc_enc_tv_temp)
2551 }
2552 } 2537 }
2553 }, { 2538 }, {
2554 .alg = "authenc(hmac(sha256),cbc(aes))", 2539 .alg = "authenc(hmac(sha256),cbc(aes))",
2555 .test = alg_test_aead, 2540 .test = alg_test_aead,
2556 .fips_allowed = 1, 2541 .fips_allowed = 1,
2557 .suite = { 2542 .suite = {
2558 .aead = { 2543 .aead = __VECS(hmac_sha256_aes_cbc_tv_temp)
2559 .enc = __VECS(hmac_sha256_aes_cbc_enc_tv_temp)
2560 }
2561 } 2544 }
2562 }, { 2545 }, {
2563 .alg = "authenc(hmac(sha256),cbc(des))", 2546 .alg = "authenc(hmac(sha256),cbc(des))",
2564 .test = alg_test_aead, 2547 .test = alg_test_aead,
2565 .suite = { 2548 .suite = {
2566 .aead = { 2549 .aead = __VECS(hmac_sha256_des_cbc_tv_temp)
2567 .enc = __VECS(hmac_sha256_des_cbc_enc_tv_temp)
2568 }
2569 } 2550 }
2570 }, { 2551 }, {
2571 .alg = "authenc(hmac(sha256),cbc(des3_ede))", 2552 .alg = "authenc(hmac(sha256),cbc(des3_ede))",
2572 .test = alg_test_aead, 2553 .test = alg_test_aead,
2573 .fips_allowed = 1, 2554 .fips_allowed = 1,
2574 .suite = { 2555 .suite = {
2575 .aead = { 2556 .aead = __VECS(hmac_sha256_des3_ede_cbc_tv_temp)
2576 .enc = __VECS(hmac_sha256_des3_ede_cbc_enc_tv_temp)
2577 }
2578 } 2557 }
2579 }, { 2558 }, {
2580 .alg = "authenc(hmac(sha256),ctr(aes))", 2559 .alg = "authenc(hmac(sha256),ctr(aes))",
@@ -2588,18 +2567,14 @@ static const struct alg_test_desc alg_test_descs[] = {
2588 .alg = "authenc(hmac(sha384),cbc(des))", 2567 .alg = "authenc(hmac(sha384),cbc(des))",
2589 .test = alg_test_aead, 2568 .test = alg_test_aead,
2590 .suite = { 2569 .suite = {
2591 .aead = { 2570 .aead = __VECS(hmac_sha384_des_cbc_tv_temp)
2592 .enc = __VECS(hmac_sha384_des_cbc_enc_tv_temp)
2593 }
2594 } 2571 }
2595 }, { 2572 }, {
2596 .alg = "authenc(hmac(sha384),cbc(des3_ede))", 2573 .alg = "authenc(hmac(sha384),cbc(des3_ede))",
2597 .test = alg_test_aead, 2574 .test = alg_test_aead,
2598 .fips_allowed = 1, 2575 .fips_allowed = 1,
2599 .suite = { 2576 .suite = {
2600 .aead = { 2577 .aead = __VECS(hmac_sha384_des3_ede_cbc_tv_temp)
2601 .enc = __VECS(hmac_sha384_des3_ede_cbc_enc_tv_temp)
2602 }
2603 } 2578 }
2604 }, { 2579 }, {
2605 .alg = "authenc(hmac(sha384),ctr(aes))", 2580 .alg = "authenc(hmac(sha384),ctr(aes))",
@@ -2614,26 +2589,20 @@ static const struct alg_test_desc alg_test_descs[] = {
2614 .fips_allowed = 1, 2589 .fips_allowed = 1,
2615 .test = alg_test_aead, 2590 .test = alg_test_aead,
2616 .suite = { 2591 .suite = {
2617 .aead = { 2592 .aead = __VECS(hmac_sha512_aes_cbc_tv_temp)
2618 .enc = __VECS(hmac_sha512_aes_cbc_enc_tv_temp)
2619 }
2620 } 2593 }
2621 }, { 2594 }, {
2622 .alg = "authenc(hmac(sha512),cbc(des))", 2595 .alg = "authenc(hmac(sha512),cbc(des))",
2623 .test = alg_test_aead, 2596 .test = alg_test_aead,
2624 .suite = { 2597 .suite = {
2625 .aead = { 2598 .aead = __VECS(hmac_sha512_des_cbc_tv_temp)
2626 .enc = __VECS(hmac_sha512_des_cbc_enc_tv_temp)
2627 }
2628 } 2599 }
2629 }, { 2600 }, {
2630 .alg = "authenc(hmac(sha512),cbc(des3_ede))", 2601 .alg = "authenc(hmac(sha512),cbc(des3_ede))",
2631 .test = alg_test_aead, 2602 .test = alg_test_aead,
2632 .fips_allowed = 1, 2603 .fips_allowed = 1,
2633 .suite = { 2604 .suite = {
2634 .aead = { 2605 .aead = __VECS(hmac_sha512_des3_ede_cbc_tv_temp)
2635 .enc = __VECS(hmac_sha512_des3_ede_cbc_enc_tv_temp)
2636 }
2637 } 2606 }
2638 }, { 2607 }, {
2639 .alg = "authenc(hmac(sha512),ctr(aes))", 2608 .alg = "authenc(hmac(sha512),ctr(aes))",
@@ -2730,10 +2699,7 @@ static const struct alg_test_desc alg_test_descs[] = {
2730 .test = alg_test_aead, 2699 .test = alg_test_aead,
2731 .fips_allowed = 1, 2700 .fips_allowed = 1,
2732 .suite = { 2701 .suite = {
2733 .aead = { 2702 .aead = __VECS(aes_ccm_tv_template)
2734 .enc = __VECS(aes_ccm_enc_tv_template),
2735 .dec = __VECS(aes_ccm_dec_tv_template)
2736 }
2737 } 2703 }
2738 }, { 2704 }, {
2739 .alg = "cfb(aes)", 2705 .alg = "cfb(aes)",
@@ -3144,10 +3110,7 @@ static const struct alg_test_desc alg_test_descs[] = {
3144 .test = alg_test_aead, 3110 .test = alg_test_aead,
3145 .fips_allowed = 1, 3111 .fips_allowed = 1,
3146 .suite = { 3112 .suite = {
3147 .aead = { 3113 .aead = __VECS(aes_gcm_tv_template)
3148 .enc = __VECS(aes_gcm_enc_tv_template),
3149 .dec = __VECS(aes_gcm_dec_tv_template)
3150 }
3151 } 3114 }
3152 }, { 3115 }, {
3153 .alg = "ghash", 3116 .alg = "ghash",
@@ -3342,19 +3305,13 @@ static const struct alg_test_desc alg_test_descs[] = {
3342 .alg = "morus1280", 3305 .alg = "morus1280",
3343 .test = alg_test_aead, 3306 .test = alg_test_aead,
3344 .suite = { 3307 .suite = {
3345 .aead = { 3308 .aead = __VECS(morus1280_tv_template)
3346 .enc = __VECS(morus1280_enc_tv_template),
3347 .dec = __VECS(morus1280_dec_tv_template),
3348 }
3349 } 3309 }
3350 }, { 3310 }, {
3351 .alg = "morus640", 3311 .alg = "morus640",
3352 .test = alg_test_aead, 3312 .test = alg_test_aead,
3353 .suite = { 3313 .suite = {
3354 .aead = { 3314 .aead = __VECS(morus640_tv_template)
3355 .enc = __VECS(morus640_enc_tv_template),
3356 .dec = __VECS(morus640_dec_tv_template),
3357 }
3358 } 3315 }
3359 }, { 3316 }, {
3360 .alg = "nhpoly1305", 3317 .alg = "nhpoly1305",
@@ -3419,47 +3376,32 @@ static const struct alg_test_desc alg_test_descs[] = {
3419 .test = alg_test_aead, 3376 .test = alg_test_aead,
3420 .fips_allowed = 1, 3377 .fips_allowed = 1,
3421 .suite = { 3378 .suite = {
3422 .aead = { 3379 .aead = __VECS(aes_gcm_rfc4106_tv_template)
3423 .enc = __VECS(aes_gcm_rfc4106_enc_tv_template),
3424 .dec = __VECS(aes_gcm_rfc4106_dec_tv_template)
3425 }
3426 } 3380 }
3427 }, { 3381 }, {
3428 .alg = "rfc4309(ccm(aes))", 3382 .alg = "rfc4309(ccm(aes))",
3429 .test = alg_test_aead, 3383 .test = alg_test_aead,
3430 .fips_allowed = 1, 3384 .fips_allowed = 1,
3431 .suite = { 3385 .suite = {
3432 .aead = { 3386 .aead = __VECS(aes_ccm_rfc4309_tv_template)
3433 .enc = __VECS(aes_ccm_rfc4309_enc_tv_template),
3434 .dec = __VECS(aes_ccm_rfc4309_dec_tv_template)
3435 }
3436 } 3387 }
3437 }, { 3388 }, {
3438 .alg = "rfc4543(gcm(aes))", 3389 .alg = "rfc4543(gcm(aes))",
3439 .test = alg_test_aead, 3390 .test = alg_test_aead,
3440 .suite = { 3391 .suite = {
3441 .aead = { 3392 .aead = __VECS(aes_gcm_rfc4543_tv_template)
3442 .enc = __VECS(aes_gcm_rfc4543_enc_tv_template),
3443 .dec = __VECS(aes_gcm_rfc4543_dec_tv_template),
3444 }
3445 } 3393 }
3446 }, { 3394 }, {
3447 .alg = "rfc7539(chacha20,poly1305)", 3395 .alg = "rfc7539(chacha20,poly1305)",
3448 .test = alg_test_aead, 3396 .test = alg_test_aead,
3449 .suite = { 3397 .suite = {
3450 .aead = { 3398 .aead = __VECS(rfc7539_tv_template)
3451 .enc = __VECS(rfc7539_enc_tv_template),
3452 .dec = __VECS(rfc7539_dec_tv_template),
3453 }
3454 } 3399 }
3455 }, { 3400 }, {
3456 .alg = "rfc7539esp(chacha20,poly1305)", 3401 .alg = "rfc7539esp(chacha20,poly1305)",
3457 .test = alg_test_aead, 3402 .test = alg_test_aead,
3458 .suite = { 3403 .suite = {
3459 .aead = { 3404 .aead = __VECS(rfc7539esp_tv_template)
3460 .enc = __VECS(rfc7539esp_enc_tv_template),
3461 .dec = __VECS(rfc7539esp_dec_tv_template),
3462 }
3463 } 3405 }
3464 }, { 3406 }, {
3465 .alg = "rmd128", 3407 .alg = "rmd128",