OSDN Git Service

crypto: x86/aes-ni-xts - rewrite and drop indirections via glue helper
authorArd Biesheuvel <ardb@kernel.org>
Thu, 31 Dec 2020 16:41:55 +0000 (17:41 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Jan 2021 04:39:47 +0000 (15:39 +1100)
commit2481104fe98d5b016fdd95d649b1235f21e491ba
tree80bf424a7f5f59815c5959369f0c6d69a9795fcc
parent86ad60a65f29dd862a11c22bb4b5be28d6c5cef1
crypto: x86/aes-ni-xts - rewrite and drop indirections via glue helper

The AES-NI driver implements XTS via the glue helper, which consumes
a struct with sets of function pointers which are invoked on chunks
of input data of the appropriate size, as annotated in the struct.

Let's get rid of this indirection, so that we can perform direct calls
to the assembler helpers. Instead, let's adopt the arm64 strategy, i.e.,
provide a helper which can consume inputs of any size, provided that the
penultimate, full block is passed via the last call if ciphertext stealing
needs to be applied.

This also allows us to enable the XTS mode for i386.

Tested-by: Eric Biggers <ebiggers@google.com> # x86_64
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_asm.S
arch/x86/crypto/aesni-intel_glue.c
crypto/Kconfig