Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c98d620 authored by Herbert Xu's avatar Herbert Xu
Browse files

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5eb8ec6d
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,11 @@ static inline struct aead_instance *aead_instance(struct crypto_instance *inst)
	return container_of(&inst->alg, struct aead_instance, alg.base);
	return container_of(&inst->alg, struct aead_instance, alg.base);
}
}


static inline struct aead_instance *aead_alg_instance(struct crypto_aead *aead)
{
	return aead_instance(crypto_aead_alg_instance(aead));
}

static inline void *aead_instance_ctx(struct aead_instance *inst)
static inline void *aead_instance_ctx(struct aead_instance *inst)
{
{
	return crypto_instance_ctx(aead_crypto_instance(inst));
	return crypto_instance_ctx(aead_crypto_instance(inst));