OSDN Git Service

crypto: aesni - implement support for cts(cbc(aes))
authorArd Biesheuvel <ardb@kernel.org>
Mon, 7 Dec 2020 23:34:02 +0000 (00:34 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 2 Jan 2021 21:41:34 +0000 (08:41 +1100)
commitddf169a98f01d6fd46295ec0dd4c1d6385be65d4
tree67811b959d2e4af9d06d09be2b60774cba7404d8
parenta417178abc4ae2517231ee67a1291d58929fade1
crypto: aesni - implement support for cts(cbc(aes))

Follow the same approach as the arm64 driver for implementing a version
of AES-NI in CBC mode that supports ciphertext stealing. This results in
a ~2x speed increase for relatively short inputs (less than 256 bytes),
which is relevant given that AES-CBC with ciphertext stealing is used
for filename encryption in the fscrypt layer. For larger inputs, the
speedup is still significant (~25% on decryption, ~6% on encryption)

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