OSDN Git Service

crypto: aesni - support 256 byte keys in avx asm
authorDave Watson <davejwatson@fb.com>
Mon, 10 Dec 2018 19:57:36 +0000 (19:57 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 23 Dec 2018 03:52:42 +0000 (11:52 +0800)
commit5350b0f563433dacc134214a452fd316b36251d6
treeded02233d76bb75a3ca8274c69e80f2dd2bfad44
parent2426f64bc51fc86951b735d2247d6eb89259d580
crypto: aesni - support 256 byte keys in avx asm

Add support for 192/256-bit keys using the avx gcm/aes routines.
The sse routines were previously updated in e31ac32d3b (Add support
for 192 & 256 bit keys to AESNI RFC4106).

Instead of adding an additional loop in the hotpath as in e31ac32d3b,
this diff instead generates separate versions of the code using macros,
and the entry routines choose which version once.   This results
in a 5% performance improvement vs. adding a loop to the hot path.
This is the same strategy chosen by the intel isa-l_crypto library.

The key size checks are removed from the c code where appropriate.

Note that this diff depends on using gcm_context_data - 256 bit keys
require 16 HashKeys + 15 expanded keys, which is larger than
struct crypto_aes_ctx, so they are stored in struct gcm_context_data.

Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_avx-x86_64.S
arch/x86/crypto/aesni-intel_glue.c