aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/internal/hash.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-08-18 18:25:36 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2020-08-28 16:58:28 +1000
commitb00ba76a03a02c23494644d2ccd389fdc411f9e9 (patch)
tree96b1c15bb78306809bd9c0517f2b1bfd21cb7587 /include/crypto/internal/hash.h
parentcrypto: ahash - Add init_tfm/exit_tfm (diff)
downloadlinux-dev-b00ba76a03a02c23494644d2ccd389fdc411f9e9.tar.xz
linux-dev-b00ba76a03a02c23494644d2ccd389fdc411f9e9.zip
crypto: ahash - Add ahash_alg_instance
This patch adds the helper ahash_alg_instance which is used to convert a crypto_ahash object into its corresponding ahash_instance. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal/hash.h')
-rw-r--r--include/crypto/internal/hash.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index 6d3ad5ac4d28..0a288dddcf5b 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -164,6 +164,12 @@ static inline struct ahash_instance *ahash_instance(
return container_of(inst, struct ahash_instance, s.base);
}
+static inline struct ahash_instance *ahash_alg_instance(
+ struct crypto_ahash *ahash)
+{
+ return ahash_instance(crypto_tfm_alg_instance(&ahash->base));
+}
+
static inline void *ahash_instance_ctx(struct ahash_instance *inst)
{
return crypto_instance_ctx(ahash_crypto_instance(inst));