From bfeba0d300fa53a974922c07c5b816e65b266b6f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 15 Dec 2020 04:05:17 -0500 Subject: [PATCH] Update documentation --- iterhash.h | 3 +++ trunhash.h | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/iterhash.h b/iterhash.h index c48f7e0c..5a65b5ba 100644 --- a/iterhash.h +++ b/iterhash.h @@ -1,5 +1,8 @@ // iterhash.h - originally written and placed in the public domain by Wei Dai +/// \file iterhash.h +/// \brief Base classes for iterated hashes + #ifndef CRYPTOPP_ITERHASH_H #define CRYPTOPP_ITERHASH_H 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 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) {}