kernel-hacking-2024-linux-s.../arch/x86/crypto
Johannes Goetzfried 7efe407672 crypto: serpent - add x86_64/avx assembler implementation
This patch adds a x86_64/avx assembler implementation of the Serpent block
cipher. The implementation is very similar to the sse2 implementation and
processes eight blocks in parallel. Because of the new non-destructive three
operand syntax all move-instructions can be removed and therefore a little
performance increase is provided.

Patch has been tested with tcrypt and automated filesystem tests.

Tcrypt benchmark results:

Intel Core i5-2500 CPU (fam:6, model:42, step:7)

serpent-avx-x86_64 vs. serpent-sse2-x86_64
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     1.03x   1.01x   1.01x   1.01x   1.00x   1.00x   1.00x   1.00x   1.00x   1.01x
64B     1.00x   1.00x   1.00x   1.00x   1.00x   0.99x   1.00x   1.01x   1.00x   1.00x
256B    1.05x   1.03x   1.00x   1.02x   1.05x   1.06x   1.05x   1.02x   1.05x   1.02x
1024B   1.05x   1.02x   1.00x   1.02x   1.05x   1.06x   1.05x   1.03x   1.05x   1.02x
8192B   1.05x   1.02x   1.00x   1.02x   1.06x   1.06x   1.04x   1.03x   1.04x   1.02x

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     1.01x   1.00x   1.01x   1.01x   1.00x   1.00x   0.99x   1.03x   1.01x   1.01x
64B     1.00x   1.00x   1.00x   1.00x   1.00x   1.00x   1.00x   1.01x   1.00x   1.02x
256B    1.05x   1.02x   1.00x   1.02x   1.05x   1.02x   1.04x   1.05x   1.05x   1.02x
1024B   1.06x   1.02x   1.00x   1.02x   1.07x   1.06x   1.05x   1.04x   1.05x   1.02x
8192B   1.05x   1.02x   1.00x   1.02x   1.06x   1.06x   1.04x   1.05x   1.05x   1.02x

serpent-avx-x86_64 vs aes-asm (8kB block):
         128bit  256bit
ecb-enc  1.26x   1.73x
ecb-dec  1.20x   1.64x
cbc-enc  0.33x   0.45x
cbc-dec  1.24x   1.67x
ctr-enc  1.32x   1.76x
ctr-dec  1.32x   1.76x
lrw-enc  1.20x   1.60x
lrw-dec  1.15x   1.54x
xts-enc  1.22x   1.64x
xts-dec  1.17x   1.57x

Signed-off-by: Johannes Goetzfried <Johannes.Goetzfried@informatik.stud.uni-erlangen.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-06-12 16:47:43 +08:00
..
aes-i586-asm_32.S
aes-x86_64-asm_64.S
aes_glue.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
aesni-intel_asm.S crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 2012-05-31 20:53:22 +10:00
aesni-intel_glue.c crypto: aesni-intel - move more common code to ablk_init_common 2012-05-15 17:25:33 +10:00
blowfish-x86_64-asm_64.S crypto: blowfish-x86_64 - improve x86_64 blowfish 4-way performance 2011-10-21 14:23:07 +02:00
blowfish_glue.c crypto: blowfish-x86_64 - set alignmask to zero 2012-02-25 17:20:24 +08:00
camellia-x86_64-asm_64.S crypto: camellia - add assembler implementation for x86_64 2012-03-14 17:25:56 +08:00
camellia_glue.c crypto: camellia-x86_64 - module init/exit functions should be static 2012-03-22 09:17:44 +08:00
crc32c-intel.c crypto: Add support for x86 cpuid auto loading for x86 crypto drivers 2012-01-26 16:48:10 -08:00
fpu.c
ghash-clmulni-intel_asm.S
ghash-clmulni-intel_glue.c crypto: Add support for x86 cpuid auto loading for x86 crypto drivers 2012-01-26 16:48:10 -08:00
Makefile crypto: serpent - add x86_64/avx assembler implementation 2012-06-12 16:47:43 +08:00
salsa20-i586-asm_32.S
salsa20-x86_64-asm_64.S
salsa20_glue.c
serpent-avx-x86_64-asm_64.S crypto: serpent - add x86_64/avx assembler implementation 2012-06-12 16:47:43 +08:00
serpent-sse2-i586-asm_32.S crypto: serpent-sse2 - change transpose_4x4 to only use integer instructions 2012-01-13 16:38:40 +11:00
serpent-sse2-x86_64-asm_64.S crypto: serpent-sse2 - change transpose_4x4 to only use integer instructions 2012-01-13 16:38:40 +11:00
serpent_avx_glue.c crypto: serpent - add x86_64/avx assembler implementation 2012-06-12 16:47:43 +08:00
serpent_sse2_glue.c crypto: serpent-sse2 - combine ablk_*_init functions 2012-02-25 17:20:23 +08:00
sha1_ssse3_asm.S crypto: sha1 - use Kbuild supplied flags for AVX test 2012-06-12 16:37:16 +08:00
sha1_ssse3_glue.c crypto: sha1 - use Kbuild supplied flags for AVX test 2012-06-12 16:37:16 +08:00
twofish-avx-x86_64-asm_64.S crypto: twofish - add x86_64/avx assembler implementation 2012-06-12 16:46:07 +08:00
twofish-i586-asm_32.S crypto: twofish-x86-asm - make assembler functions use twofish_ctx instead of crypto_tfm 2011-10-21 14:23:08 +02:00
twofish-x86_64-asm_64-3way.S crypto: twofish - add 3-way parallel x86_64 assembler implemention 2011-10-21 14:23:08 +02:00
twofish-x86_64-asm_64.S crypto: twofish-x86-asm - make assembler functions use twofish_ctx instead of crypto_tfm 2011-10-21 14:23:08 +02:00
twofish_avx_glue.c crypto: twofish - add x86_64/avx assembler implementation 2012-06-12 16:46:07 +08:00
twofish_glue.c crypto: twofish-x86_64/i586 - set alignmask to zero 2012-02-25 17:20:24 +08:00
twofish_glue_3way.c crypto: twofish - add x86_64/avx assembler implementation 2012-06-12 16:46:07 +08:00