Skip to content

Commit

Permalink
crypto: api - Add crypto_alg_extsize helper
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Apr 21, 2015
1 parent 2a57e42 commit 38d2143
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 38d2143

Please sign in to comment.