summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-11-29 10:23:05 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-11 16:36:56 +0800
commit76aaaa2bf1610be7704d4a8c51f3cf842acd0b5d (patch)
treea6a1c73bdcec3829d19553ffb69ea6bc7d854695
parent332d314e25825a5dd6548664d427bfac49409af1 (diff)
downloadlinux-crypto-76aaaa2bf1610be7704d4a8c51f3cf842acd0b5d.tar.gz
linux-crypto-76aaaa2bf1610be7704d4a8c51f3cf842acd0b5d.zip
crypto: skcipher - remove crypto_skcipher::setkey
Due to the removal of the blkcipher and ablkcipher algorithm types, crypto_skcipher::setkey now always points to skcipher_setkey(). Simplify by removing this function pointer and instead just making skcipher_setkey() be crypto_skcipher_setkey() directly. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/skcipher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index 6cfafd80..4197b5ed 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -610,7 +610,7 @@ static int skcipher_setkey_unaligned(struct crypto_skcipher *tfm,
return ret;
}
-static int skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
+int crypto_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
unsigned int keylen)
{
struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
@@ -635,6 +635,7 @@ static int skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
crypto_skcipher_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
return 0;
}
+EXPORT_SYMBOL_GPL(crypto_skcipher_setkey);
int crypto_skcipher_encrypt(struct skcipher_request *req)
{
@@ -683,7 +684,6 @@ static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm)
struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
struct skcipher_alg *alg = crypto_skcipher_alg(skcipher);
- skcipher->setkey = skcipher_setkey;
skcipher->encrypt = alg->encrypt;
skcipher->decrypt = alg->decrypt;