26extern void KeccakF1600(
word64 *state);
32void
SHA3::Update(const
byte *input,
size_t length)
35 if (length == 0) {
return; }
38 while (length >= (spaceLeft = r() - m_counter))
41 xorbuf(m_state.BytePtr() + m_counter, input, spaceLeft);
49 xorbuf(m_state.BytePtr() + m_counter, input, length);
50 m_counter += (
unsigned int)length;
62 ThrowIfInvalidTruncatedSize(size);
64 m_state.
BytePtr()[m_counter] ^= 0x06;
65 m_state.
BytePtr()[r()-1] ^= 0x80;
67 std::memcpy(hash, m_state, size);
SHA3 message digest base class.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
void Restart()
Restart the hash.
size_type SizeInBytes() const
Provides the number of bytes in the SecBlock.
byte * BytePtr()
Provides a byte pointer to the first element in the memory block.
unsigned long long word64
64-bit unsigned datatype
CRYPTOPP_DLL void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
Crypto++ library namespace.
Classes for SHA3 message digests.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.