[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-crypto-vger
Subject:    [PATCH 1/6] crypto: skcipher - remove crypto_skcipher::ivsize
From:       Eric Biggers <ebiggers () kernel ! org>
Date:       2019-11-29 18:23:03
Message-ID: 20191129182308.53961-2-ebiggers () kernel ! org
[Download RAW message or body]

From: Eric Biggers <ebiggers@google.com>

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>
---
 crypto/skcipher.c         | 1 -
 include/crypto/skcipher.h | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index 13da43c84b64..7d2e722e82af 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -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);
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index b4655d91661f..bf656a97cb65 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -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(
-- 
2.24.0

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic