summaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-10-03 11:43:19 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-13 18:27:26 +0800
commitab6223dc3e1b0a842d663abbed400c43ebee07fc (patch)
tree37947254e881ac2485b175a3d1d4269238dd3cea /include/crypto
parent9a91792db10126fa291e22680d6cf5683d845a15 (diff)
crypto: skcipher - Add crypto_spawn_skcipher_alg_common
As skcipher spawns can be of two different types (skcipher vs. lskcipher), only the common fields can be accessed. Add a helper to return the common algorithm object. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/internal/skcipher.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index 4382fd707b8a..c767b5cfbd9c 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -160,6 +160,12 @@ static inline struct lskcipher_alg *crypto_lskcipher_spawn_alg(
return container_of(spawn->base.alg, struct lskcipher_alg, co.base);
}
+static inline struct skcipher_alg_common *crypto_spawn_skcipher_alg_common(
+ struct crypto_skcipher_spawn *spawn)
+{
+ 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)
{