Crypto++
ttmac.h
1 // ttmac.h - written and placed in the public domain by Kevin Springle
2 
3 #ifndef CRYPTOPP_TTMAC_H
4 #define CRYPTOPP_TTMAC_H
5 
6 #include "seckey.h"
7 #include "iterhash.h"
8 
9 NAMESPACE_BEGIN(CryptoPP)
10 
11 //! _
12 class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
13 {
14 public:
15  static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}
16  CRYPTOPP_CONSTANT(DIGESTSIZE=20)
17 
18  unsigned int DigestSize() const {return DIGESTSIZE;};
19  void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &params);
20  void TruncatedFinal(byte *mac, size_t size);
21 
22 protected:
23  static void Transform (word32 *digest, const word32 *X, bool last);
24  void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);}
25  void Init();
26  word32* StateBuf() {return m_digest;}
27 
30 };
31 
32 //! <a href="http://www.weidai.com/scan-mirror/mac.html#TTMAC">Two-Track-MAC</a>
33 /*! 160 Bit MAC with 160 Bit Key */
35 
36 NAMESPACE_END
37 
38 #endif
interface for message authentication codes
Definition: cryptlib.h:617
to be inherited by keyed algorithms with fixed key length
Definition: seckey.h:66
_
Definition: ttmac.h:12
Two-Track-MAC
Definition: ttmac.h:34
interface for retrieving values given their names
Definition: cryptlib.h:224