MLK-22039: Revert "MLK-14611 Fix CBC mode support by returning a correct IV"
authorHoria Geantă <horia.geanta@nxp.com>
Tue, 2 Jul 2019 15:40:26 +0000 (18:40 +0300)
committerHoria Geantă <horia.geanta@nxp.com>
Fri, 5 Jul 2019 14:59:44 +0000 (17:59 +0300)
This reverts commit 618cb36b4c141a7a03a0ae3a6606843667619118.

This commit is no longer needed, since issue is fixed by
commit 854b06f76879 ("crypto: caam - properly set IV after {en,de}crypt")
which is already in the tree, plus commits
ed527b13d800 ("crypto: caam - limit output IV to CBC to work around CTR mode DMA issue")
059d73eea640 ("crypto: caam - use len instead of nents for bulding HW S/G table")
334d37c9e263 ("crypto: caam - update IV using HW support")
that are upstream and will be backported.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
drivers/crypto/caam/caamalg.c

index 082553e..4a8bea7 100644 (file)
@@ -991,10 +991,7 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
        struct ablkcipher_request *req = context;
        struct ablkcipher_edesc *edesc;
        struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
-       struct caam_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
-       int bsize = crypto_ablkcipher_blocksize(ablkcipher);
        int ivsize = crypto_ablkcipher_ivsize(ablkcipher);
-       size_t ivcopy = min_t(size_t, bsize, ivsize);
 
 #ifdef DEBUG
        dev_err(jrdev, "%s %d: err 0x%x\n", __func__, __LINE__, err);
@@ -1038,12 +1035,6 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
 
        kfree(edesc);
 
-       /* Pass IV along for cbc */
-       if ((ctx->cdata.algtype & OP_ALG_AAI_MASK) == OP_ALG_AAI_CBC) {
-               scatterwalk_map_and_copy(req->info, req->dst,
-                                        req->nbytes - bsize, ivcopy, 0);
-       }
-
        ablkcipher_request_complete(req, err);
 }