diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-08-26 03:35:45 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-09-20 21:46:21 -0400 |
commit | fce32d70ba834129b164c40c2d4260e5a7a7d850 (patch) | |
tree | 25076d25f1b95c93b276db253bc8cd301bae6289 /crypto | |
parent | 35058687912aa2f0b4554383cc10be4e0683b9a4 (diff) |
[CRYPTO] api: Add crypto_comp and crypto_has_*
This patch adds the crypto_comp type to complete the compile-time checking
conversion. The functions crypto_has_alg and crypto_has_cipher, etc. are
also added to replace crypto_alg_available.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/api.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/api.c b/crypto/api.c index edaa843d8e83..2e84d4b54790 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -482,3 +482,17 @@ int crypto_alg_available(const char *name, u32 flags) | |||
482 | EXPORT_SYMBOL_GPL(crypto_alloc_tfm); | 482 | EXPORT_SYMBOL_GPL(crypto_alloc_tfm); |
483 | EXPORT_SYMBOL_GPL(crypto_free_tfm); | 483 | EXPORT_SYMBOL_GPL(crypto_free_tfm); |
484 | EXPORT_SYMBOL_GPL(crypto_alg_available); | 484 | EXPORT_SYMBOL_GPL(crypto_alg_available); |
485 | |||
486 | int crypto_has_alg(const char *name, u32 type, u32 mask) | ||
487 | { | ||
488 | int ret = 0; | ||
489 | struct crypto_alg *alg = crypto_alg_mod_lookup(name, type, mask); | ||
490 | |||
491 | if (!IS_ERR(alg)) { | ||
492 | crypto_mod_put(alg); | ||
493 | ret = 1; | ||
494 | } | ||
495 | |||
496 | return ret; | ||
497 | } | ||
498 | EXPORT_SYMBOL_GPL(crypto_has_alg); | ||