aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtul Gupta <atul.gupta@chelsio.com>2019-05-02 06:47:57 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2019-05-09 01:17:23 -0400
commit0a4491d3febe0b8c328870d1909fc91756970237 (patch)
treefeb81db64518c27c77570fee471f84b99cd44253
parent33ddc108c5a1cfba72a08a92f35a0ba5bbd1cfd8 (diff)
crypto: chelsio - count incomplete block in IV
The partial block should count as one and appropriately appended to IV. eg 499B for AES CTR should count 32 block than 31 and correct count value is updated in iv out. Signed-off-by: Atul Gupta <atul.gupta@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/chelsio/chcr_algo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 73bbd499b6ff..177f572b9589 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -1094,8 +1094,8 @@ static int chcr_final_cipher_iv(struct ablkcipher_request *req,
1094 int ret = 0; 1094 int ret = 0;
1095 1095
1096 if (subtype == CRYPTO_ALG_SUB_TYPE_CTR) 1096 if (subtype == CRYPTO_ALG_SUB_TYPE_CTR)
1097 ctr_add_iv(iv, req->info, (reqctx->processed / 1097 ctr_add_iv(iv, req->info, DIV_ROUND_UP(reqctx->processed,
1098 AES_BLOCK_SIZE)); 1098 AES_BLOCK_SIZE));
1099 else if (subtype == CRYPTO_ALG_SUB_TYPE_XTS) 1099 else if (subtype == CRYPTO_ALG_SUB_TYPE_XTS)
1100 ret = chcr_update_tweak(req, iv, 1); 1100 ret = chcr_update_tweak(req, iv, 1);
1101 else if (subtype == CRYPTO_ALG_SUB_TYPE_CBC) { 1101 else if (subtype == CRYPTO_ALG_SUB_TYPE_CBC) {