From cb4a46e7fbe62d788e66ed6121c717a2d22a4d7c Mon Sep 17 00:00:00 2001 From: watcherhd Date: Thu, 21 Apr 2011 14:14:52 +0000 Subject: svn.miranda.im is moving to a new home! git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@7 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- cryptopp/crypto/md5mac.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 cryptopp/crypto/md5mac.h (limited to 'cryptopp/crypto/md5mac.h') diff --git a/cryptopp/crypto/md5mac.h b/cryptopp/crypto/md5mac.h new file mode 100644 index 0000000..bd17e70 --- /dev/null +++ b/cryptopp/crypto/md5mac.h @@ -0,0 +1,38 @@ +#ifndef CRYPTOPP_MD5MAC_H +#define CRYPTOPP_MD5MAC_H + +/** \file +*/ + +#include "seckey.h" +#include "iterhash.h" + +NAMESPACE_BEGIN(CryptoPP) + +class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash +{ +public: + static std::string StaticAlgorithmName() {return "MD5-MAC";} + CRYPTOPP_CONSTANT(DIGESTSIZE = 16) + + MD5MAC_Base() {SetStateSize(DIGESTSIZE);} + + void UncheckedSetKey(const byte *userKey, unsigned int keylength, const NameValuePairs ¶ms); + void TruncatedFinal(byte *mac, size_t size); + unsigned int DigestSize() const {return DIGESTSIZE;} + +protected: + static void Transform (word32 *buf, const word32 *in, const word32 *key); + void HashEndianCorrectedBlock(const word32 *data) {Transform(m_digest, data, m_key+4);} + void Init(); + + static const word32 T[12]; + FixedSizeSecBlock m_key; +}; + +//! MD5-MAC +DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal, MD5MAC) + +NAMESPACE_END + +#endif -- cgit v1.2.3