Skip to content

Commit b00ba76

Browse files
committed
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>
1 parent e73d340 commit b00ba76

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎include/crypto/internal/hash.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ static inline struct ahash_instance *ahash_instance(
164164
return container_of(inst, struct ahash_instance, s.base);
165165
}
166166

167+
static inline struct ahash_instance *ahash_alg_instance(
168+
struct crypto_ahash *ahash)
169+
{
170+
return ahash_instance(crypto_tfm_alg_instance(&ahash->base));
171+
}
172+
167173
static inline void *ahash_instance_ctx(struct ahash_instance *inst)
168174
{
169175
return crypto_instance_ctx(ahash_crypto_instance(inst));

0 commit comments

Comments
 (0)