OSDN Git Service

crypto: ccree - remove cipher ivgen left overs
authorGilad Ben-Yossef <gilad@benyossef.com>
Tue, 24 Jul 2018 14:12:44 +0000 (15:12 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Aug 2018 10:06:05 +0000 (18:06 +0800)
IV generation is not available via the skcipher interface.
Remove the left over support of it from the ablkcipher days.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_buffer_mgr.c
drivers/crypto/ccree/cc_cipher.c
drivers/crypto/ccree/cc_cipher.h

index b325774..dd948e1 100644 (file)
@@ -454,9 +454,7 @@ void cc_unmap_cipher_request(struct device *dev, void *ctx,
                dev_dbg(dev, "Unmapped iv: iv_dma_addr=%pad iv_size=%u\n",
                        &req_ctx->gen_ctx.iv_dma_addr, ivsize);
                dma_unmap_single(dev, req_ctx->gen_ctx.iv_dma_addr,
-                                ivsize,
-                                req_ctx->is_giv ? DMA_BIDIRECTIONAL :
-                                DMA_TO_DEVICE);
+                                ivsize, DMA_TO_DEVICE);
        }
        /* Release pool */
        if (req_ctx->dma_buf_type == CC_DMA_BUF_MLLI &&
@@ -498,9 +496,7 @@ int cc_map_cipher_request(struct cc_drvdata *drvdata, void *ctx,
                dump_byte_array("iv", (u8 *)info, ivsize);
                req_ctx->gen_ctx.iv_dma_addr =
                        dma_map_single(dev, (void *)info,
-                                      ivsize,
-                                      req_ctx->is_giv ? DMA_BIDIRECTIONAL :
-                                      DMA_TO_DEVICE);
+                                      ivsize, DMA_TO_DEVICE);
                if (dma_mapping_error(dev, req_ctx->gen_ctx.iv_dma_addr)) {
                        dev_err(dev, "Mapping iv %u B at va=%pK for DMA failed\n",
                                ivsize, info);
index eb99633..64740dd 100644 (file)
@@ -743,14 +743,6 @@ static int cc_cipher_process(struct skcipher_request *req,
        cc_setup_cipher_data(tfm, req_ctx, dst, src, nbytes, req, desc,
                             &seq_len);
 
-       /* do we need to generate IV? */
-       if (req_ctx->is_giv) {
-               cc_req.ivgen_dma_addr[0] = req_ctx->gen_ctx.iv_dma_addr;
-               cc_req.ivgen_dma_addr_len = 1;
-               /* set the IV size (8/16 B long)*/
-               cc_req.ivgen_size = ivsize;
-       }
-
        /* STAT_PHASE_3: Lock HW and push sequence */
 
        rc = cc_send_request(ctx_p->drvdata, &cc_req, desc, seq_len,
@@ -775,7 +767,6 @@ static int cc_cipher_encrypt(struct skcipher_request *req)
 {
        struct cipher_req_ctx *req_ctx = skcipher_request_ctx(req);
 
-       req_ctx->is_giv = false;
        req_ctx->backup_info = NULL;
 
        return cc_cipher_process(req, DRV_CRYPTO_DIRECTION_ENCRYPT);
@@ -807,8 +798,6 @@ static int cc_cipher_decrypt(struct skcipher_request *req)
                req_ctx->backup_info = NULL;
        }
 
-       req_ctx->is_giv = false;
-
        return cc_cipher_process(req, DRV_CRYPTO_DIRECTION_DECRYPT);
 }
 
index 68444cf..4dbc0a1 100644 (file)
@@ -22,7 +22,6 @@ struct cipher_req_ctx {
        u32 out_mlli_nents;
        u8 *backup_info; /*store iv for generated IV flow*/
        u8 *iv;
-       bool is_giv;
        struct mlli_params mlli_params;
 };