aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/Kconfig
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2011-08-04 14:19:25 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2011-08-10 07:00:29 -0400
commit66be895158886a6cd816aa1eaa18965a5c522d8f (patch)
tree2eee685d2249cd5973e15303b8101df7c956e607 /crypto/Kconfig
parent7c390170b49337477985be7a624015160ffeb056 (diff)
crypto: sha1 - SSSE3 based SHA1 implementation for x86-64
This is an assembler implementation of the SHA1 algorithm using the Supplemental SSE3 (SSSE3) instructions or, when available, the Advanced Vector Extensions (AVX). Testing with the tcrypt module shows the raw hash performance is up to 2.3 times faster than the C implementation, using 8k data blocks on a Core 2 Duo T5500. For the smalest data set (16 byte) it is still 25% faster. Since this implementation uses SSE/YMM registers it cannot safely be used in every situation, e.g. while an IRQ interrupts a kernel thread. The implementation falls back to the generic SHA1 variant, if using the SSE/YMM registers is not possible. With this algorithm I was able to increase the throughput of a single IPsec link from 344 Mbit/s to 464 Mbit/s on a Core 2 Quad CPU using the SSSE3 variant -- a speedup of +34.8%. Saving and restoring SSE/YMM state might make the actual throughput fluctuate when there are FPU intensive userland applications running. For example, meassuring the performance using iperf2 directly on the machine under test gives wobbling numbers because iperf2 uses the FPU for each packet to check if the reporting interval has expired (in the above test I got min/max/avg: 402/484/464 MBit/s). Using this algorithm on a IPsec gateway gives much more reasonable and stable numbers, albeit not as high as in the directly connected case. Here is the result from an RFC 2544 test run with a EXFO Packet Blazer FTB-8510: frame size sha1-generic sha1-ssse3 delta 64 byte 37.5 MBit/s 37.5 MBit/s 0.0% 128 byte 56.3 MBit/s 62.5 MBit/s +11.0% 256 byte 87.5 MBit/s 100.0 MBit/s +14.3% 512 byte 131.3 MBit/s 150.0 MBit/s +14.2% 1024 byte 162.5 MBit/s 193.8 MBit/s +19.3% 1280 byte 175.0 MBit/s 212.5 MBit/s +21.4% 1420 byte 175.0 MBit/s 218.7 MBit/s +25.0% 1518 byte 150.0 MBit/s 181.2 MBit/s +20.8% The throughput for the largest frame size is lower than for the previous size because the IP packets need to be fragmented in this case to make there way through the IPsec tunnel. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Maxim Locktyukhin <maxim.locktyukhin@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/Kconfig')
-rw-r--r--crypto/Kconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index ae27b7534ea7..55c50cd34690 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -407,6 +407,16 @@ config CRYPTO_SHA1
407 help 407 help
408 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). 408 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
409 409
410config CRYPTO_SHA1_SSSE3
411 tristate "SHA1 digest algorithm (SSSE3/AVX)"
412 depends on X86 && 64BIT
413 select CRYPTO_SHA1
414 select CRYPTO_HASH
415 help
416 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
417 using Supplemental SSE3 (SSSE3) instructions or Advanced Vector
418 Extensions (AVX), when available.
419
410config CRYPTO_SHA256 420config CRYPTO_SHA256
411 tristate "SHA224 and SHA256 digest algorithm" 421 tristate "SHA224 and SHA256 digest algorithm"
412 select CRYPTO_HASH 422 select CRYPTO_HASH