12 NAMESPACE_BEGIN(CryptoPP)
18 static std::string StaticAlgorithmName() {
return std::string(
"MDC/")+T::StaticAlgorithmName();}
28 typedef typename T::HashWordType HashWordType;
31 void UncheckedSetKey(
const byte *userKey,
unsigned int length,
const NameValuePairs ¶ms)
33 this->AssertValidKeyLength(length);
34 memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH);
35 T::CorrectEndianess(Key(), Key(), this->KEYLENGTH);
38 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const
40 T::CorrectEndianess(Buffer(), (HashWordType *)inBlock, this->BLOCKSIZE);
41 T::Transform(Buffer(), Key());
44 T::CorrectEndianess(Buffer(), Buffer(), this->BLOCKSIZE);
45 xorbuf(outBlock, xorBlock, m_buffer, this->BLOCKSIZE);
48 T::CorrectEndianess((HashWordType *)outBlock, Buffer(), this->BLOCKSIZE);
51 bool IsPermutation()
const {
return false;}
53 unsigned int OptimalDataAlignment()
const {
return sizeof(HashWordType);}
56 HashWordType *Key() {
return (HashWordType *)m_key.data();}
57 const HashWordType *Key()
const {
return (
const HashWordType *)m_key.data();}
58 HashWordType *Buffer()
const {
return (HashWordType *)m_buffer.data();}
to be inherited by keyed algorithms with fixed key length
BlockCipherFinal< ENCRYPTION, Enc > Encryption
use BlockCipher interface
to be inherited by block ciphers with fixed block size
a SecBlock with fixed size, allocated statically
interface for retrieving values given their names