Crypto++
5.6.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
6 #ifndef CRYPTOPP_HMAC_H
7 #define CRYPTOPP_HMAC_H
22 void UncheckedSetKey(
const byte *userKey,
unsigned int keylength,
const NameValuePairs ¶ms);
25 void Update(
const byte *input,
size_t length);
26 void TruncatedFinal(
byte *mac,
size_t size);
32 byte * AccessIpad() {
return m_buf;}
33 byte * AccessOpad() {
return m_buf + AccessHash().
BlockSize();}
34 byte * AccessInnerHash() {
return m_buf + 2*AccessHash().BlockSize();}
40 bool m_innerHashKeyed;
53 CRYPTOPP_CONSTANT(DIGESTSIZE=T::DIGESTSIZE)
54 CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE)
62 {this->
SetKey(key, length);}
64 static std::string StaticAlgorithmName() {
return std::string(
"HMAC(") + T::StaticAlgorithmName() +
")";}
65 std::string
AlgorithmName()
const {
return std::string(
"HMAC(") + m_hash.AlgorithmName() +
")";}
HMAC_Base()
Construct a HMAC_Base.
std::string AlgorithmName() const
Provides the name of this algorithm.
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.
unsigned int DigestSize() const
Provides the digest size of the hash.
Provides a base implementation of Algorithm and SimpleKeyingInterface for message authentication code...
Crypto++ library namespace.
static const int DEFAULT_KEYLENGTH
The default key length used by the algorithm provided as a constant.
unsigned int OptimalBlockSize() const
Provides the input block size most efficient for this hash.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
Interface for message authentication codes.
HMAC(const byte *key, size_t length=HMAC_Base::DEFAULT_KEYLENGTH)
Construct a HMAC.
Interface for retrieving values given their names.
Inherited by keyed algorithms with variable key length.