1
#ifndef CRYPTOPP_MD5MAC_H
2
#define CRYPTOPP_MD5MAC_H
10
NAMESPACE_BEGIN(CryptoPP)
12
class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
15
static std::string StaticAlgorithmName() {return "MD5-MAC";}
16
enum {DIGESTSIZE = 16};
18
MD5MAC_Base() {SetStateSize(DIGESTSIZE);}
20
void UncheckedSetKey(const byte *userKey, unsigned int keylength);
21
void TruncatedFinal(byte *mac, size_t size);
22
unsigned int DigestSize() const {return DIGESTSIZE;}
25
static void Transform (word32 *buf, const word32 *in, const word32 *key);
26
void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, m_key+4);}
29
static const word32 T[12];
30
FixedSizeSecBlock<word32, 12> m_key;
33
//! <a href="http://www.weidai.com/scan-mirror/mac.html#MD5-MAC">MD5-MAC</a>
34
DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal<MD5MAC_Base>, MD5MAC)