summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-02-01 21:36:52 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-02-06 15:33:13 +0800
commitd12481bc58fba89427565f8592e88446ec084a24 (patch)
tree7e4f95371b900b77a3bb3ed90d1eb20aa3f7cc42 /include/crypto
parent92b3cad3af31250a2b26d586f91c9962d626a7ed (diff)
downloadlinux-d12481bc58fba89427565f8592e88446ec084a24.tar.bz2
crypto: hash - Add helpers to return alg and driver names
This patch adds helpers to retrieve the alg name and driver name of crypto_shash and crypto_ahash objects. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/hash.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index f855efaa2f8c..1969f1416658 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -272,6 +272,16 @@ static inline void crypto_free_ahash(struct crypto_ahash *tfm)
*/
int crypto_has_ahash(const char *alg_name, u32 type, u32 mask);
+static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm)
+{
+ return crypto_tfm_alg_name(crypto_ahash_tfm(tfm));
+}
+
+static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm)
+{
+ return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm));
+}
+
static inline unsigned int crypto_ahash_alignmask(
struct crypto_ahash *tfm)
{
@@ -676,6 +686,16 @@ static inline void crypto_free_shash(struct crypto_shash *tfm)
crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
}
+static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm)
+{
+ return crypto_tfm_alg_name(crypto_shash_tfm(tfm));
+}
+
+static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm)
+{
+ return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
+}
+
static inline unsigned int crypto_shash_alignmask(
struct crypto_shash *tfm)
{