crypto: bcm - remove unused function do_decrypt()
authorEric Biggers <ebiggers@google.com>
Sat, 19 Jan 2019 02:26:42 +0000 (18:26 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Jan 2019 10:41:52 +0000 (18:41 +0800)
The do_decrypt() function in util.c in the BCM crypto driver is never
used, so remove it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/bcm/util.c
drivers/crypto/bcm/util.h

index a912c6ad3e850bbe544338032b105de40508b281..d8cda5fb75ad8badd5a3fa3a2e25280acb8a5dd8 100644 (file)
@@ -201,46 +201,6 @@ struct sdesc {
        char ctx[];
 };
 
-/* do a synchronous decrypt operation */
-int do_decrypt(char *alg_name,
-              void *key_ptr, unsigned int key_len,
-              void *iv_ptr, void *src_ptr, void *dst_ptr,
-              unsigned int block_len)
-{
-       struct scatterlist sg_in[1], sg_out[1];
-       struct crypto_blkcipher *tfm =
-           crypto_alloc_blkcipher(alg_name, 0, CRYPTO_ALG_ASYNC);
-       struct blkcipher_desc desc = {.tfm = tfm, .flags = 0 };
-       int ret = 0;
-       void *iv;
-       int ivsize;
-
-       flow_log("%s() name:%s block_len:%u\n", __func__, alg_name, block_len);
-
-       if (IS_ERR(tfm))
-               return PTR_ERR(tfm);
-
-       crypto_blkcipher_setkey((void *)tfm, key_ptr, key_len);
-
-       sg_init_table(sg_in, 1);
-       sg_set_buf(sg_in, src_ptr, block_len);
-
-       sg_init_table(sg_out, 1);
-       sg_set_buf(sg_out, dst_ptr, block_len);
-
-       iv = crypto_blkcipher_crt(tfm)->iv;
-       ivsize = crypto_blkcipher_ivsize(tfm);
-       memcpy(iv, iv_ptr, ivsize);
-
-       ret = crypto_blkcipher_decrypt(&desc, sg_out, sg_in, block_len);
-       crypto_free_blkcipher(tfm);
-
-       if (ret < 0)
-               pr_err("aes_decrypt failed %d\n", ret);
-
-       return ret;
-}
-
 /**
  * do_shash() - Do a synchronous hash operation in software
  * @name:       The name of the hash algorithm
index 712e029795f86fdee0bb5331fd5a927411b093ee..15c60356518aea90f2729286dfb567070e107c0c 100644 (file)
@@ -95,12 +95,6 @@ u32 spu_msg_sg_add(struct scatterlist **to_sg,
 
 void add_to_ctr(u8 *ctr_pos, unsigned int increment);
 
-/* do a synchronous decrypt operation */
-int do_decrypt(char *alg_name,
-              void *key_ptr, unsigned int key_len,
-              void *iv_ptr, void *src_ptr, void *dst_ptr,
-              unsigned int block_len);
-
 /* produce a message digest from data of length n bytes */
 int do_shash(unsigned char *name, unsigned char *result,
             const u8 *data1, unsigned int data1_len,