Updated documentation

pull/157/head
Jeffrey Walton 2016-04-21 00:24:55 -04:00
parent 8f22e80654
commit 4c78330cb9
1 changed files with 11 additions and 5 deletions

16
cmac.h
View File

@ -1,7 +1,6 @@
// cmac.h - written and placed in the public domain by Wei Dai // cmac.h - written and placed in the public domain by Wei Dai
//! \file //! \file cmac.h
//! \headerfile cmac.h
//! \brief Classes for CMAC message authentication code //! \brief Classes for CMAC message authentication code
#ifndef CRYPTOPP_CMAC_H #ifndef CRYPTOPP_CMAC_H
@ -12,7 +11,8 @@
NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(CryptoPP)
//! _ //! \class CMAC_Base
//! \brief CMAC base implementation
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode
{ {
public: public:
@ -36,13 +36,19 @@ protected:
unsigned int m_counter; unsigned int m_counter;
}; };
/// <a href="http://www.cryptolounge.org/wiki/CMAC">CMAC</a> //! \brief CMAC message authentication code
/*! Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32 */ //! \tparam T block cipher
//! \details Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32.
//! \sa <a href="http://www.cryptolounge.org/wiki/CMAC">CMAC</a>
template <class T> template <class T>
class CMAC : public MessageAuthenticationCodeImpl<CMAC_Base, CMAC<T> >, public SameKeyLengthAs<T> class CMAC : public MessageAuthenticationCodeImpl<CMAC_Base, CMAC<T> >, public SameKeyLengthAs<T>
{ {
public: public:
//! \brief Construct a CMAC
CMAC() {} CMAC() {}
//! \brief Construct a CMAC
//! \param key the MAC key
//! \param length the key size, in bytes
CMAC(const byte *key, size_t length=SameKeyLengthAs<T>::DEFAULT_KEYLENGTH) CMAC(const byte *key, size_t length=SameKeyLengthAs<T>::DEFAULT_KEYLENGTH)
{this->SetKey(key, length);} {this->SetKey(key, length);}