20 static std::string StaticAlgorithmName() {
return std::string(
"MDC/")+T::StaticAlgorithmName();}
35 typedef typename T::HashWordType HashWordType;
38 void UncheckedSetKey(
const byte *userKey,
unsigned int length,
const NameValuePairs ¶ms)
40 this->AssertValidKeyLength(length);
41 memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH);
42 T::CorrectEndianess(Key(), Key(), this->
KEYLENGTH);
45 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock,
byte *outBlock)
const
47 T::CorrectEndianess(Buffer(), (HashWordType *)inBlock, this->
BLOCKSIZE);
48 T::Transform(Buffer(), Key());
51 T::CorrectEndianess(Buffer(), Buffer(), this->
BLOCKSIZE);
55 T::CorrectEndianess((HashWordType *)outBlock, Buffer(), this->
BLOCKSIZE);
58 bool IsPermutation()
const {
return false;}
60 unsigned int OptimalDataAlignment()
const {
return sizeof(HashWordType);}
63 HashWordType *Key() {
return (HashWordType *)m_key.data();}
64 const HashWordType *Key()
const {
return (
const HashWordType *)m_key.data();}
65 HashWordType *Buffer()
const {
return (HashWordType *)m_buffer.data();}