All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: [PATCH 4/6] crypto: hash - Add helpers to return alg and driver names
Date: Mon, 01 Feb 2016 21:36:52 +0800	[thread overview]
Message-ID: <E1aQEey-0002pN-Mg@gondolin.me.apana.org.au> (raw)
In-Reply-To: 20160201133405.GA10754@gondor.apana.org.au

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>
---

 include/crypto/hash.h |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index f855efa..1969f14 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)
 {

  parent reply	other threads:[~2016-02-01 13:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 13:34 [PATCH 0/6] crypto: hash - Remove crypto_hash interface Herbert Xu
2016-02-01 13:36 ` [PATCH 1/6] crypto: tcrypt - Use ahash Herbert Xu
2016-02-01 13:36 ` [PATCH 2/6] crypto: doc " Herbert Xu
2016-02-01 13:36 ` [PATCH 3/6] crypto: skcipher - Fix driver name helper Herbert Xu
2016-02-01 13:36 ` Herbert Xu [this message]
2016-02-01 13:36 ` [PATCH 5/6] staging: lustre: Use ahash Herbert Xu
2016-02-03 22:48   ` Greg KH
2016-02-04  3:17     ` Herbert Xu
2016-02-01 13:36 ` [PATCH 6/6] crypto: hash - Remove crypto_hash interface Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1aQEey-0002pN-Mg@gondolin.me.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.