Commit 0a4491d3 authored by Atul Gupta's avatar Atul Gupta Committed by Herbert Xu

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: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 33ddc108
...@@ -1094,8 +1094,8 @@ static int chcr_final_cipher_iv(struct ablkcipher_request *req, ...@@ -1094,8 +1094,8 @@ static int chcr_final_cipher_iv(struct ablkcipher_request *req,
int ret = 0; int ret = 0;
if (subtype == CRYPTO_ALG_SUB_TYPE_CTR) if (subtype == CRYPTO_ALG_SUB_TYPE_CTR)
ctr_add_iv(iv, req->info, (reqctx->processed / ctr_add_iv(iv, req->info, DIV_ROUND_UP(reqctx->processed,
AES_BLOCK_SIZE)); AES_BLOCK_SIZE));
else if (subtype == CRYPTO_ALG_SUB_TYPE_XTS) else if (subtype == CRYPTO_ALG_SUB_TYPE_XTS)
ret = chcr_update_tweak(req, iv, 1); ret = chcr_update_tweak(req, iv, 1);
else if (subtype == CRYPTO_ALG_SUB_TYPE_CBC) { else if (subtype == CRYPTO_ALG_SUB_TYPE_CBC) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment