[PATCH] digest: add digest_algo helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Code handling different digest types may want easy access to the digest
algorithm currently in use. Add a simple inline helper for this.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 include/digest.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/digest.h b/include/digest.h
index b984d57d778e..2816ddffaed2 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -161,6 +161,11 @@ static inline const char *digest_name(struct digest *d)
 	return d->algo->base.name;
 }
 
+static inline enum hash_algo digest_algo(struct digest *d)
+{
+	return d->algo->base.algo;
+}
+
 static inline void* digest_ctx(struct digest *d)
 {
 	return d->ctx;
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux