From: Herbert Xu Date: Tue, 18 Aug 2020 08:25:36 +0000 (+1000) Subject: crypto: ahash - Add ahash_alg_instance X-Git-Tag: v5.15~2545^2~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b00ba76a03a02c23494644d2ccd389fdc411f9e9;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 6d3ad5a..0a288dd 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));