From 36dc30286b4ba65d9cfb6ec683fdeac4307c9b91 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 16 Dec 2015 23:10:07 -0500 Subject: [PATCH] Updated documentation --- hmac.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hmac.h b/hmac.h index d46626d4..f6c1499a 100644 --- a/hmac.h +++ b/hmac.h @@ -1,6 +1,6 @@ // hmac.h - written and placed in the public domain by Wei Dai -//! \file +//! \file hmac.h //! \brief Classes for HMAC message authentication codes #ifndef CRYPTOPP_HMAC_H @@ -11,10 +11,13 @@ NAMESPACE_BEGIN(CryptoPP) -//! _ +//! \class HMAC_Base +//! \brief HMAC information +//! \details HMAC_Base derives from VariableKeyLength and MessageAuthenticationCode class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HMAC_Base : public VariableKeyLength<16, 0, INT_MAX>, public MessageAuthenticationCode { public: + //! \brief Construct a HMAC_Base HMAC_Base() : m_innerHashKeyed(false) {} void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); @@ -37,8 +40,12 @@ private: bool m_innerHashKeyed; }; -//! HMAC -/*! HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)) */ +//! \class HMAC +//! \brief HMAC +//! \tparam T HashTransformation derived class +//! \details HMAC derives from MessageAuthenticationCodeImpl. It calculates the HMAC using +//! HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)). +//! \sa HMAC template class HMAC : public MessageAuthenticationCodeImpl > { @@ -46,7 +53,11 @@ public: CRYPTOPP_CONSTANT(DIGESTSIZE=T::DIGESTSIZE) CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE) + //! \brief Construct a HMAC HMAC() {} + //! \brief Construct a HMAC + //! \param key the HMAC key + //! \param length the size of the HMAC key HMAC(const byte *key, size_t length=HMAC_Base::DEFAULT_KEYLENGTH) {this->SetKey(key, length);}