aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /crypto/tcrypt.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c530
1 files changed, 9 insertions, 521 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 7ae2130e1b0..7569ba9b621 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -97,6 +97,7 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
97 int ret = 0; 97 int ret = 0;
98 int i; 98 int i;
99 99
100 local_bh_disable();
100 local_irq_disable(); 101 local_irq_disable();
101 102
102 /* Warm-up run. */ 103 /* Warm-up run. */
@@ -129,6 +130,7 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
129 130
130out: 131out:
131 local_irq_enable(); 132 local_irq_enable();
133 local_bh_enable();
132 134
133 if (ret == 0) 135 if (ret == 0)
134 printk("1 operation in %lu cycles (%d bytes)\n", 136 printk("1 operation in %lu cycles (%d bytes)\n",
@@ -298,6 +300,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
298 int i; 300 int i;
299 int ret; 301 int ret;
300 302
303 local_bh_disable();
301 local_irq_disable(); 304 local_irq_disable();
302 305
303 /* Warm-up run. */ 306 /* Warm-up run. */
@@ -324,6 +327,7 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
324 327
325out: 328out:
326 local_irq_enable(); 329 local_irq_enable();
330 local_bh_enable();
327 331
328 if (ret) 332 if (ret)
329 return ret; 333 return ret;
@@ -344,6 +348,7 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
344 if (plen == blen) 348 if (plen == blen)
345 return test_hash_cycles_digest(desc, sg, blen, out); 349 return test_hash_cycles_digest(desc, sg, blen, out);
346 350
351 local_bh_disable();
347 local_irq_disable(); 352 local_irq_disable();
348 353
349 /* Warm-up run. */ 354 /* Warm-up run. */
@@ -386,6 +391,7 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
386 391
387out: 392out:
388 local_irq_enable(); 393 local_irq_enable();
394 local_bh_enable();
389 395
390 if (ret) 396 if (ret)
391 return ret; 397 return ret;
@@ -713,219 +719,6 @@ out:
713 crypto_free_ahash(tfm); 719 crypto_free_ahash(tfm);
714} 720}
715 721
716static inline int do_one_acipher_op(struct ablkcipher_request *req, int ret)
717{
718 if (ret == -EINPROGRESS || ret == -EBUSY) {
719 struct tcrypt_result *tr = req->base.data;
720
721 ret = wait_for_completion_interruptible(&tr->completion);
722 if (!ret)
723 ret = tr->err;
724 INIT_COMPLETION(tr->completion);
725 }
726
727 return ret;
728}
729
730static int test_acipher_jiffies(struct ablkcipher_request *req, int enc,
731 int blen, int sec)
732{
733 unsigned long start, end;
734 int bcount;
735 int ret;
736
737 for (start = jiffies, end = start + sec * HZ, bcount = 0;
738 time_before(jiffies, end); bcount++) {
739 if (enc)
740 ret = do_one_acipher_op(req,
741 crypto_ablkcipher_encrypt(req));
742 else
743 ret = do_one_acipher_op(req,
744 crypto_ablkcipher_decrypt(req));
745
746 if (ret)
747 return ret;
748 }
749
750 pr_cont("%d operations in %d seconds (%ld bytes)\n",
751 bcount, sec, (long)bcount * blen);
752 return 0;
753}
754
755static int test_acipher_cycles(struct ablkcipher_request *req, int enc,
756 int blen)
757{
758 unsigned long cycles = 0;
759 int ret = 0;
760 int i;
761
762 /* Warm-up run. */
763 for (i = 0; i < 4; i++) {
764 if (enc)
765 ret = do_one_acipher_op(req,
766 crypto_ablkcipher_encrypt(req));
767 else
768 ret = do_one_acipher_op(req,
769 crypto_ablkcipher_decrypt(req));
770
771 if (ret)
772 goto out;
773 }
774
775 /* The real thing. */
776 for (i = 0; i < 8; i++) {
777 cycles_t start, end;
778
779 start = get_cycles();
780 if (enc)
781 ret = do_one_acipher_op(req,
782 crypto_ablkcipher_encrypt(req));
783 else
784 ret = do_one_acipher_op(req,
785 crypto_ablkcipher_decrypt(req));
786 end = get_cycles();
787
788 if (ret)
789 goto out;
790
791 cycles += end - start;
792 }
793
794out:
795 if (ret == 0)
796 pr_cont("1 operation in %lu cycles (%d bytes)\n",
797 (cycles + 4) / 8, blen);
798
799 return ret;
800}
801
802static void test_acipher_speed(const char *algo, int enc, unsigned int sec,
803 struct cipher_speed_template *template,
804 unsigned int tcount, u8 *keysize)
805{
806 unsigned int ret, i, j, k, iv_len;
807 struct tcrypt_result tresult;
808 const char *key;
809 char iv[128];
810 struct ablkcipher_request *req;
811 struct crypto_ablkcipher *tfm;
812 const char *e;
813 u32 *b_size;
814
815 if (enc == ENCRYPT)
816 e = "encryption";
817 else
818 e = "decryption";
819
820 pr_info("\ntesting speed of async %s %s\n", algo, e);
821
822 init_completion(&tresult.completion);
823
824 tfm = crypto_alloc_ablkcipher(algo, 0, 0);
825
826 if (IS_ERR(tfm)) {
827 pr_err("failed to load transform for %s: %ld\n", algo,
828 PTR_ERR(tfm));
829 return;
830 }
831
832 req = ablkcipher_request_alloc(tfm, GFP_KERNEL);
833 if (!req) {
834 pr_err("tcrypt: skcipher: Failed to allocate request for %s\n",
835 algo);
836 goto out;
837 }
838
839 ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
840 tcrypt_complete, &tresult);
841
842 i = 0;
843 do {
844 b_size = block_sizes;
845
846 do {
847 struct scatterlist sg[TVMEMSIZE];
848
849 if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) {
850 pr_err("template (%u) too big for "
851 "tvmem (%lu)\n", *keysize + *b_size,
852 TVMEMSIZE * PAGE_SIZE);
853 goto out_free_req;
854 }
855
856 pr_info("test %u (%d bit key, %d byte blocks): ", i,
857 *keysize * 8, *b_size);
858
859 memset(tvmem[0], 0xff, PAGE_SIZE);
860
861 /* set key, plain text and IV */
862 key = tvmem[0];
863 for (j = 0; j < tcount; j++) {
864 if (template[j].klen == *keysize) {
865 key = template[j].key;
866 break;
867 }
868 }
869
870 crypto_ablkcipher_clear_flags(tfm, ~0);
871
872 ret = crypto_ablkcipher_setkey(tfm, key, *keysize);
873 if (ret) {
874 pr_err("setkey() failed flags=%x\n",
875 crypto_ablkcipher_get_flags(tfm));
876 goto out_free_req;
877 }
878
879 sg_init_table(sg, TVMEMSIZE);
880
881 k = *keysize + *b_size;
882 if (k > PAGE_SIZE) {
883 sg_set_buf(sg, tvmem[0] + *keysize,
884 PAGE_SIZE - *keysize);
885 k -= PAGE_SIZE;
886 j = 1;
887 while (k > PAGE_SIZE) {
888 sg_set_buf(sg + j, tvmem[j], PAGE_SIZE);
889 memset(tvmem[j], 0xff, PAGE_SIZE);
890 j++;
891 k -= PAGE_SIZE;
892 }
893 sg_set_buf(sg + j, tvmem[j], k);
894 memset(tvmem[j], 0xff, k);
895 } else {
896 sg_set_buf(sg, tvmem[0] + *keysize, *b_size);
897 }
898
899 iv_len = crypto_ablkcipher_ivsize(tfm);
900 if (iv_len)
901 memset(&iv, 0xff, iv_len);
902
903 ablkcipher_request_set_crypt(req, sg, sg, *b_size, iv);
904
905 if (sec)
906 ret = test_acipher_jiffies(req, enc,
907 *b_size, sec);
908 else
909 ret = test_acipher_cycles(req, enc,
910 *b_size);
911
912 if (ret) {
913 pr_err("%s() failed flags=%x\n", e,
914 crypto_ablkcipher_get_flags(tfm));
915 break;
916 }
917 b_size++;
918 i++;
919 } while (*b_size);
920 keysize++;
921 } while (*keysize);
922
923out_free_req:
924 ablkcipher_request_free(req);
925out:
926 crypto_free_ablkcipher(tfm);
927}
928
929static void test_available(void) 722static void test_available(void)
930{ 723{
931 char **name = check; 724 char **name = check;
@@ -971,13 +764,11 @@ static int do_test(int m)
971 case 3: 764 case 3:
972 ret += tcrypt_test("ecb(des)"); 765 ret += tcrypt_test("ecb(des)");
973 ret += tcrypt_test("cbc(des)"); 766 ret += tcrypt_test("cbc(des)");
974 ret += tcrypt_test("ctr(des)");
975 break; 767 break;
976 768
977 case 4: 769 case 4:
978 ret += tcrypt_test("ecb(des3_ede)"); 770 ret += tcrypt_test("ecb(des3_ede)");
979 ret += tcrypt_test("cbc(des3_ede)"); 771 ret += tcrypt_test("cbc(des3_ede)");
980 ret += tcrypt_test("ctr(des3_ede)");
981 break; 772 break;
982 773
983 case 5: 774 case 5:
@@ -991,23 +782,15 @@ static int do_test(int m)
991 case 7: 782 case 7:
992 ret += tcrypt_test("ecb(blowfish)"); 783 ret += tcrypt_test("ecb(blowfish)");
993 ret += tcrypt_test("cbc(blowfish)"); 784 ret += tcrypt_test("cbc(blowfish)");
994 ret += tcrypt_test("ctr(blowfish)");
995 break; 785 break;
996 786
997 case 8: 787 case 8:
998 ret += tcrypt_test("ecb(twofish)"); 788 ret += tcrypt_test("ecb(twofish)");
999 ret += tcrypt_test("cbc(twofish)"); 789 ret += tcrypt_test("cbc(twofish)");
1000 ret += tcrypt_test("ctr(twofish)");
1001 ret += tcrypt_test("lrw(twofish)");
1002 ret += tcrypt_test("xts(twofish)");
1003 break; 790 break;
1004 791
1005 case 9: 792 case 9:
1006 ret += tcrypt_test("ecb(serpent)"); 793 ret += tcrypt_test("ecb(serpent)");
1007 ret += tcrypt_test("cbc(serpent)");
1008 ret += tcrypt_test("ctr(serpent)");
1009 ret += tcrypt_test("lrw(serpent)");
1010 ret += tcrypt_test("xts(serpent)");
1011 break; 794 break;
1012 795
1013 case 10: 796 case 10:
@@ -1033,16 +816,10 @@ static int do_test(int m)
1033 816
1034 case 14: 817 case 14:
1035 ret += tcrypt_test("ecb(cast5)"); 818 ret += tcrypt_test("ecb(cast5)");
1036 ret += tcrypt_test("cbc(cast5)");
1037 ret += tcrypt_test("ctr(cast5)");
1038 break; 819 break;
1039 820
1040 case 15: 821 case 15:
1041 ret += tcrypt_test("ecb(cast6)"); 822 ret += tcrypt_test("ecb(cast6)");
1042 ret += tcrypt_test("cbc(cast6)");
1043 ret += tcrypt_test("ctr(cast6)");
1044 ret += tcrypt_test("lrw(cast6)");
1045 ret += tcrypt_test("xts(cast6)");
1046 break; 823 break;
1047 824
1048 case 16: 825 case 16:
@@ -1114,9 +891,6 @@ static int do_test(int m)
1114 case 32: 891 case 32:
1115 ret += tcrypt_test("ecb(camellia)"); 892 ret += tcrypt_test("ecb(camellia)");
1116 ret += tcrypt_test("cbc(camellia)"); 893 ret += tcrypt_test("cbc(camellia)");
1117 ret += tcrypt_test("ctr(camellia)");
1118 ret += tcrypt_test("lrw(camellia)");
1119 ret += tcrypt_test("xts(camellia)");
1120 break; 894 break;
1121 case 33: 895 case 33:
1122 ret += tcrypt_test("sha224"); 896 ret += tcrypt_test("sha224");
@@ -1171,7 +945,7 @@ static int do_test(int m)
1171 break; 945 break;
1172 946
1173 case 46: 947 case 46:
1174 ret += tcrypt_test("ghash"); 948 ret += tcrypt_test("ofb(aes)");
1175 break; 949 break;
1176 950
1177 case 100: 951 case 100:
@@ -1213,8 +987,9 @@ static int do_test(int m)
1213 case 109: 987 case 109:
1214 ret += tcrypt_test("vmac(aes)"); 988 ret += tcrypt_test("vmac(aes)");
1215 break; 989 break;
990
1216 case 110: 991 case 110:
1217 ret += tcrypt_test("hmac(crc32)"); 992 ret += tcrypt_test("cmac(aes)");
1218 break; 993 break;
1219 994
1220 case 150: 995 case 150:
@@ -1272,18 +1047,6 @@ static int do_test(int m)
1272 speed_template_16_24_32); 1047 speed_template_16_24_32);
1273 test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0, 1048 test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0,
1274 speed_template_16_24_32); 1049 speed_template_16_24_32);
1275 test_cipher_speed("ctr(twofish)", ENCRYPT, sec, NULL, 0,
1276 speed_template_16_24_32);
1277 test_cipher_speed("ctr(twofish)", DECRYPT, sec, NULL, 0,
1278 speed_template_16_24_32);
1279 test_cipher_speed("lrw(twofish)", ENCRYPT, sec, NULL, 0,
1280 speed_template_32_40_48);
1281 test_cipher_speed("lrw(twofish)", DECRYPT, sec, NULL, 0,
1282 speed_template_32_40_48);
1283 test_cipher_speed("xts(twofish)", ENCRYPT, sec, NULL, 0,
1284 speed_template_32_48_64);
1285 test_cipher_speed("xts(twofish)", DECRYPT, sec, NULL, 0,
1286 speed_template_32_48_64);
1287 break; 1050 break;
1288 1051
1289 case 203: 1052 case 203:
@@ -1295,10 +1058,6 @@ static int do_test(int m)
1295 speed_template_8_32); 1058 speed_template_8_32);
1296 test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0, 1059 test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0,
1297 speed_template_8_32); 1060 speed_template_8_32);
1298 test_cipher_speed("ctr(blowfish)", ENCRYPT, sec, NULL, 0,
1299 speed_template_8_32);
1300 test_cipher_speed("ctr(blowfish)", DECRYPT, sec, NULL, 0,
1301 speed_template_8_32);
1302 break; 1061 break;
1303 1062
1304 case 204: 1063 case 204:
@@ -1321,18 +1080,6 @@ static int do_test(int m)
1321 speed_template_16_24_32); 1080 speed_template_16_24_32);
1322 test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0, 1081 test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0,
1323 speed_template_16_24_32); 1082 speed_template_16_24_32);
1324 test_cipher_speed("ctr(camellia)", ENCRYPT, sec, NULL, 0,
1325 speed_template_16_24_32);
1326 test_cipher_speed("ctr(camellia)", DECRYPT, sec, NULL, 0,
1327 speed_template_16_24_32);
1328 test_cipher_speed("lrw(camellia)", ENCRYPT, sec, NULL, 0,
1329 speed_template_32_40_48);
1330 test_cipher_speed("lrw(camellia)", DECRYPT, sec, NULL, 0,
1331 speed_template_32_40_48);
1332 test_cipher_speed("xts(camellia)", ENCRYPT, sec, NULL, 0,
1333 speed_template_32_48_64);
1334 test_cipher_speed("xts(camellia)", DECRYPT, sec, NULL, 0,
1335 speed_template_32_48_64);
1336 break; 1083 break;
1337 1084
1338 case 206: 1085 case 206:
@@ -1340,72 +1087,6 @@ static int do_test(int m)
1340 speed_template_16_32); 1087 speed_template_16_32);
1341 break; 1088 break;
1342 1089
1343 case 207:
1344 test_cipher_speed("ecb(serpent)", ENCRYPT, sec, NULL, 0,
1345 speed_template_16_32);
1346 test_cipher_speed("ecb(serpent)", DECRYPT, sec, NULL, 0,
1347 speed_template_16_32);
1348 test_cipher_speed("cbc(serpent)", ENCRYPT, sec, NULL, 0,
1349 speed_template_16_32);
1350 test_cipher_speed("cbc(serpent)", DECRYPT, sec, NULL, 0,
1351 speed_template_16_32);
1352 test_cipher_speed("ctr(serpent)", ENCRYPT, sec, NULL, 0,
1353 speed_template_16_32);
1354 test_cipher_speed("ctr(serpent)", DECRYPT, sec, NULL, 0,
1355 speed_template_16_32);
1356 test_cipher_speed("lrw(serpent)", ENCRYPT, sec, NULL, 0,
1357 speed_template_32_48);
1358 test_cipher_speed("lrw(serpent)", DECRYPT, sec, NULL, 0,
1359 speed_template_32_48);
1360 test_cipher_speed("xts(serpent)", ENCRYPT, sec, NULL, 0,
1361 speed_template_32_64);
1362 test_cipher_speed("xts(serpent)", DECRYPT, sec, NULL, 0,
1363 speed_template_32_64);
1364 break;
1365
1366 case 208:
1367 test_cipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0,
1368 speed_template_8);
1369 break;
1370
1371 case 209:
1372 test_cipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0,
1373 speed_template_8_16);
1374 test_cipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0,
1375 speed_template_8_16);
1376 test_cipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0,
1377 speed_template_8_16);
1378 test_cipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0,
1379 speed_template_8_16);
1380 test_cipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0,
1381 speed_template_8_16);
1382 test_cipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0,
1383 speed_template_8_16);
1384 break;
1385
1386 case 210:
1387 test_cipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0,
1388 speed_template_16_32);
1389 test_cipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0,
1390 speed_template_16_32);
1391 test_cipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0,
1392 speed_template_16_32);
1393 test_cipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0,
1394 speed_template_16_32);
1395 test_cipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0,
1396 speed_template_16_32);
1397 test_cipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0,
1398 speed_template_16_32);
1399 test_cipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0,
1400 speed_template_32_48);
1401 test_cipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0,
1402 speed_template_32_48);
1403 test_cipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0,
1404 speed_template_32_64);
1405 test_cipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0,
1406 speed_template_32_64);
1407 break;
1408
1409 case 300: 1090 case 300:
1410 /* fall through */ 1091 /* fall through */
1411 1092
@@ -1481,10 +1162,6 @@ static int do_test(int m)
1481 test_hash_speed("ghash-generic", sec, hash_speed_template_16); 1162 test_hash_speed("ghash-generic", sec, hash_speed_template_16);
1482 if (mode > 300 && mode < 400) break; 1163 if (mode > 300 && mode < 400) break;
1483 1164
1484 case 319:
1485 test_hash_speed("crc32c", sec, generic_hash_speed_template);
1486 if (mode > 300 && mode < 400) break;
1487
1488 case 399: 1165 case 399:
1489 break; 1166 break;
1490 1167
@@ -1562,195 +1239,6 @@ static int do_test(int m)
1562 case 499: 1239 case 499:
1563 break; 1240 break;
1564 1241
1565 case 500:
1566 test_acipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
1567 speed_template_16_24_32);
1568 test_acipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
1569 speed_template_16_24_32);
1570 test_acipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0,
1571 speed_template_16_24_32);
1572 test_acipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
1573 speed_template_16_24_32);
1574 test_acipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
1575 speed_template_32_40_48);
1576 test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
1577 speed_template_32_40_48);
1578 test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
1579 speed_template_32_48_64);
1580 test_acipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
1581 speed_template_32_48_64);
1582 test_acipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0,
1583 speed_template_16_24_32);
1584 test_acipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0,
1585 speed_template_16_24_32);
1586 test_acipher_speed("cfb(aes)", ENCRYPT, sec, NULL, 0,
1587 speed_template_16_24_32);
1588 test_acipher_speed("cfb(aes)", DECRYPT, sec, NULL, 0,
1589 speed_template_16_24_32);
1590 test_acipher_speed("ofb(aes)", ENCRYPT, sec, NULL, 0,
1591 speed_template_16_24_32);
1592 test_acipher_speed("ofb(aes)", DECRYPT, sec, NULL, 0,
1593 speed_template_16_24_32);
1594 break;
1595
1596 case 501:
1597 test_acipher_speed("ecb(des3_ede)", ENCRYPT, sec,
1598 des3_speed_template, DES3_SPEED_VECTORS,
1599 speed_template_24);
1600 test_acipher_speed("ecb(des3_ede)", DECRYPT, sec,
1601 des3_speed_template, DES3_SPEED_VECTORS,
1602 speed_template_24);
1603 test_acipher_speed("cbc(des3_ede)", ENCRYPT, sec,
1604 des3_speed_template, DES3_SPEED_VECTORS,
1605 speed_template_24);
1606 test_acipher_speed("cbc(des3_ede)", DECRYPT, sec,
1607 des3_speed_template, DES3_SPEED_VECTORS,
1608 speed_template_24);
1609 test_acipher_speed("cfb(des3_ede)", ENCRYPT, sec,
1610 des3_speed_template, DES3_SPEED_VECTORS,
1611 speed_template_24);
1612 test_acipher_speed("cfb(des3_ede)", DECRYPT, sec,
1613 des3_speed_template, DES3_SPEED_VECTORS,
1614 speed_template_24);
1615 test_acipher_speed("ofb(des3_ede)", ENCRYPT, sec,
1616 des3_speed_template, DES3_SPEED_VECTORS,
1617 speed_template_24);
1618 test_acipher_speed("ofb(des3_ede)", DECRYPT, sec,
1619 des3_speed_template, DES3_SPEED_VECTORS,
1620 speed_template_24);
1621 break;
1622
1623 case 502:
1624 test_acipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0,
1625 speed_template_8);
1626 test_acipher_speed("ecb(des)", DECRYPT, sec, NULL, 0,
1627 speed_template_8);
1628 test_acipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0,
1629 speed_template_8);
1630 test_acipher_speed("cbc(des)", DECRYPT, sec, NULL, 0,
1631 speed_template_8);
1632 test_acipher_speed("cfb(des)", ENCRYPT, sec, NULL, 0,
1633 speed_template_8);
1634 test_acipher_speed("cfb(des)", DECRYPT, sec, NULL, 0,
1635 speed_template_8);
1636 test_acipher_speed("ofb(des)", ENCRYPT, sec, NULL, 0,
1637 speed_template_8);
1638 test_acipher_speed("ofb(des)", DECRYPT, sec, NULL, 0,
1639 speed_template_8);
1640 break;
1641
1642 case 503:
1643 test_acipher_speed("ecb(serpent)", ENCRYPT, sec, NULL, 0,
1644 speed_template_16_32);
1645 test_acipher_speed("ecb(serpent)", DECRYPT, sec, NULL, 0,
1646 speed_template_16_32);
1647 test_acipher_speed("cbc(serpent)", ENCRYPT, sec, NULL, 0,
1648 speed_template_16_32);
1649 test_acipher_speed("cbc(serpent)", DECRYPT, sec, NULL, 0,
1650 speed_template_16_32);
1651 test_acipher_speed("ctr(serpent)", ENCRYPT, sec, NULL, 0,
1652 speed_template_16_32);
1653 test_acipher_speed("ctr(serpent)", DECRYPT, sec, NULL, 0,
1654 speed_template_16_32);
1655 test_acipher_speed("lrw(serpent)", ENCRYPT, sec, NULL, 0,
1656 speed_template_32_48);
1657 test_acipher_speed("lrw(serpent)", DECRYPT, sec, NULL, 0,
1658 speed_template_32_48);
1659 test_acipher_speed("xts(serpent)", ENCRYPT, sec, NULL, 0,
1660 speed_template_32_64);
1661 test_acipher_speed("xts(serpent)", DECRYPT, sec, NULL, 0,
1662 speed_template_32_64);
1663 break;
1664
1665 case 504:
1666 test_acipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0,
1667 speed_template_16_24_32);
1668 test_acipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0,
1669 speed_template_16_24_32);
1670 test_acipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0,
1671 speed_template_16_24_32);
1672 test_acipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0,
1673 speed_template_16_24_32);
1674 test_acipher_speed("ctr(twofish)", ENCRYPT, sec, NULL, 0,
1675 speed_template_16_24_32);
1676 test_acipher_speed("ctr(twofish)", DECRYPT, sec, NULL, 0,
1677 speed_template_16_24_32);
1678 test_acipher_speed("lrw(twofish)", ENCRYPT, sec, NULL, 0,
1679 speed_template_32_40_48);
1680 test_acipher_speed("lrw(twofish)", DECRYPT, sec, NULL, 0,
1681 speed_template_32_40_48);
1682 test_acipher_speed("xts(twofish)", ENCRYPT, sec, NULL, 0,
1683 speed_template_32_48_64);
1684 test_acipher_speed("xts(twofish)", DECRYPT, sec, NULL, 0,
1685 speed_template_32_48_64);
1686 break;
1687
1688 case 505:
1689 test_acipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0,
1690 speed_template_8);
1691 break;
1692
1693 case 506:
1694 test_acipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0,
1695 speed_template_8_16);
1696 test_acipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0,
1697 speed_template_8_16);
1698 test_acipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0,
1699 speed_template_8_16);
1700 test_acipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0,
1701 speed_template_8_16);
1702 test_acipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0,
1703 speed_template_8_16);
1704 test_acipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0,
1705 speed_template_8_16);
1706 break;
1707
1708 case 507:
1709 test_acipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0,
1710 speed_template_16_32);
1711 test_acipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0,
1712 speed_template_16_32);
1713 test_acipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0,
1714 speed_template_16_32);
1715 test_acipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0,
1716 speed_template_16_32);
1717 test_acipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0,
1718 speed_template_16_32);
1719 test_acipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0,
1720 speed_template_16_32);
1721 test_acipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0,
1722 speed_template_32_48);
1723 test_acipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0,
1724 speed_template_32_48);
1725 test_acipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0,
1726 speed_template_32_64);
1727 test_acipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0,
1728 speed_template_32_64);
1729 break;
1730
1731 case 508:
1732 test_acipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0,
1733 speed_template_16_32);
1734 test_acipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0,
1735 speed_template_16_32);
1736 test_acipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0,
1737 speed_template_16_32);
1738 test_acipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0,
1739 speed_template_16_32);
1740 test_acipher_speed("ctr(camellia)", ENCRYPT, sec, NULL, 0,
1741 speed_template_16_32);
1742 test_acipher_speed("ctr(camellia)", DECRYPT, sec, NULL, 0,
1743 speed_template_16_32);
1744 test_acipher_speed("lrw(camellia)", ENCRYPT, sec, NULL, 0,
1745 speed_template_32_48);
1746 test_acipher_speed("lrw(camellia)", DECRYPT, sec, NULL, 0,
1747 speed_template_32_48);
1748 test_acipher_speed("xts(camellia)", ENCRYPT, sec, NULL, 0,
1749 speed_template_32_64);
1750 test_acipher_speed("xts(camellia)", DECRYPT, sec, NULL, 0,
1751 speed_template_32_64);
1752 break;
1753
1754 case 1000: 1242 case 1000:
1755 test_available(); 1243 test_available();
1756 break; 1244 break;