40 this->AssertValidKeyLength(length);
41 memcpy_s(m_key, m_key.size(), userKey, this->KEYLENGTH);
42 T::CorrectEndianess(Key(), Key(), this->KEYLENGTH);
47 T::CorrectEndianess(Buffer(), (HashWordType *)inBlock, this->BLOCKSIZE);
48 T::Transform(Buffer(), Key());
51 T::CorrectEndianess(Buffer(), Buffer(), this->BLOCKSIZE);
52 xorbuf(outBlock, xorBlock, m_buffer, this->BLOCKSIZE);
55 T::CorrectEndianess((HashWordType *)outBlock, Buffer(), this->BLOCKSIZE);
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();}
MDC_Info cipher information.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
Inherited by keyed algorithms with fixed key length.
Utility functions for the Crypto++ library.
unsigned int OptimalDataAlignment() const
Provides input and output data alignment for optimal performance.
FixedSizeSecBlock< byte, MDC_Info< T >::KEYLENGTH, AllocatorWithCleanup< byte > > m_key
#define NAMESPACE_BEGIN(x)
void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t count)
Bounds checking replacement for memcpy()
HashWordType * Buffer() const
static std::string StaticAlgorithmName()
Classes and functions for secure memory allocations.
BlockCipherFinal< ENCRYPTION, Enc > Encryption
use BlockCipher interface
Inherited by algorithms with fixed block size.
const HashWordType * Key() const
Classes and functions for implementing secret key algorithms.
T::HashWordType HashWordType
Fixed size stack-based SecBlock.
void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
FixedSizeSecBlock< byte, MDC_Info< T >::BLOCKSIZE, AllocatorWithCleanup< byte > > m_buffer
#define CRYPTOPP_NO_VTABLE
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
MDC cipher encryption operation.
bool IsPermutation() const
returns true if this is a permutation (i.e. there is an inverse transformation)
Interface for retrieving values given their names.