summaryrefslogtreecommitdiff
path: root/trunhash.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-12-15 04:05:17 -0500
committerJeffrey Walton <noloader@gmail.com>2020-12-15 04:05:17 -0500
commitbfeba0d300fa53a974922c07c5b816e65b266b6f (patch)
treeb778723313c1b2c92c47fad7e2938803d4799c84 /trunhash.h
parent45ce17c49226e37e2b40e1b76a5e7e34ab36a6db (diff)
downloadcryptopp-git-bfeba0d300fa53a974922c07c5b816e65b266b6f.tar.gz
Update documentation
Diffstat (limited to 'trunhash.h')
-rw-r--r--trunhash.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/trunhash.h b/trunhash.h
index 38fc6675..36df5beb 100644
--- a/trunhash.h
+++ b/trunhash.h
@@ -1,3 +1,8 @@
+// trunhash.h - originally written and placed in the public domain by Wei Dai
+
+/// \file trunhash.h
+/// \brief Classes for truncated hashes
+
#ifndef CRYPTOPP_TRUNHASH_H
#define CRYPTOPP_TRUNHASH_H
@@ -5,6 +10,8 @@
NAMESPACE_BEGIN(CryptoPP)
+/// \brief Null hash
+/// \details A null hash that conforms to HashTransformation interface
class NullHash : public HashTransformation
{
public:
@@ -18,15 +25,19 @@ public:
{CRYPTOPP_UNUSED(digest);CRYPTOPP_UNUSED(digestLength);return true;}
};
-/// construct new HashModule with smaller DigestSize() from existing one
+/// \brief Construct new HashModule with smaller digest size from an existing one
+/// \tparam T HashTransformation derived class
template <class T>
class TruncatedHashTemplate : public HashTransformation
{
public:
+ /// \brief Construct a TruncatedHashTemplate
TruncatedHashTemplate(T hm, unsigned int digestSize)
: m_hm(hm), m_digestSize(digestSize) {}
+ /// \brief Construct a TruncatedHashTemplate
TruncatedHashTemplate(const byte *key, size_t keyLength, unsigned int digestSize)
: m_hm(key, keyLength), m_digestSize(digestSize) {}
+ /// \brief Construct a TruncatedHashTemplate
TruncatedHashTemplate(size_t digestSize)
: m_digestSize(digestSize) {}