diff options
author | Johannes Goetzfried <Johannes.Goetzfried@informatik.stud.uni-erlangen.de> | 2012-07-11 13:37:37 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-08-01 05:47:30 -0400 |
commit | 4d6d6a2c850f89bc9283d02519cb536baba72032 (patch) | |
tree | 8433747260d88000d79849bcd4db0e56b86aa6e4 /crypto/Kconfig | |
parent | a2c5826095562983bf316e3a7eb137ef04a71a24 (diff) |
crypto: cast5 - add x86_64/avx assembler implementation
This patch adds a x86_64/avx assembler implementation of the Cast5 block
cipher. The implementation processes sixteen blocks in parallel (four 4 block
chunk AVX operations). The table-lookups are done in general-purpose registers.
For small blocksizes the functions from the generic module are called. A good
performance increase is provided for blocksizes greater or equal to 128B.
Patch has been tested with tcrypt and automated filesystem tests.
Tcrypt benchmark results:
Intel Core i5-2500 CPU (fam:6, model:42, step:7)
cast5-avx-x86_64 vs. cast5-generic
64bit key:
size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
16B 0.99x 0.99x 1.00x 1.00x 1.02x 1.01x
64B 1.00x 1.00x 0.98x 1.00x 1.01x 1.02x
256B 2.03x 2.01x 0.95x 2.11x 2.12x 2.13x
1024B 2.30x 2.24x 0.95x 2.29x 2.35x 2.35x
8192B 2.31x 2.27x 0.95x 2.31x 2.39x 2.39x
128bit key:
size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
16B 0.99x 0.99x 1.00x 1.00x 1.01x 1.01x
64B 1.00x 1.00x 0.98x 1.01x 1.02x 1.01x
256B 2.17x 2.13x 0.96x 2.19x 2.19x 2.19x
1024B 2.29x 2.32x 0.95x 2.34x 2.37x 2.38x
8192B 2.35x 2.32x 0.95x 2.35x 2.39x 2.39x
Signed-off-by: Johannes Goetzfried <Johannes.Goetzfried@informatik.stud.uni-erlangen.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/Kconfig')
-rw-r--r-- | crypto/Kconfig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index a3238051b03e..cda97fcaa822 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -692,6 +692,20 @@ config CRYPTO_CAST5 | |||
692 | The CAST5 encryption algorithm (synonymous with CAST-128) is | 692 | The CAST5 encryption algorithm (synonymous with CAST-128) is |
693 | described in RFC2144. | 693 | described in RFC2144. |
694 | 694 | ||
695 | config CRYPTO_CAST5_AVX_X86_64 | ||
696 | tristate "CAST5 (CAST-128) cipher algorithm (x86_64/AVX)" | ||
697 | depends on X86 && 64BIT | ||
698 | select CRYPTO_ALGAPI | ||
699 | select CRYPTO_CRYPTD | ||
700 | select CRYPTO_ABLK_HELPER_X86 | ||
701 | select CRYPTO_CAST5 | ||
702 | help | ||
703 | The CAST5 encryption algorithm (synonymous with CAST-128) is | ||
704 | described in RFC2144. | ||
705 | |||
706 | This module provides the Cast5 cipher algorithm that processes | ||
707 | sixteen blocks parallel using the AVX instruction set. | ||
708 | |||
695 | config CRYPTO_CAST6 | 709 | config CRYPTO_CAST6 |
696 | tristate "CAST6 (CAST-256) cipher algorithm" | 710 | tristate "CAST6 (CAST-256) cipher algorithm" |
697 | select CRYPTO_ALGAPI | 711 | select CRYPTO_ALGAPI |