23NAMESPACE_BEGIN(CryptoPP)
26extern void KeccakF1600(word64 *state);
30 CRYPTOPP_ASSERT(!(input == NULLPTR && length != 0));
31 if (length == 0) {
return; }
34 while (length >= (spaceLeft = r() - m_counter))
37 xorbuf(m_state.
BytePtr() + m_counter, input, spaceLeft);
45 xorbuf(m_state.
BytePtr() + m_counter, input, length);
46 m_counter += (
unsigned int)length;
55void SHAKE::ThrowIfInvalidTruncatedSize(
size_t size)
const
58 throw InvalidArgument(std::string(
"HashTransformation: can't truncate a ") +
64 CRYPTOPP_ASSERT(hash != NULLPTR);
65 ThrowIfInvalidTruncatedSize(size);
67 m_state.
BytePtr()[m_counter] ^= 0x1F;
68 m_state.
BytePtr()[r()-1] ^= 0x80;
76 std::memcpy(hash, m_state, segmentLen);
An invalid argument was detected.
void Restart()
Restart the hash.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
void Update(const byte *input, size_t length)
Updates a hash with additional input.
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.
const T & STDMIN(const T &a, const T &b)
Replacement function for std::min.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
Classes for SHAKE message digests.