// ttmac.h - written and placed in the public domain by Kevin Springle
#ifndef CRYPTOPP_TTMAC_H
#define CRYPTOPP_TTMAC_H
#include "seckey.h"
#include "iterhash.h"
NAMESPACE_BEGIN(CryptoPP)
//! Two-Track-MAC
/*! 160 Bit MAC with 160 Bit Key */
class TTMAC_Base : public FixedKeyLength<20>, public IteratedHash
{
public:
static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}
enum {DIGESTSIZE=20};
TTMAC_Base() : IteratedHash(DIGESTSIZE*2) {}
unsigned int DigestSize() const {return DIGESTSIZE;};
void UncheckedSetKey(const byte *userKey, unsigned int keylength);
void TruncatedFinal(byte *mac, unsigned int size);
protected:
static void Transform (word32 *digest, const word32 *X, bool last);
void vTransform(const word32 *data) {Transform(m_digest, data, false);}
void Init();
FixedSizeSecBlock m_key;
};
//! Two-Track-MAC
typedef MessageAuthenticationCodeTemplate TTMAC;
NAMESPACE_END
#endif