Add SHA3/FIPS 202 test vectors. Add note to config.h on uncommenting sha3_fips_202.txt when defining CRYPTOPP_USE_FIPS_202_SHA3

pull/161/head
Jeffrey Walton 2016-04-23 21:55:47 -04:00
parent df1c94a38a
commit 01d137155c
9 changed files with 1627 additions and 0 deletions

View File

@ -21,6 +21,7 @@ Test: TestVectors/rw.txt
Test: TestVectors/seal.txt
Test: TestVectors/sha.txt
Test: TestVectors/sha3.txt
#Test: TestVectors/sha3_fips_202.txt
Test: TestVectors/panama.txt
Test: TestVectors/aes.txt
Test: TestVectors/salsa.txt

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
AlgorithmType: FileList
Name: SHA3 FIPS 202 collection
Test: TestVectors/sha3_224_fips_202.txt
Test: TestVectors/sha3_256_fips_202.txt
Test: TestVectors/sha3_384_fips_202.txt
Test: TestVectors/sha3_512_fips_202.txt

View File

@ -45,6 +45,7 @@
// 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.
// Note well: you must open TestVectors/all.txt, comment sha3.txt and uncomment sha3_fips_202.txt.
// #define CRYPTOPP_USE_FIPS_202_SHA3
// ***************** Less Important Settings ***************

View File

@ -45,6 +45,7 @@
// 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.
// Note well: you must open TestVectors/all.txt, comment sha3.txt and uncomment sha3_fips_202.txt.
#define CRYPTOPP_USE_FIPS_202_SHA3
// ***************** Less Important Settings ***************

View File

@ -85,7 +85,13 @@ bool ValidateAll(bool thorough)
pass=ValidateMD2() && pass;
pass=ValidateMD5() && pass;
pass=ValidateSHA() && pass;
#if defined(CRYPTOPP_USE_FIPS_202_SHA3)
pass=RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/sha3_fips_202.txt") && pass;
#else
pass=RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/sha3.txt") && pass;
#endif
pass=ValidateTiger() && pass;
pass=ValidateRIPEMD() && pass;
pass=ValidatePanama() && pass;