diff options
author | Johannes Goetzfried <Johannes.Goetzfried@informatik.stud.uni-erlangen.de> | 2012-05-28 09:54:24 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-06-12 04:46:07 -0400 |
commit | 107778b592576c0c8e8d2ca7a2aa5415a4908223 (patch) | |
tree | 0e07f6abd2acaf69bf25efacf520584d748c860b /crypto/Kconfig | |
parent | 4d03c5047a07a62563e1a8fa798ea258f048bfde (diff) |
crypto: twofish - add x86_64/avx assembler implementation
This patch adds a x86_64/avx assembler implementation of the Twofish block
cipher. The implementation processes eight blocks in parallel (two 4 block
chunk AVX operations). The table-lookups are done in general-purpose registers.
For small blocksizes the 3way-parallel functions from the twofish-x86_64-3way
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)
twofish-avx-x86_64 vs. twofish-x86_64-3way
128bit key: (lrw:256bit) (xts:256bit)
size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
16B 0.96x 0.97x 1.00x 0.95x 0.97x 0.97x 0.96x 0.95x 0.95x 0.98x
64B 0.99x 0.99x 1.00x 0.99x 0.98x 0.98x 0.99x 0.98x 0.99x 0.98x
256B 1.20x 1.21x 1.00x 1.19x 1.15x 1.14x 1.19x 1.20x 1.18x 1.19x
1024B 1.29x 1.30x 1.00x 1.28x 1.23x 1.24x 1.26x 1.28x 1.26x 1.27x
8192B 1.31x 1.32x 1.00x 1.31x 1.25x 1.25x 1.28x 1.29x 1.28x 1.30x
256bit key: (lrw:384bit) (xts:512bit)
size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
16B 0.96x 0.96x 1.00x 0.96x 0.97x 0.98x 0.95x 0.95x 0.95x 0.96x
64B 1.00x 0.99x 1.00x 0.98x 0.98x 1.01x 0.98x 0.98x 0.98x 0.98x
256B 1.20x 1.21x 1.00x 1.21x 1.15x 1.15x 1.19x 1.20x 1.18x 1.19x
1024B 1.29x 1.30x 1.00x 1.28x 1.23x 1.23x 1.26x 1.27x 1.26x 1.27x
8192B 1.31x 1.33x 1.00x 1.31x 1.26x 1.26x 1.29x 1.29x 1.28x 1.30x
twofish-avx-x86_64 vs aes-asm (8kB block):
128bit 256bit
ecb-enc 1.19x 1.63x
ecb-dec 1.18x 1.62x
cbc-enc 0.75x 1.03x
cbc-dec 1.23x 1.67x
ctr-enc 1.24x 1.65x
ctr-dec 1.24x 1.65x
lrw-enc 1.15x 1.53x
lrw-dec 1.14x 1.52x
xts-enc 1.16x 1.56x
xts-dec 1.16x 1.56x
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 | 24 |
1 files changed, 24 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 | ||
916 | config 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 | |||
916 | comment "Compression" | 940 | comment "Compression" |
917 | 941 | ||
918 | config CRYPTO_DEFLATE | 942 | config CRYPTO_DEFLATE |