summaryrefslogtreecommitdiffstats
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-05-21 01:50:29 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2018-05-30 12:13:39 -0400
commit92a4c9fef34ce98eeb2eb1b8ae9aef5a2bd509c4 (patch)
tree273698a9ce7b115fdb53e56a92402333ee0126a9 /crypto/testmgr.c
parent4074a77d48f676e8ed9cd0141522c933109d4168 (diff)
crypto: testmgr - eliminate redundant decryption test vectors
Currently testmgr has separate encryption and decryption test vectors for symmetric ciphers. That's massively redundant, since with few exceptions (mostly mistakes, apparently), all decryption tests are identical to the encryption tests, just with the input/result flipped. Therefore, eliminate the redundancy by removing the decryption test vectors and updating testmgr to test both encryption and decryption using what used to be the encryption test vectors. Naming is adjusted accordingly: each cipher_testvec now has a 'ptext' (plaintext), 'ctext' (ciphertext), and 'len' instead of an 'input', 'result', 'ilen', and 'rlen'. Note that it was always the case that 'ilen == rlen'. AES keywrap ("kw(aes)") is special because its IV is generated by the encryption. Previously this was handled by specifying 'iv_out' for encryption and 'iv' for decryption. To make it work cleanly with only one set of test vectors, put the IV in 'iv', remove 'iv_out', and add a boolean that indicates that the IV is generated by the encryption. In total, this removes over 10000 lines from testmgr.h, with no reduction in test coverage since prior patches already copied the few unique decryption test vectors into the encryption test vectors. This covers all algorithms that used 'struct cipher_testvec', e.g. any block cipher in the ECB, CBC, CTR, XTS, LRW, CTS-CBC, PCBC, OFB, or keywrap modes, and Salsa20 and ChaCha20. No change is made to AEAD tests, though we probably can eliminate a similar redundancy there too. The testmgr.h portion of this patch was automatically generated using the following awk script, with some slight manual fixups on top (updated 'struct cipher_testvec' definition, updated a few comments, and fixed up the AES keywrap test vectors): BEGIN { OTHER = 0; ENCVEC = 1; DECVEC = 2; DECVEC_TAIL = 3; mode = OTHER } /^static const struct cipher_testvec.*_enc_/ { sub("_enc", ""); mode = ENCVEC } /^static const struct cipher_testvec.*_dec_/ { mode = DECVEC } mode == ENCVEC && !/\.ilen[[:space:]]*=/ { sub(/\.input[[:space:]]*=$/, ".ptext =") sub(/\.input[[:space:]]*=/, ".ptext\t=") sub(/\.result[[:space:]]*=$/, ".ctext =") sub(/\.result[[:space:]]*=/, ".ctext\t=") sub(/\.rlen[[:space:]]*=/, ".len\t=") print } mode == DECVEC_TAIL && /[^[:space:]]/ { mode = OTHER } mode == OTHER { print } mode == ENCVEC && /^};/ { mode = OTHER } mode == DECVEC && /^};/ { mode = DECVEC_TAIL } Note that git's default diff algorithm gets confused by the testmgr.h portion of this patch, and reports too many lines added and removed. It's better viewed with 'git diff --minimal' (or 'git show --minimal'), which reports "2 files changed, 919 insertions(+), 11723 deletions(-)". Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c409
1 files changed, 110 insertions, 299 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index d3335d347e10..d1d99843cce4 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -84,10 +84,8 @@ struct aead_test_suite {
84}; 84};
85 85
86struct cipher_test_suite { 86struct cipher_test_suite {
87 struct { 87 const struct cipher_testvec *vecs;
88 const struct cipher_testvec *vecs; 88 unsigned int count;
89 unsigned int count;
90 } enc, dec;
91}; 89};
92 90
93struct comp_test_suite { 91struct comp_test_suite {
@@ -988,6 +986,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
988 unsigned int i, j, k; 986 unsigned int i, j, k;
989 char *q; 987 char *q;
990 const char *e; 988 const char *e;
989 const char *input, *result;
991 void *data; 990 void *data;
992 char *xbuf[XBUFSIZE]; 991 char *xbuf[XBUFSIZE];
993 int ret = -ENOMEM; 992 int ret = -ENOMEM;
@@ -1008,14 +1007,16 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
1008 if (fips_enabled && template[i].fips_skip) 1007 if (fips_enabled && template[i].fips_skip)
1009 continue; 1008 continue;
1010 1009
1010 input = enc ? template[i].ptext : template[i].ctext;
1011 result = enc ? template[i].ctext : template[i].ptext;
1011 j++; 1012 j++;
1012 1013
1013 ret = -EINVAL; 1014 ret = -EINVAL;
1014 if (WARN_ON(template[i].ilen > PAGE_SIZE)) 1015 if (WARN_ON(template[i].len > PAGE_SIZE))
1015 goto out; 1016 goto out;
1016 1017
1017 data = xbuf[0]; 1018 data = xbuf[0];
1018 memcpy(data, template[i].input, template[i].ilen); 1019 memcpy(data, input, template[i].len);
1019 1020
1020 crypto_cipher_clear_flags(tfm, ~0); 1021 crypto_cipher_clear_flags(tfm, ~0);
1021 if (template[i].wk) 1022 if (template[i].wk)
@@ -1031,7 +1032,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
1031 } else if (ret) 1032 } else if (ret)
1032 continue; 1033 continue;
1033 1034
1034 for (k = 0; k < template[i].ilen; 1035 for (k = 0; k < template[i].len;
1035 k += crypto_cipher_blocksize(tfm)) { 1036 k += crypto_cipher_blocksize(tfm)) {
1036 if (enc) 1037 if (enc)
1037 crypto_cipher_encrypt_one(tfm, data + k, 1038 crypto_cipher_encrypt_one(tfm, data + k,
@@ -1042,10 +1043,10 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
1042 } 1043 }
1043 1044
1044 q = data; 1045 q = data;
1045 if (memcmp(q, template[i].result, template[i].rlen)) { 1046 if (memcmp(q, result, template[i].len)) {
1046 printk(KERN_ERR "alg: cipher: Test %d failed " 1047 printk(KERN_ERR "alg: cipher: Test %d failed "
1047 "on %s for %s\n", j, e, algo); 1048 "on %s for %s\n", j, e, algo);
1048 hexdump(q, template[i].rlen); 1049 hexdump(q, template[i].len);
1049 ret = -EINVAL; 1050 ret = -EINVAL;
1050 goto out; 1051 goto out;
1051 } 1052 }
@@ -1073,6 +1074,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1073 struct scatterlist sgout[8]; 1074 struct scatterlist sgout[8];
1074 const char *e, *d; 1075 const char *e, *d;
1075 struct crypto_wait wait; 1076 struct crypto_wait wait;
1077 const char *input, *result;
1076 void *data; 1078 void *data;
1077 char iv[MAX_IVLEN]; 1079 char iv[MAX_IVLEN];
1078 char *xbuf[XBUFSIZE]; 1080 char *xbuf[XBUFSIZE];
@@ -1116,19 +1118,21 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1116 if (fips_enabled && template[i].fips_skip) 1118 if (fips_enabled && template[i].fips_skip)
1117 continue; 1119 continue;
1118 1120
1119 if (template[i].iv) 1121 if (template[i].iv && !(template[i].generates_iv && enc))
1120 memcpy(iv, template[i].iv, ivsize); 1122 memcpy(iv, template[i].iv, ivsize);
1121 else 1123 else
1122 memset(iv, 0, MAX_IVLEN); 1124 memset(iv, 0, MAX_IVLEN);
1123 1125
1126 input = enc ? template[i].ptext : template[i].ctext;
1127 result = enc ? template[i].ctext : template[i].ptext;
1124 j++; 1128 j++;
1125 ret = -EINVAL; 1129 ret = -EINVAL;
1126 if (WARN_ON(align_offset + template[i].ilen > PAGE_SIZE)) 1130 if (WARN_ON(align_offset + template[i].len > PAGE_SIZE))
1127 goto out; 1131 goto out;
1128 1132
1129 data = xbuf[0]; 1133 data = xbuf[0];
1130 data += align_offset; 1134 data += align_offset;
1131 memcpy(data, template[i].input, template[i].ilen); 1135 memcpy(data, input, template[i].len);
1132 1136
1133 crypto_skcipher_clear_flags(tfm, ~0); 1137 crypto_skcipher_clear_flags(tfm, ~0);
1134 if (template[i].wk) 1138 if (template[i].wk)
@@ -1144,15 +1148,15 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1144 } else if (ret) 1148 } else if (ret)
1145 continue; 1149 continue;
1146 1150
1147 sg_init_one(&sg[0], data, template[i].ilen); 1151 sg_init_one(&sg[0], data, template[i].len);
1148 if (diff_dst) { 1152 if (diff_dst) {
1149 data = xoutbuf[0]; 1153 data = xoutbuf[0];
1150 data += align_offset; 1154 data += align_offset;
1151 sg_init_one(&sgout[0], data, template[i].ilen); 1155 sg_init_one(&sgout[0], data, template[i].len);
1152 } 1156 }
1153 1157
1154 skcipher_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, 1158 skcipher_request_set_crypt(req, sg, (diff_dst) ? sgout : sg,
1155 template[i].ilen, iv); 1159 template[i].len, iv);
1156 ret = crypto_wait_req(enc ? crypto_skcipher_encrypt(req) : 1160 ret = crypto_wait_req(enc ? crypto_skcipher_encrypt(req) :
1157 crypto_skcipher_decrypt(req), &wait); 1161 crypto_skcipher_decrypt(req), &wait);
1158 1162
@@ -1163,17 +1167,16 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1163 } 1167 }
1164 1168
1165 q = data; 1169 q = data;
1166 if (memcmp(q, template[i].result, template[i].rlen)) { 1170 if (memcmp(q, result, template[i].len)) {
1167 pr_err("alg: skcipher%s: Test %d failed (invalid result) on %s for %s\n", 1171 pr_err("alg: skcipher%s: Test %d failed (invalid result) on %s for %s\n",
1168 d, j, e, algo); 1172 d, j, e, algo);
1169 hexdump(q, template[i].rlen); 1173 hexdump(q, template[i].len);
1170 ret = -EINVAL; 1174 ret = -EINVAL;
1171 goto out; 1175 goto out;
1172 } 1176 }
1173 1177
1174 if (template[i].iv_out && 1178 if (template[i].generates_iv && enc &&
1175 memcmp(iv, template[i].iv_out, 1179 memcmp(iv, template[i].iv, crypto_skcipher_ivsize(tfm))) {
1176 crypto_skcipher_ivsize(tfm))) {
1177 pr_err("alg: skcipher%s: Test %d failed (invalid output IV) on %s for %s\n", 1180 pr_err("alg: skcipher%s: Test %d failed (invalid output IV) on %s for %s\n",
1178 d, j, e, algo); 1181 d, j, e, algo);
1179 hexdump(iv, crypto_skcipher_ivsize(tfm)); 1182 hexdump(iv, crypto_skcipher_ivsize(tfm));
@@ -1194,11 +1197,13 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1194 if (fips_enabled && template[i].fips_skip) 1197 if (fips_enabled && template[i].fips_skip)
1195 continue; 1198 continue;
1196 1199
1197 if (template[i].iv) 1200 if (template[i].iv && !(template[i].generates_iv && enc))
1198 memcpy(iv, template[i].iv, ivsize); 1201 memcpy(iv, template[i].iv, ivsize);
1199 else 1202 else
1200 memset(iv, 0, MAX_IVLEN); 1203 memset(iv, 0, MAX_IVLEN);
1201 1204
1205 input = enc ? template[i].ptext : template[i].ctext;
1206 result = enc ? template[i].ctext : template[i].ptext;
1202 j++; 1207 j++;
1203 crypto_skcipher_clear_flags(tfm, ~0); 1208 crypto_skcipher_clear_flags(tfm, ~0);
1204 if (template[i].wk) 1209 if (template[i].wk)
@@ -1226,7 +1231,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1226 1231
1227 q = xbuf[IDX[k] >> PAGE_SHIFT] + offset_in_page(IDX[k]); 1232 q = xbuf[IDX[k] >> PAGE_SHIFT] + offset_in_page(IDX[k]);
1228 1233
1229 memcpy(q, template[i].input + temp, template[i].tap[k]); 1234 memcpy(q, input + temp, template[i].tap[k]);
1230 1235
1231 if (offset_in_page(q) + template[i].tap[k] < PAGE_SIZE) 1236 if (offset_in_page(q) + template[i].tap[k] < PAGE_SIZE)
1232 q[template[i].tap[k]] = 0; 1237 q[template[i].tap[k]] = 0;
@@ -1248,7 +1253,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1248 } 1253 }
1249 1254
1250 skcipher_request_set_crypt(req, sg, (diff_dst) ? sgout : sg, 1255 skcipher_request_set_crypt(req, sg, (diff_dst) ? sgout : sg,
1251 template[i].ilen, iv); 1256 template[i].len, iv);
1252 1257
1253 ret = crypto_wait_req(enc ? crypto_skcipher_encrypt(req) : 1258 ret = crypto_wait_req(enc ? crypto_skcipher_encrypt(req) :
1254 crypto_skcipher_decrypt(req), &wait); 1259 crypto_skcipher_decrypt(req), &wait);
@@ -1269,8 +1274,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
1269 q = xbuf[IDX[k] >> PAGE_SHIFT] + 1274 q = xbuf[IDX[k] >> PAGE_SHIFT] +
1270 offset_in_page(IDX[k]); 1275 offset_in_page(IDX[k]);
1271 1276
1272 if (memcmp(q, template[i].result + temp, 1277 if (memcmp(q, result + temp, template[i].tap[k])) {
1273 template[i].tap[k])) {
1274 pr_err("alg: skcipher%s: Chunk test %d failed on %s at page %u for %s\n", 1278 pr_err("alg: skcipher%s: Chunk test %d failed on %s at page %u for %s\n",
1275 d, j, e, k, algo); 1279 d, j, e, k, algo);
1276 hexdump(q, template[i].tap[k]); 1280 hexdump(q, template[i].tap[k]);
@@ -1705,8 +1709,9 @@ out:
1705static int alg_test_cipher(const struct alg_test_desc *desc, 1709static int alg_test_cipher(const struct alg_test_desc *desc,
1706 const char *driver, u32 type, u32 mask) 1710 const char *driver, u32 type, u32 mask)
1707{ 1711{
1712 const struct cipher_test_suite *suite = &desc->suite.cipher;
1708 struct crypto_cipher *tfm; 1713 struct crypto_cipher *tfm;
1709 int err = 0; 1714 int err;
1710 1715
1711 tfm = crypto_alloc_cipher(driver, type, mask); 1716 tfm = crypto_alloc_cipher(driver, type, mask);
1712 if (IS_ERR(tfm)) { 1717 if (IS_ERR(tfm)) {
@@ -1715,18 +1720,10 @@ static int alg_test_cipher(const struct alg_test_desc *desc,
1715 return PTR_ERR(tfm); 1720 return PTR_ERR(tfm);
1716 } 1721 }
1717 1722
1718 if (desc->suite.cipher.enc.vecs) { 1723 err = test_cipher(tfm, ENCRYPT, suite->vecs, suite->count);
1719 err = test_cipher(tfm, ENCRYPT, desc->suite.cipher.enc.vecs, 1724 if (!err)
1720 desc->suite.cipher.enc.count); 1725 err = test_cipher(tfm, DECRYPT, suite->vecs, suite->count);
1721 if (err)
1722 goto out;
1723 }
1724
1725 if (desc->suite.cipher.dec.vecs)
1726 err = test_cipher(tfm, DECRYPT, desc->suite.cipher.dec.vecs,
1727 desc->suite.cipher.dec.count);
1728 1726
1729out:
1730 crypto_free_cipher(tfm); 1727 crypto_free_cipher(tfm);
1731 return err; 1728 return err;
1732} 1729}
@@ -1734,8 +1731,9 @@ out:
1734static int alg_test_skcipher(const struct alg_test_desc *desc, 1731static int alg_test_skcipher(const struct alg_test_desc *desc,
1735 const char *driver, u32 type, u32 mask) 1732 const char *driver, u32 type, u32 mask)
1736{ 1733{
1734 const struct cipher_test_suite *suite = &desc->suite.cipher;
1737 struct crypto_skcipher *tfm; 1735 struct crypto_skcipher *tfm;
1738 int err = 0; 1736 int err;
1739 1737
1740 tfm = crypto_alloc_skcipher(driver, type, mask); 1738 tfm = crypto_alloc_skcipher(driver, type, mask);
1741 if (IS_ERR(tfm)) { 1739 if (IS_ERR(tfm)) {
@@ -1744,18 +1742,10 @@ static int alg_test_skcipher(const struct alg_test_desc *desc,
1744 return PTR_ERR(tfm); 1742 return PTR_ERR(tfm);
1745 } 1743 }
1746 1744
1747 if (desc->suite.cipher.enc.vecs) { 1745 err = test_skcipher(tfm, ENCRYPT, suite->vecs, suite->count);
1748 err = test_skcipher(tfm, ENCRYPT, desc->suite.cipher.enc.vecs, 1746 if (!err)
1749 desc->suite.cipher.enc.count); 1747 err = test_skcipher(tfm, DECRYPT, suite->vecs, suite->count);
1750 if (err)
1751 goto out;
1752 }
1753
1754 if (desc->suite.cipher.dec.vecs)
1755 err = test_skcipher(tfm, DECRYPT, desc->suite.cipher.dec.vecs,
1756 desc->suite.cipher.dec.count);
1757 1748
1758out:
1759 crypto_free_skcipher(tfm); 1749 crypto_free_skcipher(tfm);
1760 return err; 1750 return err;
1761} 1751}
@@ -2575,75 +2565,51 @@ static const struct alg_test_desc alg_test_descs[] = {
2575 .test = alg_test_skcipher, 2565 .test = alg_test_skcipher,
2576 .fips_allowed = 1, 2566 .fips_allowed = 1,
2577 .suite = { 2567 .suite = {
2578 .cipher = { 2568 .cipher = __VECS(aes_cbc_tv_template)
2579 .enc = __VECS(aes_cbc_enc_tv_template), 2569 },
2580 .dec = __VECS(aes_cbc_dec_tv_template)
2581 }
2582 }
2583 }, { 2570 }, {
2584 .alg = "cbc(anubis)", 2571 .alg = "cbc(anubis)",
2585 .test = alg_test_skcipher, 2572 .test = alg_test_skcipher,
2586 .suite = { 2573 .suite = {
2587 .cipher = { 2574 .cipher = __VECS(anubis_cbc_tv_template)
2588 .enc = __VECS(anubis_cbc_enc_tv_template), 2575 },
2589 .dec = __VECS(anubis_cbc_dec_tv_template)
2590 }
2591 }
2592 }, { 2576 }, {
2593 .alg = "cbc(blowfish)", 2577 .alg = "cbc(blowfish)",
2594 .test = alg_test_skcipher, 2578 .test = alg_test_skcipher,
2595 .suite = { 2579 .suite = {
2596 .cipher = { 2580 .cipher = __VECS(bf_cbc_tv_template)
2597 .enc = __VECS(bf_cbc_enc_tv_template), 2581 },
2598 .dec = __VECS(bf_cbc_dec_tv_template)
2599 }
2600 }
2601 }, { 2582 }, {
2602 .alg = "cbc(camellia)", 2583 .alg = "cbc(camellia)",
2603 .test = alg_test_skcipher, 2584 .test = alg_test_skcipher,
2604 .suite = { 2585 .suite = {
2605 .cipher = { 2586 .cipher = __VECS(camellia_cbc_tv_template)
2606 .enc = __VECS(camellia_cbc_enc_tv_template), 2587 },
2607 .dec = __VECS(camellia_cbc_dec_tv_template)
2608 }
2609 }
2610 }, { 2588 }, {
2611 .alg = "cbc(cast5)", 2589 .alg = "cbc(cast5)",
2612 .test = alg_test_skcipher, 2590 .test = alg_test_skcipher,
2613 .suite = { 2591 .suite = {
2614 .cipher = { 2592 .cipher = __VECS(cast5_cbc_tv_template)
2615 .enc = __VECS(cast5_cbc_enc_tv_template), 2593 },
2616 .dec = __VECS(cast5_cbc_dec_tv_template)
2617 }
2618 }
2619 }, { 2594 }, {
2620 .alg = "cbc(cast6)", 2595 .alg = "cbc(cast6)",
2621 .test = alg_test_skcipher, 2596 .test = alg_test_skcipher,
2622 .suite = { 2597 .suite = {
2623 .cipher = { 2598 .cipher = __VECS(cast6_cbc_tv_template)
2624 .enc = __VECS(cast6_cbc_enc_tv_template), 2599 },
2625 .dec = __VECS(cast6_cbc_dec_tv_template)
2626 }
2627 }
2628 }, { 2600 }, {
2629 .alg = "cbc(des)", 2601 .alg = "cbc(des)",
2630 .test = alg_test_skcipher, 2602 .test = alg_test_skcipher,
2631 .suite = { 2603 .suite = {
2632 .cipher = { 2604 .cipher = __VECS(des_cbc_tv_template)
2633 .enc = __VECS(des_cbc_enc_tv_template), 2605 },
2634 .dec = __VECS(des_cbc_dec_tv_template)
2635 }
2636 }
2637 }, { 2606 }, {
2638 .alg = "cbc(des3_ede)", 2607 .alg = "cbc(des3_ede)",
2639 .test = alg_test_skcipher, 2608 .test = alg_test_skcipher,
2640 .fips_allowed = 1, 2609 .fips_allowed = 1,
2641 .suite = { 2610 .suite = {
2642 .cipher = { 2611 .cipher = __VECS(des3_ede_cbc_tv_template)
2643 .enc = __VECS(des3_ede_cbc_enc_tv_template), 2612 },
2644 .dec = __VECS(des3_ede_cbc_dec_tv_template)
2645 }
2646 }
2647 }, { 2613 }, {
2648 /* Same as cbc(aes) except the key is stored in 2614 /* Same as cbc(aes) except the key is stored in
2649 * hardware secure memory which we reference by index 2615 * hardware secure memory which we reference by index
@@ -2655,20 +2621,14 @@ static const struct alg_test_desc alg_test_descs[] = {
2655 .alg = "cbc(serpent)", 2621 .alg = "cbc(serpent)",
2656 .test = alg_test_skcipher, 2622 .test = alg_test_skcipher,
2657 .suite = { 2623 .suite = {
2658 .cipher = { 2624 .cipher = __VECS(serpent_cbc_tv_template)
2659 .enc = __VECS(serpent_cbc_enc_tv_template), 2625 },
2660 .dec = __VECS(serpent_cbc_dec_tv_template)
2661 }
2662 }
2663 }, { 2626 }, {
2664 .alg = "cbc(twofish)", 2627 .alg = "cbc(twofish)",
2665 .test = alg_test_skcipher, 2628 .test = alg_test_skcipher,
2666 .suite = { 2629 .suite = {
2667 .cipher = { 2630 .cipher = __VECS(tf_cbc_tv_template)
2668 .enc = __VECS(tf_cbc_enc_tv_template), 2631 },
2669 .dec = __VECS(tf_cbc_dec_tv_template)
2670 }
2671 }
2672 }, { 2632 }, {
2673 .alg = "cbcmac(aes)", 2633 .alg = "cbcmac(aes)",
2674 .fips_allowed = 1, 2634 .fips_allowed = 1,
@@ -2690,11 +2650,8 @@ static const struct alg_test_desc alg_test_descs[] = {
2690 .alg = "chacha20", 2650 .alg = "chacha20",
2691 .test = alg_test_skcipher, 2651 .test = alg_test_skcipher,
2692 .suite = { 2652 .suite = {
2693 .cipher = { 2653 .cipher = __VECS(chacha20_tv_template)
2694 .enc = __VECS(chacha20_enc_tv_template), 2654 },
2695 .dec = __VECS(chacha20_enc_tv_template),
2696 }
2697 }
2698 }, { 2655 }, {
2699 .alg = "cmac(aes)", 2656 .alg = "cmac(aes)",
2700 .fips_allowed = 1, 2657 .fips_allowed = 1,
@@ -2737,65 +2694,44 @@ static const struct alg_test_desc alg_test_descs[] = {
2737 .test = alg_test_skcipher, 2694 .test = alg_test_skcipher,
2738 .fips_allowed = 1, 2695 .fips_allowed = 1,
2739 .suite = { 2696 .suite = {
2740 .cipher = { 2697 .cipher = __VECS(aes_ctr_tv_template)
2741 .enc = __VECS(aes_ctr_enc_tv_template),
2742 .dec = __VECS(aes_ctr_dec_tv_template)
2743 }
2744 } 2698 }
2745 }, { 2699 }, {
2746 .alg = "ctr(blowfish)", 2700 .alg = "ctr(blowfish)",
2747 .test = alg_test_skcipher, 2701 .test = alg_test_skcipher,
2748 .suite = { 2702 .suite = {
2749 .cipher = { 2703 .cipher = __VECS(bf_ctr_tv_template)
2750 .enc = __VECS(bf_ctr_enc_tv_template),
2751 .dec = __VECS(bf_ctr_dec_tv_template)
2752 }
2753 } 2704 }
2754 }, { 2705 }, {
2755 .alg = "ctr(camellia)", 2706 .alg = "ctr(camellia)",
2756 .test = alg_test_skcipher, 2707 .test = alg_test_skcipher,
2757 .suite = { 2708 .suite = {
2758 .cipher = { 2709 .cipher = __VECS(camellia_ctr_tv_template)
2759 .enc = __VECS(camellia_ctr_enc_tv_template),
2760 .dec = __VECS(camellia_ctr_dec_tv_template)
2761 }
2762 } 2710 }
2763 }, { 2711 }, {
2764 .alg = "ctr(cast5)", 2712 .alg = "ctr(cast5)",
2765 .test = alg_test_skcipher, 2713 .test = alg_test_skcipher,
2766 .suite = { 2714 .suite = {
2767 .cipher = { 2715 .cipher = __VECS(cast5_ctr_tv_template)
2768 .enc = __VECS(cast5_ctr_enc_tv_template),
2769 .dec = __VECS(cast5_ctr_dec_tv_template)
2770 }
2771 } 2716 }
2772 }, { 2717 }, {
2773 .alg = "ctr(cast6)", 2718 .alg = "ctr(cast6)",
2774 .test = alg_test_skcipher, 2719 .test = alg_test_skcipher,
2775 .suite = { 2720 .suite = {
2776 .cipher = { 2721 .cipher = __VECS(cast6_ctr_tv_template)
2777 .enc = __VECS(cast6_ctr_enc_tv_template),
2778 .dec = __VECS(cast6_ctr_dec_tv_template)
2779 }
2780 } 2722 }
2781 }, { 2723 }, {
2782 .alg = "ctr(des)", 2724 .alg = "ctr(des)",
2783 .test = alg_test_skcipher, 2725 .test = alg_test_skcipher,
2784 .suite = { 2726 .suite = {
2785 .cipher = { 2727 .cipher = __VECS(des_ctr_tv_template)
2786 .enc = __VECS(des_ctr_enc_tv_template),
2787 .dec = __VECS(des_ctr_dec_tv_template)
2788 }
2789 } 2728 }
2790 }, { 2729 }, {
2791 .alg = "ctr(des3_ede)", 2730 .alg = "ctr(des3_ede)",
2792 .test = alg_test_skcipher, 2731 .test = alg_test_skcipher,
2793 .fips_allowed = 1, 2732 .fips_allowed = 1,
2794 .suite = { 2733 .suite = {
2795 .cipher = { 2734 .cipher = __VECS(des3_ede_ctr_tv_template)
2796 .enc = __VECS(des3_ede_ctr_enc_tv_template),
2797 .dec = __VECS(des3_ede_ctr_dec_tv_template)
2798 }
2799 } 2735 }
2800 }, { 2736 }, {
2801 /* Same as ctr(aes) except the key is stored in 2737 /* Same as ctr(aes) except the key is stored in
@@ -2808,28 +2744,19 @@ static const struct alg_test_desc alg_test_descs[] = {
2808 .alg = "ctr(serpent)", 2744 .alg = "ctr(serpent)",
2809 .test = alg_test_skcipher, 2745 .test = alg_test_skcipher,
2810 .suite = { 2746 .suite = {
2811 .cipher = { 2747 .cipher = __VECS(serpent_ctr_tv_template)
2812 .enc = __VECS(serpent_ctr_enc_tv_template),
2813 .dec = __VECS(serpent_ctr_dec_tv_template)
2814 }
2815 } 2748 }
2816 }, { 2749 }, {
2817 .alg = "ctr(twofish)", 2750 .alg = "ctr(twofish)",
2818 .test = alg_test_skcipher, 2751 .test = alg_test_skcipher,
2819 .suite = { 2752 .suite = {
2820 .cipher = { 2753 .cipher = __VECS(tf_ctr_tv_template)
2821 .enc = __VECS(tf_ctr_enc_tv_template),
2822 .dec = __VECS(tf_ctr_dec_tv_template)
2823 }
2824 } 2754 }
2825 }, { 2755 }, {
2826 .alg = "cts(cbc(aes))", 2756 .alg = "cts(cbc(aes))",
2827 .test = alg_test_skcipher, 2757 .test = alg_test_skcipher,
2828 .suite = { 2758 .suite = {
2829 .cipher = { 2759 .cipher = __VECS(cts_mode_tv_template)
2830 .enc = __VECS(cts_mode_enc_tv_template),
2831 .dec = __VECS(cts_mode_dec_tv_template)
2832 }
2833 } 2760 }
2834 }, { 2761 }, {
2835 .alg = "deflate", 2762 .alg = "deflate",
@@ -2977,64 +2904,43 @@ static const struct alg_test_desc alg_test_descs[] = {
2977 .test = alg_test_skcipher, 2904 .test = alg_test_skcipher,
2978 .fips_allowed = 1, 2905 .fips_allowed = 1,
2979 .suite = { 2906 .suite = {
2980 .cipher = { 2907 .cipher = __VECS(aes_tv_template)
2981 .enc = __VECS(aes_enc_tv_template),
2982 .dec = __VECS(aes_dec_tv_template)
2983 }
2984 } 2908 }
2985 }, { 2909 }, {
2986 .alg = "ecb(anubis)", 2910 .alg = "ecb(anubis)",
2987 .test = alg_test_skcipher, 2911 .test = alg_test_skcipher,
2988 .suite = { 2912 .suite = {
2989 .cipher = { 2913 .cipher = __VECS(anubis_tv_template)
2990 .enc = __VECS(anubis_enc_tv_template),
2991 .dec = __VECS(anubis_dec_tv_template)
2992 }
2993 } 2914 }
2994 }, { 2915 }, {
2995 .alg = "ecb(arc4)", 2916 .alg = "ecb(arc4)",
2996 .test = alg_test_skcipher, 2917 .test = alg_test_skcipher,
2997 .suite = { 2918 .suite = {
2998 .cipher = { 2919 .cipher = __VECS(arc4_tv_template)
2999 .enc = __VECS(arc4_enc_tv_template),
3000 .dec = __VECS(arc4_dec_tv_template)
3001 }
3002 } 2920 }
3003 }, { 2921 }, {
3004 .alg = "ecb(blowfish)", 2922 .alg = "ecb(blowfish)",
3005 .test = alg_test_skcipher, 2923 .test = alg_test_skcipher,
3006 .suite = { 2924 .suite = {
3007 .cipher = { 2925 .cipher = __VECS(bf_tv_template)
3008 .enc = __VECS(bf_enc_tv_template),
3009 .dec = __VECS(bf_dec_tv_template)
3010 }
3011 } 2926 }
3012 }, { 2927 }, {
3013 .alg = "ecb(camellia)", 2928 .alg = "ecb(camellia)",
3014 .test = alg_test_skcipher, 2929 .test = alg_test_skcipher,
3015 .suite = { 2930 .suite = {
3016 .cipher = { 2931 .cipher = __VECS(camellia_tv_template)
3017 .enc = __VECS(camellia_enc_tv_template),
3018 .dec = __VECS(camellia_dec_tv_template)
3019 }
3020 } 2932 }
3021 }, { 2933 }, {
3022 .alg = "ecb(cast5)", 2934 .alg = "ecb(cast5)",
3023 .test = alg_test_skcipher, 2935 .test = alg_test_skcipher,
3024 .suite = { 2936 .suite = {
3025 .cipher = { 2937 .cipher = __VECS(cast5_tv_template)
3026 .enc = __VECS(cast5_enc_tv_template),
3027 .dec = __VECS(cast5_dec_tv_template)
3028 }
3029 } 2938 }
3030 }, { 2939 }, {
3031 .alg = "ecb(cast6)", 2940 .alg = "ecb(cast6)",
3032 .test = alg_test_skcipher, 2941 .test = alg_test_skcipher,
3033 .suite = { 2942 .suite = {
3034 .cipher = { 2943 .cipher = __VECS(cast6_tv_template)
3035 .enc = __VECS(cast6_enc_tv_template),
3036 .dec = __VECS(cast6_dec_tv_template)
3037 }
3038 } 2944 }
3039 }, { 2945 }, {
3040 .alg = "ecb(cipher_null)", 2946 .alg = "ecb(cipher_null)",
@@ -3044,44 +2950,29 @@ static const struct alg_test_desc alg_test_descs[] = {
3044 .alg = "ecb(des)", 2950 .alg = "ecb(des)",
3045 .test = alg_test_skcipher, 2951 .test = alg_test_skcipher,
3046 .suite = { 2952 .suite = {
3047 .cipher = { 2953 .cipher = __VECS(des_tv_template)
3048 .enc = __VECS(des_enc_tv_template),
3049 .dec = __VECS(des_dec_tv_template)
3050 }
3051 } 2954 }
3052 }, { 2955 }, {
3053 .alg = "ecb(des3_ede)", 2956 .alg = "ecb(des3_ede)",
3054 .test = alg_test_skcipher, 2957 .test = alg_test_skcipher,
3055 .fips_allowed = 1, 2958 .fips_allowed = 1,
3056 .suite = { 2959 .suite = {
3057 .cipher = { 2960 .cipher = __VECS(des3_ede_tv_template)
3058 .enc = __VECS(des3_ede_enc_tv_template),
3059 .dec = __VECS(des3_ede_dec_tv_template)
3060 }
3061 } 2961 }
3062 }, { 2962 }, {
3063 .alg = "ecb(fcrypt)", 2963 .alg = "ecb(fcrypt)",
3064 .test = alg_test_skcipher, 2964 .test = alg_test_skcipher,
3065 .suite = { 2965 .suite = {
3066 .cipher = { 2966 .cipher = {
3067 .enc = { 2967 .vecs = fcrypt_pcbc_tv_template,
3068 .vecs = fcrypt_pcbc_enc_tv_template, 2968 .count = 1
3069 .count = 1
3070 },
3071 .dec = {
3072 .vecs = fcrypt_pcbc_dec_tv_template,
3073 .count = 1
3074 }
3075 } 2969 }
3076 } 2970 }
3077 }, { 2971 }, {
3078 .alg = "ecb(khazad)", 2972 .alg = "ecb(khazad)",
3079 .test = alg_test_skcipher, 2973 .test = alg_test_skcipher,
3080 .suite = { 2974 .suite = {
3081 .cipher = { 2975 .cipher = __VECS(khazad_tv_template)
3082 .enc = __VECS(khazad_enc_tv_template),
3083 .dec = __VECS(khazad_dec_tv_template)
3084 }
3085 } 2976 }
3086 }, { 2977 }, {
3087 /* Same as ecb(aes) except the key is stored in 2978 /* Same as ecb(aes) except the key is stored in
@@ -3094,91 +2985,61 @@ static const struct alg_test_desc alg_test_descs[] = {
3094 .alg = "ecb(seed)", 2985 .alg = "ecb(seed)",
3095 .test = alg_test_skcipher, 2986 .test = alg_test_skcipher,
3096 .suite = { 2987 .suite = {
3097 .cipher = { 2988 .cipher = __VECS(seed_tv_template)
3098 .enc = __VECS(seed_enc_tv_template),
3099 .dec = __VECS(seed_dec_tv_template)
3100 }
3101 } 2989 }
3102 }, { 2990 }, {
3103 .alg = "ecb(serpent)", 2991 .alg = "ecb(serpent)",
3104 .test = alg_test_skcipher, 2992 .test = alg_test_skcipher,
3105 .suite = { 2993 .suite = {
3106 .cipher = { 2994 .cipher = __VECS(serpent_tv_template)
3107 .enc = __VECS(serpent_enc_tv_template),
3108 .dec = __VECS(serpent_dec_tv_template)
3109 }
3110 } 2995 }
3111 }, { 2996 }, {
3112 .alg = "ecb(sm4)", 2997 .alg = "ecb(sm4)",
3113 .test = alg_test_skcipher, 2998 .test = alg_test_skcipher,
3114 .suite = { 2999 .suite = {
3115 .cipher = { 3000 .cipher = __VECS(sm4_tv_template)
3116 .enc = __VECS(sm4_enc_tv_template),
3117 .dec = __VECS(sm4_dec_tv_template)
3118 }
3119 } 3001 }
3120 }, { 3002 }, {
3121 .alg = "ecb(speck128)", 3003 .alg = "ecb(speck128)",
3122 .test = alg_test_skcipher, 3004 .test = alg_test_skcipher,
3123 .suite = { 3005 .suite = {
3124 .cipher = { 3006 .cipher = __VECS(speck128_tv_template)
3125 .enc = __VECS(speck128_enc_tv_template),
3126 .dec = __VECS(speck128_dec_tv_template)
3127 }
3128 } 3007 }
3129 }, { 3008 }, {
3130 .alg = "ecb(speck64)", 3009 .alg = "ecb(speck64)",
3131 .test = alg_test_skcipher, 3010 .test = alg_test_skcipher,
3132 .suite = { 3011 .suite = {
3133 .cipher = { 3012 .cipher = __VECS(speck64_tv_template)
3134 .enc = __VECS(speck64_enc_tv_template),
3135 .dec = __VECS(speck64_dec_tv_template)
3136 }
3137 } 3013 }
3138 }, { 3014 }, {
3139 .alg = "ecb(tea)", 3015 .alg = "ecb(tea)",
3140 .test = alg_test_skcipher, 3016 .test = alg_test_skcipher,
3141 .suite = { 3017 .suite = {
3142 .cipher = { 3018 .cipher = __VECS(tea_tv_template)
3143 .enc = __VECS(tea_enc_tv_template),
3144 .dec = __VECS(tea_dec_tv_template)
3145 }
3146 } 3019 }
3147 }, { 3020 }, {
3148 .alg = "ecb(tnepres)", 3021 .alg = "ecb(tnepres)",
3149 .test = alg_test_skcipher, 3022 .test = alg_test_skcipher,
3150 .suite = { 3023 .suite = {
3151 .cipher = { 3024 .cipher = __VECS(tnepres_tv_template)
3152 .enc = __VECS(tnepres_enc_tv_template),
3153 .dec = __VECS(tnepres_dec_tv_template)
3154 }
3155 } 3025 }
3156 }, { 3026 }, {
3157 .alg = "ecb(twofish)", 3027 .alg = "ecb(twofish)",
3158 .test = alg_test_skcipher, 3028 .test = alg_test_skcipher,
3159 .suite = { 3029 .suite = {
3160 .cipher = { 3030 .cipher = __VECS(tf_tv_template)
3161 .enc = __VECS(tf_enc_tv_template),
3162 .dec = __VECS(tf_dec_tv_template)
3163 }
3164 } 3031 }
3165 }, { 3032 }, {
3166 .alg = "ecb(xeta)", 3033 .alg = "ecb(xeta)",
3167 .test = alg_test_skcipher, 3034 .test = alg_test_skcipher,
3168 .suite = { 3035 .suite = {
3169 .cipher = { 3036 .cipher = __VECS(xeta_tv_template)
3170 .enc = __VECS(xeta_enc_tv_template),
3171 .dec = __VECS(xeta_dec_tv_template)
3172 }
3173 } 3037 }
3174 }, { 3038 }, {
3175 .alg = "ecb(xtea)", 3039 .alg = "ecb(xtea)",
3176 .test = alg_test_skcipher, 3040 .test = alg_test_skcipher,
3177 .suite = { 3041 .suite = {
3178 .cipher = { 3042 .cipher = __VECS(xtea_tv_template)
3179 .enc = __VECS(xtea_enc_tv_template),
3180 .dec = __VECS(xtea_dec_tv_template)
3181 }
3182 } 3043 }
3183 }, { 3044 }, {
3184 .alg = "ecdh", 3045 .alg = "ecdh",
@@ -3294,55 +3155,37 @@ static const struct alg_test_desc alg_test_descs[] = {
3294 .test = alg_test_skcipher, 3155 .test = alg_test_skcipher,
3295 .fips_allowed = 1, 3156 .fips_allowed = 1,
3296 .suite = { 3157 .suite = {
3297 .cipher = { 3158 .cipher = __VECS(aes_kw_tv_template)
3298 .enc = __VECS(aes_kw_enc_tv_template),
3299 .dec = __VECS(aes_kw_dec_tv_template)
3300 }
3301 } 3159 }
3302 }, { 3160 }, {
3303 .alg = "lrw(aes)", 3161 .alg = "lrw(aes)",
3304 .test = alg_test_skcipher, 3162 .test = alg_test_skcipher,
3305 .suite = { 3163 .suite = {
3306 .cipher = { 3164 .cipher = __VECS(aes_lrw_tv_template)
3307 .enc = __VECS(aes_lrw_enc_tv_template),
3308 .dec = __VECS(aes_lrw_dec_tv_template)
3309 }
3310 } 3165 }
3311 }, { 3166 }, {
3312 .alg = "lrw(camellia)", 3167 .alg = "lrw(camellia)",
3313 .test = alg_test_skcipher, 3168 .test = alg_test_skcipher,
3314 .suite = { 3169 .suite = {
3315 .cipher = { 3170 .cipher = __VECS(camellia_lrw_tv_template)
3316 .enc = __VECS(camellia_lrw_enc_tv_template),
3317 .dec = __VECS(camellia_lrw_dec_tv_template)
3318 }
3319 } 3171 }
3320 }, { 3172 }, {
3321 .alg = "lrw(cast6)", 3173 .alg = "lrw(cast6)",
3322 .test = alg_test_skcipher, 3174 .test = alg_test_skcipher,
3323 .suite = { 3175 .suite = {
3324 .cipher = { 3176 .cipher = __VECS(cast6_lrw_tv_template)
3325 .enc = __VECS(cast6_lrw_enc_tv_template),
3326 .dec = __VECS(cast6_lrw_dec_tv_template)
3327 }
3328 } 3177 }
3329 }, { 3178 }, {
3330 .alg = "lrw(serpent)", 3179 .alg = "lrw(serpent)",
3331 .test = alg_test_skcipher, 3180 .test = alg_test_skcipher,
3332 .suite = { 3181 .suite = {
3333 .cipher = { 3182 .cipher = __VECS(serpent_lrw_tv_template)
3334 .enc = __VECS(serpent_lrw_enc_tv_template),
3335 .dec = __VECS(serpent_lrw_dec_tv_template)
3336 }
3337 } 3183 }
3338 }, { 3184 }, {
3339 .alg = "lrw(twofish)", 3185 .alg = "lrw(twofish)",
3340 .test = alg_test_skcipher, 3186 .test = alg_test_skcipher,
3341 .suite = { 3187 .suite = {
3342 .cipher = { 3188 .cipher = __VECS(tf_lrw_tv_template)
3343 .enc = __VECS(tf_lrw_enc_tv_template),
3344 .dec = __VECS(tf_lrw_dec_tv_template)
3345 }
3346 } 3189 }
3347 }, { 3190 }, {
3348 .alg = "lz4", 3191 .alg = "lz4",
@@ -3415,10 +3258,7 @@ static const struct alg_test_desc alg_test_descs[] = {
3415 .test = alg_test_skcipher, 3258 .test = alg_test_skcipher,
3416 .fips_allowed = 1, 3259 .fips_allowed = 1,
3417 .suite = { 3260 .suite = {
3418 .cipher = { 3261 .cipher = __VECS(aes_ofb_tv_template)
3419 .enc = __VECS(aes_ofb_enc_tv_template),
3420 .dec = __VECS(aes_ofb_dec_tv_template)
3421 }
3422 } 3262 }
3423 }, { 3263 }, {
3424 /* Same as ofb(aes) except the key is stored in 3264 /* Same as ofb(aes) except the key is stored in
@@ -3431,10 +3271,7 @@ static const struct alg_test_desc alg_test_descs[] = {
3431 .alg = "pcbc(fcrypt)", 3271 .alg = "pcbc(fcrypt)",
3432 .test = alg_test_skcipher, 3272 .test = alg_test_skcipher,
3433 .suite = { 3273 .suite = {
3434 .cipher = { 3274 .cipher = __VECS(fcrypt_pcbc_tv_template)
3435 .enc = __VECS(fcrypt_pcbc_enc_tv_template),
3436 .dec = __VECS(fcrypt_pcbc_dec_tv_template)
3437 }
3438 } 3275 }
3439 }, { 3276 }, {
3440 .alg = "pkcs1pad(rsa,sha224)", 3277 .alg = "pkcs1pad(rsa,sha224)",
@@ -3466,10 +3303,7 @@ static const struct alg_test_desc alg_test_descs[] = {
3466 .test = alg_test_skcipher, 3303 .test = alg_test_skcipher,
3467 .fips_allowed = 1, 3304 .fips_allowed = 1,
3468 .suite = { 3305 .suite = {
3469 .cipher = { 3306 .cipher = __VECS(aes_ctr_rfc3686_tv_template)
3470 .enc = __VECS(aes_ctr_rfc3686_enc_tv_template),
3471 .dec = __VECS(aes_ctr_rfc3686_dec_tv_template)
3472 }
3473 } 3307 }
3474 }, { 3308 }, {
3475 .alg = "rfc4106(gcm(aes))", 3309 .alg = "rfc4106(gcm(aes))",
@@ -3553,9 +3387,7 @@ static const struct alg_test_desc alg_test_descs[] = {
3553 .alg = "salsa20", 3387 .alg = "salsa20",
3554 .test = alg_test_skcipher, 3388 .test = alg_test_skcipher,
3555 .suite = { 3389 .suite = {
3556 .cipher = { 3390 .cipher = __VECS(salsa20_stream_tv_template)
3557 .enc = __VECS(salsa20_stream_enc_tv_template)
3558 }
3559 } 3391 }
3560 }, { 3392 }, {
3561 .alg = "sha1", 3393 .alg = "sha1",
@@ -3679,28 +3511,19 @@ static const struct alg_test_desc alg_test_descs[] = {
3679 .test = alg_test_skcipher, 3511 .test = alg_test_skcipher,
3680 .fips_allowed = 1, 3512 .fips_allowed = 1,
3681 .suite = { 3513 .suite = {
3682 .cipher = { 3514 .cipher = __VECS(aes_xts_tv_template)
3683 .enc = __VECS(aes_xts_enc_tv_template),
3684 .dec = __VECS(aes_xts_dec_tv_template)
3685 }
3686 } 3515 }
3687 }, { 3516 }, {
3688 .alg = "xts(camellia)", 3517 .alg = "xts(camellia)",
3689 .test = alg_test_skcipher, 3518 .test = alg_test_skcipher,
3690 .suite = { 3519 .suite = {
3691 .cipher = { 3520 .cipher = __VECS(camellia_xts_tv_template)
3692 .enc = __VECS(camellia_xts_enc_tv_template),
3693 .dec = __VECS(camellia_xts_dec_tv_template)
3694 }
3695 } 3521 }
3696 }, { 3522 }, {
3697 .alg = "xts(cast6)", 3523 .alg = "xts(cast6)",
3698 .test = alg_test_skcipher, 3524 .test = alg_test_skcipher,
3699 .suite = { 3525 .suite = {
3700 .cipher = { 3526 .cipher = __VECS(cast6_xts_tv_template)
3701 .enc = __VECS(cast6_xts_enc_tv_template),
3702 .dec = __VECS(cast6_xts_dec_tv_template)
3703 }
3704 } 3527 }
3705 }, { 3528 }, {
3706 /* Same as xts(aes) except the key is stored in 3529 /* Same as xts(aes) except the key is stored in
@@ -3713,37 +3536,25 @@ static const struct alg_test_desc alg_test_descs[] = {
3713 .alg = "xts(serpent)", 3536 .alg = "xts(serpent)",
3714 .test = alg_test_skcipher, 3537 .test = alg_test_skcipher,
3715 .suite = { 3538 .suite = {
3716 .cipher = { 3539 .cipher = __VECS(serpent_xts_tv_template)
3717 .enc = __VECS(serpent_xts_enc_tv_template),
3718 .dec = __VECS(serpent_xts_dec_tv_template)
3719 }
3720 } 3540 }
3721 }, { 3541 }, {
3722 .alg = "xts(speck128)", 3542 .alg = "xts(speck128)",
3723 .test = alg_test_skcipher, 3543 .test = alg_test_skcipher,
3724 .suite = { 3544 .suite = {
3725 .cipher = { 3545 .cipher = __VECS(speck128_xts_tv_template)
3726 .enc = __VECS(speck128_xts_enc_tv_template),
3727 .dec = __VECS(speck128_xts_dec_tv_template)
3728 }
3729 } 3546 }
3730 }, { 3547 }, {
3731 .alg = "xts(speck64)", 3548 .alg = "xts(speck64)",
3732 .test = alg_test_skcipher, 3549 .test = alg_test_skcipher,
3733 .suite = { 3550 .suite = {
3734 .cipher = { 3551 .cipher = __VECS(speck64_xts_tv_template)
3735 .enc = __VECS(speck64_xts_enc_tv_template),
3736 .dec = __VECS(speck64_xts_dec_tv_template)
3737 }
3738 } 3552 }
3739 }, { 3553 }, {
3740 .alg = "xts(twofish)", 3554 .alg = "xts(twofish)",
3741 .test = alg_test_skcipher, 3555 .test = alg_test_skcipher,
3742 .suite = { 3556 .suite = {
3743 .cipher = { 3557 .cipher = __VECS(tf_xts_tv_template)
3744 .enc = __VECS(tf_xts_enc_tv_template),
3745 .dec = __VECS(tf_xts_dec_tv_template)
3746 }
3747 } 3558 }
3748 }, { 3559 }, {
3749 .alg = "xts4096(paes)", 3560 .alg = "xts4096(paes)",