diff mbox series

crypto: ccp - invoke fallback for XTS ciphertext stealing

Message ID 20190822154731.13301-1-ard.biesheuvel@linaro.org
State Accepted
Commit c03a509304954c5ed58ac9c607e20f1b55f88a28
Headers show
Series crypto: ccp - invoke fallback for XTS ciphertext stealing | expand

Commit Message

Ard Biesheuvel Aug. 22, 2019, 3:47 p.m. UTC
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 ccp driver already has a fallback skcipher standby for
dealing with input sizes other than [16, 512, 1024, 2048, 4096],
just drop the check against the block size.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gary Hook <gary.hook@amd.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 drivers/crypto/ccp/ccp-crypto-aes-xts.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
2.17.1

Comments

Herbert Xu Aug. 30, 2019, 8:24 a.m. UTC | #1
On Thu, Aug 22, 2019 at 06:47:31PM +0300, Ard Biesheuvel wrote:
> 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 ccp driver already has a fallback skcipher standby for

> dealing with input sizes other than [16, 512, 1024, 2048, 4096],

> just drop the check against the block size.

> 

> Cc: Tom Lendacky <thomas.lendacky@amd.com>

> Cc: Gary Hook <gary.hook@amd.com>

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  drivers/crypto/ccp/ccp-crypto-aes-xts.c | 3 ---

>  1 file changed, 3 deletions(-)


Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
index 783ba75e0618..8e4a531f4f70 100644
--- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c
+++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
@@ -116,9 +116,6 @@  static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
 	if (!ctx->u.aes.key_len)
 		return -EINVAL;
 
-	if (req->nbytes & (AES_BLOCK_SIZE - 1))
-		return -EINVAL;
-
 	if (!req->info)
 		return -EINVAL;