Updated SHA3 padding to NIST final FIPS 202 spec

This commit is contained in:
Daniel Collins 2015-10-15 10:41:31 -07:00
parent aff5105569
commit 844daf0eab

View File

@ -274,7 +274,7 @@ void SHA3::Restart()
void SHA3::TruncatedFinal(byte *hash, size_t size)
{
ThrowIfInvalidTruncatedSize(size);
m_state.BytePtr()[m_counter] ^= 1;
m_state.BytePtr()[m_counter] ^= 0x06;
m_state.BytePtr()[r()-1] ^= 0x80;
KeccakF1600(m_state);
memcpy(hash, m_state, size);