summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-01-10 16:47:49 -0800
committerAmit Pundir <amit.pundir@linaro.org>2017-04-10 13:12:16 +0530
commitf9e82f17e180298cb92be33e1617c79041380fea (patch)
treefc806f83ecca7ab5ee686ac02eae02ef46db289c /crypto
parentc1bba8c93fc1c337365e14293dd1ec951d83e017 (diff)
ANDROID: crypto: shash - Add crypto_grab_shash() and crypto_spawn_shash_alg()
Analogous to crypto_grab_skcipher() and crypto_spawn_skcipher_alg(), these are useful for algorithms that need to use a shash sub-algorithm, possibly in addition to other sub-algorithms. Bug: 32975945 Signed-off-by: Eric Biggers <ebiggers@google.com> Change-Id: I44e5a519d73f5f839e3b6ecbf8c66e36ec569557
Diffstat (limited to 'crypto')
-rw-r--r--crypto/shash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c
index 359754591653..9ae1e891308d 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -683,6 +683,14 @@ void shash_free_instance(struct crypto_instance *inst)
}
EXPORT_SYMBOL_GPL(shash_free_instance);
+int crypto_grab_shash(struct crypto_shash_spawn *spawn,
+ const char *name, u32 type, u32 mask)
+{
+ spawn->base.frontend = &crypto_shash_type;
+ return crypto_grab_spawn(&spawn->base, name, type, mask);
+}
+EXPORT_SYMBOL_GPL(crypto_grab_shash);
+
int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn,
struct shash_alg *alg,
struct crypto_instance *inst)