diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2023-09-14 11:28:21 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-09-20 08:15:29 +0300 |
commit | 534562e59f354495c2644de6540d56713dde9e52 (patch) | |
tree | 6ae71acf5b14d489632d5d482cd4e419b315c7f4 /include/crypto | |
parent | 02968703e846b1b9c7934dc8d6a6dde55dc54001 (diff) | |
download | linux-534562e59f354495c2644de6540d56713dde9e52.tar.xz |
crypto: aead - Add crypto_has_aead
Add the helper crypto_has_aead. This is meant to replace the
existing use of crypto_has_alg to locate AEAD algorithms.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/aead.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/crypto/aead.h b/include/crypto/aead.h index 35e45b854a6f..51382befbe37 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h @@ -217,6 +217,18 @@ static inline void crypto_free_aead(struct crypto_aead *tfm) crypto_destroy_tfm(tfm, crypto_aead_tfm(tfm)); } +/** + * crypto_has_aead() - Search for the availability of an aead. + * @alg_name: is the cra_name / name or cra_driver_name / driver name of the + * aead + * @type: specifies the type of the aead + * @mask: specifies the mask for the aead + * + * Return: true when the aead is known to the kernel crypto API; false + * otherwise + */ +int crypto_has_aead(const char *alg_name, u32 type, u32 mask); + static inline const char *crypto_aead_driver_name(struct crypto_aead *tfm) { return crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm)); |