diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-04-13 06:47:00 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-04-25 09:09:07 -0400 |
commit | f3f935a76aa0eee68da2b273a08d84ba8ffc7a73 (patch) | |
tree | c33db3ca826852d1f5b66ec48e08a08b0e273b78 /crypto | |
parent | 56d76c96a9f3e39ab733c5643b3ce5a1d4be242a (diff) |
crypto: camellia - add AVX2/AES-NI/x86_64 assembler implementation of camellia cipher
Patch adds AVX2/AES-NI/x86-64 implementation of Camellia cipher, requiring
32 parallel blocks for input (512 bytes). Compared to AVX implementation, this
version is extended to use the 256-bit wide YMM registers. For AES-NI
instructions data is split to two 128-bit registers and merged afterwards.
Even with this additional handling, performance should be higher compared
to the AES-NI/AVX implementation.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Kconfig | 23 | ||||
-rw-r--r-- | crypto/testmgr.c | 12 |
2 files changed, 35 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index 9ad3d78c1075..622d8a48cbe9 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -894,6 +894,29 @@ config CRYPTO_CAMELLIA_AESNI_AVX_X86_64 | |||
894 | See also: | 894 | See also: |
895 | <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html> | 895 | <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html> |
896 | 896 | ||
897 | config CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 | ||
898 | tristate "Camellia cipher algorithm (x86_64/AES-NI/AVX2)" | ||
899 | depends on X86 && 64BIT | ||
900 | depends on CRYPTO | ||
901 | select CRYPTO_ALGAPI | ||
902 | select CRYPTO_CRYPTD | ||
903 | select CRYPTO_ABLK_HELPER_X86 | ||
904 | select CRYPTO_GLUE_HELPER_X86 | ||
905 | select CRYPTO_CAMELLIA_X86_64 | ||
906 | select CRYPTO_CAMELLIA_AESNI_AVX_X86_64 | ||
907 | select CRYPTO_LRW | ||
908 | select CRYPTO_XTS | ||
909 | help | ||
910 | Camellia cipher algorithm module (x86_64/AES-NI/AVX2). | ||
911 | |||
912 | Camellia is a symmetric key block cipher developed jointly | ||
913 | at NTT and Mitsubishi Electric Corporation. | ||
914 | |||
915 | The Camellia specifies three key sizes: 128, 192 and 256 bits. | ||
916 | |||
917 | See also: | ||
918 | <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html> | ||
919 | |||
897 | config CRYPTO_CAMELLIA_SPARC64 | 920 | config CRYPTO_CAMELLIA_SPARC64 |
898 | tristate "Camellia cipher algorithm (SPARC64)" | 921 | tristate "Camellia cipher algorithm (SPARC64)" |
899 | depends on SPARC64 | 922 | depends on SPARC64 |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index f5e13dea8cc9..5823735cf381 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -1667,6 +1667,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1667 | .alg = "__driver-cbc-camellia-aesni", | 1667 | .alg = "__driver-cbc-camellia-aesni", |
1668 | .test = alg_test_null, | 1668 | .test = alg_test_null, |
1669 | }, { | 1669 | }, { |
1670 | .alg = "__driver-cbc-camellia-aesni-avx2", | ||
1671 | .test = alg_test_null, | ||
1672 | }, { | ||
1670 | .alg = "__driver-cbc-cast5-avx", | 1673 | .alg = "__driver-cbc-cast5-avx", |
1671 | .test = alg_test_null, | 1674 | .test = alg_test_null, |
1672 | }, { | 1675 | }, { |
@@ -1698,6 +1701,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1698 | .alg = "__driver-ecb-camellia-aesni", | 1701 | .alg = "__driver-ecb-camellia-aesni", |
1699 | .test = alg_test_null, | 1702 | .test = alg_test_null, |
1700 | }, { | 1703 | }, { |
1704 | .alg = "__driver-ecb-camellia-aesni-avx2", | ||
1705 | .test = alg_test_null, | ||
1706 | }, { | ||
1701 | .alg = "__driver-ecb-cast5-avx", | 1707 | .alg = "__driver-ecb-cast5-avx", |
1702 | .test = alg_test_null, | 1708 | .test = alg_test_null, |
1703 | }, { | 1709 | }, { |
@@ -1978,6 +1984,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1978 | .alg = "cryptd(__driver-cbc-camellia-aesni)", | 1984 | .alg = "cryptd(__driver-cbc-camellia-aesni)", |
1979 | .test = alg_test_null, | 1985 | .test = alg_test_null, |
1980 | }, { | 1986 | }, { |
1987 | .alg = "cryptd(__driver-cbc-camellia-aesni-avx2)", | ||
1988 | .test = alg_test_null, | ||
1989 | }, { | ||
1981 | .alg = "cryptd(__driver-cbc-serpent-avx2)", | 1990 | .alg = "cryptd(__driver-cbc-serpent-avx2)", |
1982 | .test = alg_test_null, | 1991 | .test = alg_test_null, |
1983 | }, { | 1992 | }, { |
@@ -1991,6 +2000,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1991 | .alg = "cryptd(__driver-ecb-camellia-aesni)", | 2000 | .alg = "cryptd(__driver-ecb-camellia-aesni)", |
1992 | .test = alg_test_null, | 2001 | .test = alg_test_null, |
1993 | }, { | 2002 | }, { |
2003 | .alg = "cryptd(__driver-ecb-camellia-aesni-avx2)", | ||
2004 | .test = alg_test_null, | ||
2005 | }, { | ||
1994 | .alg = "cryptd(__driver-ecb-cast5-avx)", | 2006 | .alg = "cryptd(__driver-ecb-cast5-avx)", |
1995 | .test = alg_test_null, | 2007 | .test = alg_test_null, |
1996 | }, { | 2008 | }, { |