aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Kconfig24
-rw-r--r--crypto/tcrypt.c23
-rw-r--r--crypto/testmgr.c60
3 files changed, 107 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 8e84225c096b..e00a4e49e013 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -913,6 +913,30 @@ config CRYPTO_TWOFISH_X86_64_3WAY
913 See also: 913 See also:
914 <http://www.schneier.com/twofish.html> 914 <http://www.schneier.com/twofish.html>
915 915
916config CRYPTO_TWOFISH_AVX_X86_64
917 tristate "Twofish cipher algorithm (x86_64/AVX)"
918 depends on X86 && 64BIT
919 select CRYPTO_ALGAPI
920 select CRYPTO_CRYPTD
921 select CRYPTO_TWOFISH_COMMON
922 select CRYPTO_TWOFISH_X86_64
923 select CRYPTO_TWOFISH_X86_64_3WAY
924 select CRYPTO_LRW
925 select CRYPTO_XTS
926 help
927 Twofish cipher algorithm (x86_64/AVX).
928
929 Twofish was submitted as an AES (Advanced Encryption Standard)
930 candidate cipher by researchers at CounterPane Systems. It is a
931 16 round block cipher supporting key sizes of 128, 192, and 256
932 bits.
933
934 This module provides the Twofish cipher algorithm that processes
935 eight blocks parallel using the AVX Instruction Set.
936
937 See also:
938 <http://www.schneier.com/twofish.html>
939
916comment "Compression" 940comment "Compression"
917 941
918config CRYPTO_DEFLATE 942config CRYPTO_DEFLATE
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 750cce44bad6..2af879786e75 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1566,6 +1566,29 @@ static int do_test(int m)
1566 speed_template_32_64); 1566 speed_template_32_64);
1567 break; 1567 break;
1568 1568
1569 case 504:
1570 test_acipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0,
1571 speed_template_16_24_32);
1572 test_acipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0,
1573 speed_template_16_24_32);
1574 test_acipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0,
1575 speed_template_16_24_32);
1576 test_acipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0,
1577 speed_template_16_24_32);
1578 test_acipher_speed("ctr(twofish)", ENCRYPT, sec, NULL, 0,
1579 speed_template_16_24_32);
1580 test_acipher_speed("ctr(twofish)", DECRYPT, sec, NULL, 0,
1581 speed_template_16_24_32);
1582 test_acipher_speed("lrw(twofish)", ENCRYPT, sec, NULL, 0,
1583 speed_template_32_40_48);
1584 test_acipher_speed("lrw(twofish)", DECRYPT, sec, NULL, 0,
1585 speed_template_32_40_48);
1586 test_acipher_speed("xts(twofish)", ENCRYPT, sec, NULL, 0,
1587 speed_template_32_48_64);
1588 test_acipher_speed("xts(twofish)", DECRYPT, sec, NULL, 0,
1589 speed_template_32_48_64);
1590 break;
1591
1569 case 1000: 1592 case 1000:
1570 test_available(); 1593 test_available();
1571 break; 1594 break;
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index eb6d20f8ec5d..73b3ec6fe1a2 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1549,6 +1549,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1549 } 1549 }
1550 } 1550 }
1551 }, { 1551 }, {
1552 .alg = "__cbc-twofish-avx",
1553 .test = alg_test_null,
1554 .suite = {
1555 .cipher = {
1556 .enc = {
1557 .vecs = NULL,
1558 .count = 0
1559 },
1560 .dec = {
1561 .vecs = NULL,
1562 .count = 0
1563 }
1564 }
1565 }
1566 }, {
1552 .alg = "__driver-cbc-aes-aesni", 1567 .alg = "__driver-cbc-aes-aesni",
1553 .test = alg_test_null, 1568 .test = alg_test_null,
1554 .suite = { 1569 .suite = {
@@ -1579,6 +1594,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1579 } 1594 }
1580 } 1595 }
1581 }, { 1596 }, {
1597 .alg = "__driver-cbc-twofish-avx",
1598 .test = alg_test_null,
1599 .suite = {
1600 .cipher = {
1601 .enc = {
1602 .vecs = NULL,
1603 .count = 0
1604 },
1605 .dec = {
1606 .vecs = NULL,
1607 .count = 0
1608 }
1609 }
1610 }
1611 }, {
1582 .alg = "__driver-ecb-aes-aesni", 1612 .alg = "__driver-ecb-aes-aesni",
1583 .test = alg_test_null, 1613 .test = alg_test_null,
1584 .suite = { 1614 .suite = {
@@ -1609,6 +1639,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1609 } 1639 }
1610 } 1640 }
1611 }, { 1641 }, {
1642 .alg = "__driver-ecb-twofish-avx",
1643 .test = alg_test_null,
1644 .suite = {
1645 .cipher = {
1646 .enc = {
1647 .vecs = NULL,
1648 .count = 0
1649 },
1650 .dec = {
1651 .vecs = NULL,
1652 .count = 0
1653 }
1654 }
1655 }
1656 }, {
1612 .alg = "__ghash-pclmulqdqni", 1657 .alg = "__ghash-pclmulqdqni",
1613 .test = alg_test_null, 1658 .test = alg_test_null,
1614 .suite = { 1659 .suite = {
@@ -1806,6 +1851,21 @@ static const struct alg_test_desc alg_test_descs[] = {
1806 } 1851 }
1807 } 1852 }
1808 }, { 1853 }, {
1854 .alg = "cryptd(__driver-ecb-twofish-avx)",
1855 .test = alg_test_null,
1856 .suite = {
1857 .cipher = {
1858 .enc = {
1859 .vecs = NULL,
1860 .count = 0
1861 },
1862 .dec = {
1863 .vecs = NULL,
1864 .count = 0
1865 }
1866 }
1867 }
1868 }, {
1809 .alg = "cryptd(__ghash-pclmulqdqni)", 1869 .alg = "cryptd(__ghash-pclmulqdqni)",
1810 .test = alg_test_null, 1870 .test = alg_test_null,
1811 .suite = { 1871 .suite = {