mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Initial cut-in of CRYPTOPP_USE_FIPS_202_SHA3 macro
This commit is contained in:
parent
62a72f9dfa
commit
df1c94a38a
4
config.h
4
config.h
@ -43,6 +43,10 @@
|
||||
// # define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
#endif
|
||||
|
||||
// Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3
|
||||
// in January 2013. SHA3 was finalized in FIPS 202 in August 2015, and it was a modified version of the original selection.
|
||||
// #define CRYPTOPP_USE_FIPS_202_SHA3
|
||||
|
||||
// ***************** Less Important Settings ***************
|
||||
|
||||
// Library version
|
||||
|
@ -43,6 +43,10 @@
|
||||
# define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
#endif
|
||||
|
||||
// Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3
|
||||
// in January 2013. SHA3 was finalized in FIPS 202 in August 2015, and it was a modified version of the original selection.
|
||||
#define CRYPTOPP_USE_FIPS_202_SHA3
|
||||
|
||||
// ***************** Less Important Settings ***************
|
||||
|
||||
// Library version
|
||||
|
6
sha3.cpp
6
sha3.cpp
@ -280,7 +280,13 @@ void SHA3::Restart()
|
||||
void SHA3::TruncatedFinal(byte *hash, size_t size)
|
||||
{
|
||||
ThrowIfInvalidTruncatedSize(size);
|
||||
|
||||
#if defined(CRYPTOPP_USE_FIPS_202_SHA3)
|
||||
m_state.BytePtr()[m_counter] ^= 0x06;
|
||||
#else
|
||||
m_state.BytePtr()[m_counter] ^= 1;
|
||||
#endif
|
||||
|
||||
m_state.BytePtr()[r()-1] ^= 0x80;
|
||||
KeccakF1600(m_state);
|
||||
memcpy(hash, m_state, size);
|
||||
|
Loading…
Reference in New Issue
Block a user