diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-28 22:07:59 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-06-03 10:48:35 +0800 |
commit | f3f3012daeea8bb9195b68645ba0ae9ce8e6e8ff (patch) | |
tree | 64f5600b9cbc2cbcfca55bb3f349900beaa85750 /crypto/aead.c | |
parent | ee61bc25ac681fa39cb2179062fde30a95c506e8 (diff) | |
download | linux-crypto-f3f3012daeea8bb9195b68645ba0ae9ce8e6e8ff.tar.gz linux-crypto-f3f3012daeea8bb9195b68645ba0ae9ce8e6e8ff.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 '')
-rw-r--r-- | crypto/aead.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crypto/aead.c b/crypto/aead.c index ac447929..07bf9977 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) { |