OSDN Git Service

crypto: skcipher - remove crypto_skcipher::ivsize
authorEric Biggers <ebiggers@google.com>
Fri, 29 Nov 2019 18:23:03 +0000 (10:23 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:36:56 +0000 (16:36 +0800)
Due to the removal of the blkcipher and ablkcipher algorithm types,
crypto_skcipher::ivsize is now redundant since it always equals
crypto_skcipher_alg(tfm)->ivsize.

Remove it and update crypto_skcipher_ivsize() accordingly.

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

index 13da43c..7d2e722 100644 (file)
@@ -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->ivsize = alg->ivsize;
        skcipher->keysize = alg->max_keysize;
 
        skcipher_set_needkey(skcipher);
index b4655d9..bf656a9 100644 (file)
@@ -40,7 +40,6 @@ struct crypto_skcipher {
        int (*encrypt)(struct skcipher_request *req);
        int (*decrypt)(struct skcipher_request *req);
 
-       unsigned int ivsize;
        unsigned int reqsize;
        unsigned int keysize;
 
@@ -255,7 +254,7 @@ static inline unsigned int crypto_skcipher_alg_ivsize(struct skcipher_alg *alg)
  */
 static inline unsigned int crypto_skcipher_ivsize(struct crypto_skcipher *tfm)
 {
-       return tfm->ivsize;
+       return crypto_skcipher_alg(tfm)->ivsize;
 }
 
 static inline unsigned int crypto_sync_skcipher_ivsize(