diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-28 10:07:59 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-06-02 22:48:35 -0400 |
commit | caab94612ac677523d2bf4a4904c8d080c2c7f73 (patch) | |
tree | f66c37a7b5273bf373c437e526a445167b5a47b6 /crypto/aead.c | |
parent | 43615369ab79f2c06532ea1607266b8307ccce82 (diff) |
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.c | 29 |
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) | |||
896 | } | 896 | } |
897 | EXPORT_SYMBOL_GPL(crypto_unregister_aead); | 897 | EXPORT_SYMBOL_GPL(crypto_unregister_aead); |
898 | 898 | ||
899 | int crypto_register_aeads(struct aead_alg *algs, int count) | ||
900 | { | ||
901 | int i, ret; | ||
902 | |||
903 | for (i = 0; i < count; i++) { | ||
904 | ret = crypto_register_aead(&algs[i]); | ||
905 | if (ret) | ||
906 | goto err; | ||
907 | } | ||
908 | |||
909 | return 0; | ||
910 | |||
911 | err: | ||
912 | for (--i; i >= 0; --i) | ||
913 | crypto_unregister_aead(&algs[i]); | ||
914 | |||
915 | return ret; | ||
916 | } | ||
917 | EXPORT_SYMBOL_GPL(crypto_register_aeads); | ||
918 | |||
919 | void crypto_unregister_aeads(struct aead_alg *algs, int count) | ||
920 | { | ||
921 | int i; | ||
922 | |||
923 | for (i = count - 1; i >= 0; --i) | ||
924 | crypto_unregister_aead(&algs[i]); | ||
925 | } | ||
926 | EXPORT_SYMBOL_GPL(crypto_unregister_aeads); | ||
927 | |||
899 | int aead_register_instance(struct crypto_template *tmpl, | 928 | int aead_register_instance(struct crypto_template *tmpl, |
900 | struct aead_instance *inst) | 929 | struct aead_instance *inst) |
901 | { | 930 | { |