All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: [PATCH 16/16] crypto: skcipher - Remove obsolete skcipher_alg helpers
Date: Tue,  3 Oct 2023 11:43:33 +0800	[thread overview]
Message-ID: <20231003034333.1441826-17-herbert@gondor.apana.org.au> (raw)
In-Reply-To: <20231003034333.1441826-1-herbert@gondor.apana.org.au>

As skcipher spawn users can no longer assume the spawn is of type
struct skcipher_alg, these helpers are no longer used.  Remove them.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
 include/crypto/internal/skcipher.h | 42 ------------------------------
 include/crypto/skcipher.h          | 25 +-----------------
 2 files changed, 1 insertion(+), 66 deletions(-)

diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index c767b5cfbd9c..7ae42afdcf3e 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -148,12 +148,6 @@ static inline void crypto_drop_lskcipher(struct crypto_lskcipher_spawn *spawn)
 	crypto_drop_spawn(&spawn->base);
 }
 
-static inline struct skcipher_alg *crypto_skcipher_spawn_alg(
-	struct crypto_skcipher_spawn *spawn)
-{
-	return container_of(spawn->base.alg, struct skcipher_alg, base);
-}
-
 static inline struct lskcipher_alg *crypto_lskcipher_spawn_alg(
 	struct crypto_lskcipher_spawn *spawn)
 {
@@ -166,12 +160,6 @@ static inline struct skcipher_alg_common *crypto_spawn_skcipher_alg_common(
 	return container_of(spawn->base.alg, struct skcipher_alg_common, base);
 }
 
-static inline struct skcipher_alg *crypto_spawn_skcipher_alg(
-	struct crypto_skcipher_spawn *spawn)
-{
-	return crypto_skcipher_spawn_alg(spawn);
-}
-
 static inline struct lskcipher_alg *crypto_spawn_lskcipher_alg(
 	struct crypto_lskcipher_spawn *spawn)
 {
@@ -269,36 +257,6 @@ static inline u32 skcipher_request_flags(struct skcipher_request *req)
 	return req->base.flags;
 }
 
-static inline unsigned int crypto_skcipher_alg_min_keysize(
-	struct skcipher_alg *alg)
-{
-	return alg->min_keysize;
-}
-
-static inline unsigned int crypto_skcipher_alg_max_keysize(
-	struct skcipher_alg *alg)
-{
-	return alg->max_keysize;
-}
-
-static inline unsigned int crypto_skcipher_alg_walksize(
-	struct skcipher_alg *alg)
-{
-	return alg->walksize;
-}
-
-static inline unsigned int crypto_lskcipher_alg_min_keysize(
-	struct lskcipher_alg *alg)
-{
-	return alg->co.min_keysize;
-}
-
-static inline unsigned int crypto_lskcipher_alg_max_keysize(
-	struct lskcipher_alg *alg)
-{
-	return alg->co.max_keysize;
-}
-
 /* Helpers for simple block cipher modes of operation */
 struct skcipher_ctx_simple {
 	struct crypto_cipher *cipher;	/* underlying block cipher */
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index a648ef5ce897..ea18af48346b 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -395,17 +395,6 @@ static inline struct lskcipher_alg *crypto_lskcipher_alg(
 			    struct lskcipher_alg, co.base);
 }
 
-static inline unsigned int crypto_skcipher_alg_ivsize(struct skcipher_alg *alg)
-{
-	return alg->ivsize;
-}
-
-static inline unsigned int crypto_lskcipher_alg_ivsize(
-	struct lskcipher_alg *alg)
-{
-	return alg->co.ivsize;
-}
-
 /**
  * crypto_skcipher_ivsize() - obtain IV size
  * @tfm: cipher handle
@@ -473,18 +462,6 @@ static inline unsigned int crypto_lskcipher_blocksize(
 	return crypto_tfm_alg_blocksize(crypto_lskcipher_tfm(tfm));
 }
 
-static inline unsigned int crypto_skcipher_alg_chunksize(
-	struct skcipher_alg *alg)
-{
-	return alg->chunksize;
-}
-
-static inline unsigned int crypto_lskcipher_alg_chunksize(
-	struct lskcipher_alg *alg)
-{
-	return alg->co.chunksize;
-}
-
 /**
  * crypto_skcipher_chunksize() - obtain chunk size
  * @tfm: cipher handle
@@ -516,7 +493,7 @@ static inline unsigned int crypto_skcipher_chunksize(
 static inline unsigned int crypto_lskcipher_chunksize(
 	struct crypto_lskcipher *tfm)
 {
-	return crypto_lskcipher_alg_chunksize(crypto_lskcipher_alg(tfm));
+	return crypto_lskcipher_alg(tfm)->co.chunksize;
 }
 
 static inline unsigned int crypto_sync_skcipher_blocksize(
-- 
2.39.2


  parent reply	other threads:[~2023-10-03  3:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  3:43 [PATCH 0/16] crypto: Only use common fields on skcipher spawn algs Herbert Xu
2023-10-03  3:43 ` [PATCH 01/16] crypto: arc4 - Convert from skcipher to lskcipher Herbert Xu
2023-10-03  3:43 ` [PATCH 02/16] crypto: skcipher - Add crypto_spawn_skcipher_alg_common Herbert Xu
2023-10-03  3:43 ` [PATCH 03/16] crypto: essiv - Handle lskcipher spawns Herbert Xu
2023-10-03  3:43 ` [PATCH 04/16] crypto: cryptd - Only access common skcipher fields on spawn Herbert Xu
2023-10-03  3:43 ` [PATCH 05/16] crypto: adiantum " Herbert Xu
2023-10-03  3:43 ` [PATCH 06/16] crypto: authenc " Herbert Xu
2023-10-03  3:43 ` [PATCH 07/16] crypto: authencesn " Herbert Xu
2023-10-03  3:43 ` [PATCH 08/16] crypto: ccm " Herbert Xu
2023-10-03  3:43 ` [PATCH 09/16] crypto: chacha20poly1305 " Herbert Xu
2023-10-03  3:43 ` [PATCH 10/16] crypto: ctr " Herbert Xu
2023-10-03  3:43 ` [PATCH 11/16] crypto: cts " Herbert Xu
2023-10-03  3:43 ` [PATCH 12/16] crypto: gcm " Herbert Xu
2023-10-03  3:43 ` [PATCH 13/16] crypto: hctr2 " Herbert Xu
2023-10-03  3:43 ` [PATCH 14/16] crypto: lrw " Herbert Xu
2023-10-03  3:43 ` [PATCH 15/16] crypto: xts " Herbert Xu
2023-10-03  3:43 ` Herbert Xu [this message]
2023-10-03 11:39 ` [PATCH 0/16] crypto: Only use common fields on skcipher spawn algs Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003034333.1441826-17-herbert@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.