File indexing completed on 2025-01-18 09:55:10
0001
0002
0003
0004
0005
0006 #ifndef CRYPTOPP_TTMAC_H
0007 #define CRYPTOPP_TTMAC_H
0008
0009 #include "seckey.h"
0010 #include "iterhash.h"
0011 #include "secblock.h"
0012
0013 NAMESPACE_BEGIN(CryptoPP)
0014
0015
0016 class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
0017 {
0018 public:
0019 static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}
0020 CRYPTOPP_CONSTANT(DIGESTSIZE=20);
0021
0022 unsigned int DigestSize() const {return DIGESTSIZE;};
0023 void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms);
0024 void TruncatedFinal(byte *mac, size_t size);
0025
0026 protected:
0027 static void Transform (word32 *digest, const word32 *X, bool last);
0028 void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, false);}
0029 void Init();
0030 word32* StateBuf() {return m_digest;}
0031
0032 FixedSizeSecBlock<word32, 10> m_digest;
0033 FixedSizeSecBlock<word32, 5> m_key;
0034 };
0035
0036
0037
0038
0039
0040 DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal<TTMAC_Base>, TTMAC);
0041
0042 NAMESPACE_END
0043
0044 #endif