OSDN Git Service

crypto: api - Add crypto_alg_extsize helper
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 20 Apr 2015 05:39:00 +0000 (13:39 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 21 Apr 2015 02:19:54 +0000 (10:19 +0800)
This patch adds a crypto_alg_extsize helper that can be used
by algorithm types such as pcompress and shash.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c
crypto/internal.h

index d2627a3..a60f626 100644 (file)
@@ -964,6 +964,12 @@ void crypto_xor(u8 *dst, const u8 *src, unsigned int size)
 }
 EXPORT_SYMBOL_GPL(crypto_xor);
 
+unsigned int crypto_alg_extsize(struct crypto_alg *alg)
+{
+       return alg->cra_ctxsize;
+}
+EXPORT_SYMBOL_GPL(crypto_alg_extsize);
+
 static int __init crypto_algapi_init(void)
 {
        crypto_init_proc();
index bd39bfc..ed7a70c 100644 (file)
@@ -103,6 +103,8 @@ int crypto_register_notifier(struct notifier_block *nb);
 int crypto_unregister_notifier(struct notifier_block *nb);
 int crypto_probing_notify(unsigned long val, void *v);
 
+unsigned int crypto_alg_extsize(struct crypto_alg *alg);
+
 static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg)
 {
        atomic_inc(&alg->cra_refcnt);