aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/vmx
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-08-16 17:06:24 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-08-22 14:57:34 +1000
commit23966841934908ad4ef997231f1fdd1f9a9d0f42 (patch)
tree6f5e252ea8bebdaa624098222e7172415c4b22fb /drivers/crypto/vmx
parentcrypto: s390/xts-aes - invoke fallback for ciphertext stealing (diff)
downloadlinux-dev-23966841934908ad4ef997231f1fdd1f9a9d0f42.tar.xz
linux-dev-23966841934908ad4ef997231f1fdd1f9a9d0f42.zip
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>
Diffstat (limited to 'drivers/crypto/vmx')
-rw-r--r--drivers/crypto/vmx/aes_xts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/vmx/aes_xts.c b/drivers/crypto/vmx/aes_xts.c
index 49f7258045fa..d59e736882f6 100644
--- a/drivers/crypto/vmx/aes_xts.c
+++ b/drivers/crypto/vmx/aes_xts.c
@@ -84,7 +84,7 @@ static int p8_aes_xts_crypt(struct skcipher_request *req, int enc)
u8 tweak[AES_BLOCK_SIZE];
int ret;
- if (!crypto_simd_usable()) {
+ if (!crypto_simd_usable() || (req->cryptlen % XTS_BLOCK_SIZE) != 0) {
struct skcipher_request *subreq = skcipher_request_ctx(req);
*subreq = *req;