aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/crypto/hash.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-01-23 13:52:40 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-01-25 22:42:13 +0800
commit8d18e34c1fe22418ae0b5475ab0d1956d69ad195 (patch)
tree805ed0cdc260466e4e58f5037e4d2c275650ef33 /include/crypto/hash.h
parentcrypto: api - Add crypto_type_has_alg helper (diff)
downloadwireguard-linux-8d18e34c1fe22418ae0b5475ab0d1956d69ad195.tar.xz
wireguard-linux-8d18e34c1fe22418ae0b5475ab0d1956d69ad195.zip
crypto: hash - Add crypto_has_ahash helper
This patch adds the helper crypto_has_ahash which should replace crypto_has_hash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/hash.h')
-rw-r--r--include/crypto/hash.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index aef819247fe8..f855efaa2f8c 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -260,6 +260,18 @@ static inline void crypto_free_ahash(struct crypto_ahash *tfm)
crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm));
}
+/**
+ * crypto_has_ahash() - Search for the availability of an ahash.
+ * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
+ * ahash
+ * @type: specifies the type of the ahash
+ * @mask: specifies the mask for the ahash
+ *
+ * Return: true when the ahash is known to the kernel crypto API; false
+ * otherwise
+ */
+int crypto_has_ahash(const char *alg_name, u32 type, u32 mask);
+
static inline unsigned int crypto_ahash_alignmask(
struct crypto_ahash *tfm)
{