Skip to content

Commit

Permalink
crypto: skcipher - Remove obsolete skcipher_alg helpers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Oct 13, 2023
1 parent bf028cf commit 2c98594
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 66 deletions.
42 changes: 0 additions & 42 deletions include/crypto/internal/skcipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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 */
Expand Down
25 changes: 1 addition & 24 deletions include/crypto/skcipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 2c98594

Please sign in to comment.