Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: vmx/xts - use fallback for ciphertext stealing

For correctness and compliance with the XTS-AES specification, we are
adding support for ciphertext stealing to XTS implementations, even
though no use cases are known that will be enabled by this.

Since the Power8 implementation already has a fallback skcipher standby
for other purposes, let's use it for this purpose as well. If ciphertext
stealing use cases ever become a bottleneck, we can always revisit this.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ard Biesheuvel and committed by
Herbert Xu
23966841 ce68acbc

+1 -1
+1 -1
drivers/crypto/vmx/aes_xts.c
··· 84 84 u8 tweak[AES_BLOCK_SIZE]; 85 85 int ret; 86 86 87 - if (!crypto_simd_usable()) { 87 + if (!crypto_simd_usable() || (req->cryptlen % XTS_BLOCK_SIZE) != 0) { 88 88 struct skcipher_request *subreq = skcipher_request_ctx(req); 89 89 90 90 *subreq = *req;