Merge pull request #41 from kinap/master

Updated SHA3 padding to NIST final FIPS 202 spec.
pull/161/head
Jeffrey Walton 2016-04-23 17:41:31 -05:00
commit 62a72f9dfa
1 changed files with 1 additions and 1 deletions

View File

@ -280,7 +280,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);