1 #ifndef CRYPTOPP_ITERHASH_H 2 #define CRYPTOPP_ITERHASH_H 17 : InvalidDataFormat(
"IteratedHashBase: input data exceeds maximum allowed by hash function " + alg) {}
26 template <
class T,
class BASE>
50 void Update(
const byte *input,
size_t length);
60 byte * CreateUpdateSpace(
size_t &
size);
71 void TruncatedFinal(
byte *digest,
size_t digestSize);
74 inline T GetBitCountHi()
const {
return (m_countLo >> (8*
sizeof(
T)-3)) + (m_countHi << 3);}
77 void PadLastBlock(
unsigned int lastBlockSize,
byte padFirst=0x80);
78 virtual void Init() =0;
80 virtual ByteOrder GetByteOrder()
const =0;
81 virtual void HashEndianCorrectedBlock(
const HashWordType *
data) =0;
82 virtual size_t HashMultipleBlocks(
const T *input,
size_t length);
83 void HashBlock(
const HashWordType *input) {HashMultipleBlocks(input, this->BlockSize());}
85 virtual T* DataBuf() =0;
86 virtual T* StateBuf() =0;
100 template <
class T_HashWordType,
class T_Endianness,
unsigned int T_BlockSize,
class T_Base = HashTransformation>
135 T_HashWordType*
DataBuf() {
return this->m_data;}
149 template <
class T_HashWordType,
class T_Endianness,
unsigned int T_BlockSize,
unsigned int T_StateSize,
class T_Transform,
unsigned int T_DigestSize = 0,
bool T_StateAligned = false>
151 :
public ClonableImpl<T_Transform, AlgorithmImpl<IteratedHash<T_HashWordType, T_Endianness, T_BlockSize>, T_Transform> >
166 void Init() {T_Transform::InitState(this->m_state);}
ByteOrder GetByteOrder() const
Provides the byte order of the hash.
IteratedHashBase()
Construct an IteratedHashBase.
Classes providing basic library services.
Utility functions for the Crypto++ library.
ByteOrder
Provides the byte ordering.
void HashBlock(const HashWordType *input)
Base class for identifying alogorithm.
#define NAMESPACE_BEGIN(x)
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Abstract base classes that provide a uniform interface to this library.
Classes and functions for secure memory allocations.
#define CRYPTOPP_COMPILE_ASSERT(assertion)
T ConditionalByteReverse(ByteOrder order, T value)
Reverses bytes in a value depending upon endianness.
T_HashWordType HashWordType
#define CRYPTOPP_STATIC_TEMPLATE_CLASS
Fixed size stack-based SecBlock with 16-byte alignment.
void CorrectEndianess(HashWordType *out, const HashWordType *in, size_t byteCount)
Adjusts the byte ordering of the hash.
unsigned int OptimalBlockSize() const
Provides the input block size most efficient for this cipher.
#define CRYPTOPP_CONSTANT(x)
Fixed size stack-based SecBlock.
unsigned int OptimalDataAlignment() const
Provides input and output data alignment for optimal performance.
#define CRYPTOPP_NO_VTABLE
uint8_t const size_t const size
unsigned int BlockSize() const
Provides the block size of the hash.
Iterated hash base class.
Iterated hash base class.
T_Endianness ByteOrderClass
T_HashWordType * DataBuf()