diff options
author | Eric Biggers <ebiggers@google.com> | 2019-11-29 10:23:04 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-11 16:36:56 +0800 |
commit | 9ac0d136938ad8b8dd309f833abe5304dd2f0b08 (patch) | |
tree | 61c7ad1c02d24f91a2f82169d090e0dd31c60d5b /crypto/skcipher.c | |
parent | 140734d3711335836cc1b9706d73953750fa4c8d (diff) | |
download | linux-9ac0d136938ad8b8dd309f833abe5304dd2f0b08.tar.gz linux-9ac0d136938ad8b8dd309f833abe5304dd2f0b08.tar.bz2 linux-9ac0d136938ad8b8dd309f833abe5304dd2f0b08.zip |
crypto: skcipher - remove crypto_skcipher::keysize
Due to the removal of the blkcipher and ablkcipher algorithm types,
crypto_skcipher::keysize is now redundant since it always equals
crypto_skcipher_alg(tfm)->max_keysize.
Remove it and update crypto_skcipher_default_keysize() accordingly.
Also rename crypto_skcipher_default_keysize() to
crypto_skcipher_max_keysize() to clarify that it specifically returns
the maximum key size, not some unspecified "default".
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/skcipher.c')
-rw-r--r-- | crypto/skcipher.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c index 7d2e722e82af..6cfafd80c7e6 100644 --- a/crypto/skcipher.c +++ b/crypto/skcipher.c @@ -585,7 +585,7 @@ static unsigned int crypto_skcipher_extsize(struct crypto_alg *alg) static void skcipher_set_needkey(struct crypto_skcipher *tfm) { - if (tfm->keysize) + if (crypto_skcipher_max_keysize(tfm) != 0) crypto_skcipher_set_flags(tfm, CRYPTO_TFM_NEED_KEY); } @@ -686,7 +686,6 @@ static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm) skcipher->setkey = skcipher_setkey; skcipher->encrypt = alg->encrypt; skcipher->decrypt = alg->decrypt; - skcipher->keysize = alg->max_keysize; skcipher_set_needkey(skcipher); |