Crypto++  5.6.3
Free C++ class library of cryptographic schemes
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 #include "secblock.h"
9 
10 NAMESPACE_BEGIN(CryptoPP)
11 
12 //! _
13 class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
14 {
15 public:
16  static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}
17  CRYPTOPP_CONSTANT(DIGESTSIZE=20)
18 
19  unsigned int DigestSize() const {return DIGESTSIZE;};
20  void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs &params);
21  void TruncatedFinal(byte *mac, size_t size);
22 
23 protected:
24  static void Transform (word32 *digest, const word32 *X, bool last);
25  void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);}
26  void Init();
27  word32* StateBuf() {return m_digest;}
28 
31 };
32 
33 //! <a href="http://www.weidai.com/scan-mirror/mac.html#TTMAC">Two-Track-MAC</a>
34 /*! 160 Bit MAC with 160 Bit Key */
36 
37 NAMESPACE_END
38 
39 #endif
const char * DigestSize()
int, in bytes
Definition: argnames.h:78
Interface for message authentication codes.
Definition: cryptlib.h:1097
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:117
_
Definition: ttmac.h:13
Converts a typename to an enumerated value.
Definition: cryptlib.h:115
Two-Track-MAC
Definition: ttmac.h:35
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:277