Thread (22 messages) 22 messages, 2 authors, 2015-06-01
STALE4069d

[PATCH 2/10] crypto: aead - Add aead_alg_instance

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2015-05-28 14:07:58
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

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>
---

 include/crypto/internal/aead.h |    5 +++++
 1 file changed, 5 insertions(+)
diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
index 4137330..f068d74 100644
--- a/include/crypto/internal/aead.h
+++ b/include/crypto/internal/aead.h
@@ -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);
 }
 
+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)
 {
 	return crypto_instance_ctx(aead_crypto_instance(inst));
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help