From: Herbert Xu Date: Mon, 20 Apr 2015 05:39:00 +0000 (+0800) Subject: crypto: api - Add crypto_alg_extsize helper X-Git-Tag: v4.1.12-92~24^2~111 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fb673443483a933db86e25d63479c4b0674ca1ca;p=users%2Fjedix%2Flinux-maple.git crypto: api - Add crypto_alg_extsize helper 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 (cherry picked from commit 38d21433112c25acdb8e93f60be629e7a1c27a26) Orabug: 24614549 Signed-off-by: Ethan Zhao Signed-off-by: Dhaval Giani --- diff --git a/crypto/algapi.c b/crypto/algapi.c index d2627a3d4ed8b..a60f62625b5f4 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -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(); diff --git a/crypto/internal.h b/crypto/internal.h index bd39bfc92eabc..ed7a70c6dbc1f 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -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);