Skip to content

Commit 5c98d62

Browse files
committed
crypto: aead - Add aead_alg_instance
Now that type-safe init/exit functions exist, they often need to access the underlying aead_instance. So this patch adds the helper aead_alg_instance to access aead_instance from a crypto_aead object. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5eb8ec6 commit 5c98d62

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/crypto/internal/aead.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ static inline struct aead_instance *aead_instance(struct crypto_instance *inst)
5252
return container_of(&inst->alg, struct aead_instance, alg.base);
5353
}
5454

55+
static inline struct aead_instance *aead_alg_instance(struct crypto_aead *aead)
56+
{
57+
return aead_instance(crypto_aead_alg_instance(aead));
58+
}
59+
5560
static inline void *aead_instance_ctx(struct aead_instance *inst)
5661
{
5762
return crypto_instance_ctx(aead_crypto_instance(inst));

0 commit comments

Comments
 (0)