summaryrefslogtreecommitdiffstats
path: root/crypto/aead.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-28 22:07:59 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-06-03 10:48:35 +0800
commitcaab94612ac677523d2bf4a4904c8d080c2c7f73 (patch)
treef66c37a7b5273bf373c437e526a445167b5a47b6 /crypto/aead.c
parent43615369ab79f2c06532ea1607266b8307ccce82 (diff)
downloadlinux-stable-caab94612ac677523d2bf4a4904c8d080c2c7f73.tar.gz
linux-stable-caab94612ac677523d2bf4a4904c8d080c2c7f73.tar.bz2
linux-stable-caab94612ac677523d2bf4a4904c8d080c2c7f73.zip
crypto: aead - Add multiple algorithm registration interface
This patch adds the helpers that allow the registration and removal of multiple algorithms. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/aead.c')
-rw-r--r--crypto/aead.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/crypto/aead.c b/crypto/aead.c
index ac4479297864..07bf99773548 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -896,6 +896,35 @@ void crypto_unregister_aead(struct aead_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_unregister_aead);
+int crypto_register_aeads(struct aead_alg *algs, int count)
+{
+ int i, ret;
+
+ for (i = 0; i < count; i++) {
+ ret = crypto_register_aead(&algs[i]);
+ if (ret)
+ goto err;
+ }
+
+ return 0;
+
+err:
+ for (--i; i >= 0; --i)
+ crypto_unregister_aead(&algs[i]);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(crypto_register_aeads);
+
+void crypto_unregister_aeads(struct aead_alg *algs, int count)
+{
+ int i;
+
+ for (i = count - 1; i >= 0; --i)
+ crypto_unregister_aead(&algs[i]);
+}
+EXPORT_SYMBOL_GPL(crypto_unregister_aeads);
+
int aead_register_instance(struct crypto_template *tmpl,
struct aead_instance *inst)
{