diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-04-13 06:46:45 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-04-25 09:09:04 -0400 |
commit | 604880107010a1e5794552d184cd5471ea31b973 (patch) | |
tree | ed37e3b3e8454f758daab88a2fb9cb5f043ca8ad /crypto | |
parent | ad8b7c3e92868dd86c54d9d5321000bbb4096f0d (diff) |
crypto: blowfish - add AVX2/x86_64 implementation of blowfish cipher
Patch adds AVX2/x86-64 implementation of Blowfish cipher, requiring 32 parallel
blocks for input (256 bytes). Table look-ups are performed using vpgatherdd
instruction directly from vector registers and thus should be faster than
earlier implementations.
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 | 18 | ||||
-rw-r--r-- | crypto/testmgr.c | 12 |
2 files changed, 30 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index 0e7a23723b45..6b9564f91168 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -820,6 +820,24 @@ config CRYPTO_BLOWFISH_X86_64 | |||
820 | See also: | 820 | See also: |
821 | <http://www.schneier.com/blowfish.html> | 821 | <http://www.schneier.com/blowfish.html> |
822 | 822 | ||
823 | config CRYPTO_BLOWFISH_AVX2_X86_64 | ||
824 | tristate "Blowfish cipher algorithm (x86_64/AVX2)" | ||
825 | depends on X86 && 64BIT | ||
826 | select CRYPTO_ALGAPI | ||
827 | select CRYPTO_CRYPTD | ||
828 | select CRYPTO_ABLK_HELPER_X86 | ||
829 | select CRYPTO_BLOWFISH_COMMON | ||
830 | select CRYPTO_BLOWFISH_X86_64 | ||
831 | help | ||
832 | Blowfish cipher algorithm (x86_64/AVX2), by Bruce Schneier. | ||
833 | |||
834 | This is a variable key length cipher which can use keys from 32 | ||
835 | bits to 448 bits in length. It's fast, simple and specifically | ||
836 | designed for use on "large microprocessors". | ||
837 | |||
838 | See also: | ||
839 | <http://www.schneier.com/blowfish.html> | ||
840 | |||
823 | config CRYPTO_CAMELLIA | 841 | config CRYPTO_CAMELLIA |
824 | tristate "Camellia cipher algorithms" | 842 | tristate "Camellia cipher algorithms" |
825 | depends on CRYPTO | 843 | depends on CRYPTO |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 380708477b35..f3effb42531e 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -1655,6 +1655,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1655 | .test = alg_test_null, | 1655 | .test = alg_test_null, |
1656 | .fips_allowed = 1, | 1656 | .fips_allowed = 1, |
1657 | }, { | 1657 | }, { |
1658 | .alg = "__driver-cbc-blowfish-avx2", | ||
1659 | .test = alg_test_null, | ||
1660 | }, { | ||
1658 | .alg = "__driver-cbc-camellia-aesni", | 1661 | .alg = "__driver-cbc-camellia-aesni", |
1659 | .test = alg_test_null, | 1662 | .test = alg_test_null, |
1660 | }, { | 1663 | }, { |
@@ -1677,6 +1680,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1677 | .test = alg_test_null, | 1680 | .test = alg_test_null, |
1678 | .fips_allowed = 1, | 1681 | .fips_allowed = 1, |
1679 | }, { | 1682 | }, { |
1683 | .alg = "__driver-ecb-blowfish-avx2", | ||
1684 | .test = alg_test_null, | ||
1685 | }, { | ||
1680 | .alg = "__driver-ecb-camellia-aesni", | 1686 | .alg = "__driver-ecb-camellia-aesni", |
1681 | .test = alg_test_null, | 1687 | .test = alg_test_null, |
1682 | }, { | 1688 | }, { |
@@ -1948,6 +1954,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1948 | .test = alg_test_null, | 1954 | .test = alg_test_null, |
1949 | .fips_allowed = 1, | 1955 | .fips_allowed = 1, |
1950 | }, { | 1956 | }, { |
1957 | .alg = "cryptd(__driver-cbc-blowfish-avx2)", | ||
1958 | .test = alg_test_null, | ||
1959 | }, { | ||
1951 | .alg = "cryptd(__driver-cbc-camellia-aesni)", | 1960 | .alg = "cryptd(__driver-cbc-camellia-aesni)", |
1952 | .test = alg_test_null, | 1961 | .test = alg_test_null, |
1953 | }, { | 1962 | }, { |
@@ -1955,6 +1964,9 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
1955 | .test = alg_test_null, | 1964 | .test = alg_test_null, |
1956 | .fips_allowed = 1, | 1965 | .fips_allowed = 1, |
1957 | }, { | 1966 | }, { |
1967 | .alg = "cryptd(__driver-ecb-blowfish-avx2)", | ||
1968 | .test = alg_test_null, | ||
1969 | }, { | ||
1958 | .alg = "cryptd(__driver-ecb-camellia-aesni)", | 1970 | .alg = "cryptd(__driver-ecb-camellia-aesni)", |
1959 | .test = alg_test_null, | 1971 | .test = alg_test_null, |
1960 | }, { | 1972 | }, { |