summaryrefslogtreecommitdiff
path: root/validat1.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-12-25 23:50:28 -0500
committerJeffrey Walton <noloader@gmail.com>2015-12-25 23:50:28 -0500
commita0b078543abdfb5a508ff75dcd5865c4d6401085 (patch)
treee9b14b648544c986f0fff3967cc64e0a1c3955b3 /validat1.cpp
parent19f72fc73c232b5dabdab3263fd4f0304ed35e1b (diff)
downloadcryptopp-git-a0b078543abdfb5a508ff75dcd5865c4d6401085.tar.gz
Added CRYPTOPP_DATA_DIR patch (Issue 82)
Diffstat (limited to 'validat1.cpp')
-rw-r--r--validat1.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/validat1.cpp b/validat1.cpp
index 144bdbf0..ba04cdc0 100644
--- a/validat1.cpp
+++ b/validat1.cpp
@@ -84,7 +84,7 @@ bool ValidateAll(bool thorough)
pass=ValidateMD2() && pass;
pass=ValidateMD5() && pass;
pass=ValidateSHA() && pass;
- pass=RunTestDataFile("TestVectors/sha3.txt") && pass;
+ pass=RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/sha3.txt") && pass;
pass=ValidateTiger() && pass;
pass=ValidateRIPEMD() && pass;
pass=ValidatePanama() && pass;
@@ -124,8 +124,8 @@ bool ValidateAll(bool thorough)
pass=ValidateCCM() && pass;
pass=ValidateGCM() && pass;
pass=ValidateCMAC() && pass;
- pass=RunTestDataFile("TestVectors/eax.txt") && pass;
- pass=RunTestDataFile("TestVectors/seed.txt") && pass;
+ pass=RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/eax.txt") && pass;
+ pass=RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/seed.txt") && pass;
pass=ValidateBBS() && pass;
pass=ValidateDH() && pass;
@@ -742,12 +742,12 @@ bool ValidateDES()
{
cout << "\nDES validation suite running...\n\n";
- FileSource valdata("TestData/descert.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/descert.dat", true, new HexDecoder);
bool pass = BlockTransformationTest(FixedRoundsCipherFactory<DESEncryption, DESDecryption>(), valdata);
cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n";
- FileSource valdata1("TestData/3desval.dat", true, new HexDecoder);
+ FileSource valdata1(CRYPTOPP_DATA_DIR "TestData/3desval.dat", true, new HexDecoder);
pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE2_Encryption, DES_EDE2_Decryption>(), valdata1, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE3_Encryption, DES_EDE3_Decryption>(), valdata1, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<DES_XEX3_Encryption, DES_XEX3_Decryption>(), valdata1, 1) && pass;
@@ -1091,7 +1091,7 @@ bool ValidateIDEA()
{
cout << "\nIDEA validation suite running...\n\n";
- FileSource valdata("TestData/ideaval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/ideaval.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<IDEAEncryption, IDEADecryption>(), valdata);
}
@@ -1099,7 +1099,7 @@ bool ValidateSAFER()
{
cout << "\nSAFER validation suite running...\n\n";
- FileSource valdata("TestData/saferval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/saferval.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(8,6), valdata, 4) && pass;
pass = BlockTransformationTest(VariableRoundsCipherFactory<SAFER_K_Encryption, SAFER_K_Decryption>(16,12), valdata, 4) && pass;
@@ -1112,7 +1112,7 @@ bool ValidateRC2()
{
cout << "\nRC2 validation suite running...\n\n";
- FileSource valdata("TestData/rc2val.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/rc2val.dat", true, new HexDecoder);
HexEncoder output(new FileSink(cout));
SecByteBlock plain(RC2Encryption::BLOCKSIZE), cipher(RC2Encryption::BLOCKSIZE), out(RC2Encryption::BLOCKSIZE), outplain(RC2Encryption::BLOCKSIZE);
SecByteBlock key(128);
@@ -1322,7 +1322,7 @@ bool ValidateRC5()
{
cout << "\nRC5 validation suite running...\n\n";
- FileSource valdata("TestData/rc5val.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/rc5val.dat", true, new HexDecoder);
return BlockTransformationTest(VariableRoundsCipherFactory<RC5Encryption, RC5Decryption>(16, 12), valdata);
}
@@ -1330,7 +1330,7 @@ bool ValidateRC6()
{
cout << "\nRC6 validation suite running...\n\n";
- FileSource valdata("TestData/rc6val.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/rc6val.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(16), valdata, 2) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<RC6Encryption, RC6Decryption>(24), valdata, 2) && pass;
@@ -1342,7 +1342,7 @@ bool ValidateMARS()
{
cout << "\nMARS validation suite running...\n\n";
- FileSource valdata("TestData/marsval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/marsval.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(16), valdata, 4) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<MARSEncryption, MARSDecryption>(24), valdata, 3) && pass;
@@ -1354,12 +1354,12 @@ bool ValidateRijndael()
{
cout << "\nRijndael (AES) validation suite running...\n\n";
- FileSource valdata("TestData/rijndael.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/rijndael.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(16), valdata, 4) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(24), valdata, 3) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<RijndaelEncryption, RijndaelDecryption>(32), valdata, 2) && pass;
- pass = RunTestDataFile("TestVectors/aes.txt") && pass;
+ pass = RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/aes.txt") && pass;
return pass;
}
@@ -1367,7 +1367,7 @@ bool ValidateTwofish()
{
cout << "\nTwofish validation suite running...\n\n";
- FileSource valdata("TestData/twofishv.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/twofishv.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(16), valdata, 4) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<TwofishEncryption, TwofishDecryption>(24), valdata, 3) && pass;
@@ -1379,7 +1379,7 @@ bool ValidateSerpent()
{
cout << "\nSerpent validation suite running...\n\n";
- FileSource valdata("TestData/serpentv.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/serpentv.dat", true, new HexDecoder);
bool pass = true;
pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(16), valdata, 5) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<SerpentEncryption, SerpentDecryption>(24), valdata, 4) && pass;
@@ -1425,7 +1425,7 @@ bool ValidateThreeWay()
{
cout << "\n3-WAY validation suite running...\n\n";
- FileSource valdata("TestData/3wayval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/3wayval.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<ThreeWayEncryption, ThreeWayDecryption>(), valdata);
}
@@ -1433,7 +1433,7 @@ bool ValidateGOST()
{
cout << "\nGOST validation suite running...\n\n";
- FileSource valdata("TestData/gostval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/gostval.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<GOSTEncryption, GOSTDecryption>(), valdata);
}
@@ -1441,7 +1441,7 @@ bool ValidateSHARK()
{
cout << "\nSHARK validation suite running...\n\n";
- FileSource valdata("TestData/sharkval.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/sharkval.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<SHARKEncryption, SHARKDecryption>(), valdata);
}
@@ -1451,14 +1451,14 @@ bool ValidateCAST()
cout << "\nCAST-128 validation suite running...\n\n";
- FileSource val128("TestData/cast128v.dat", true, new HexDecoder);
+ FileSource val128(CRYPTOPP_DATA_DIR "TestData/cast128v.dat", true, new HexDecoder);
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(16), val128, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(10), val128, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST128Encryption, CAST128Decryption>(5), val128, 1) && pass;
cout << "\nCAST-256 validation suite running...\n\n";
- FileSource val256("TestData/cast256v.dat", true, new HexDecoder);
+ FileSource val256(CRYPTOPP_DATA_DIR "TestData/cast256v.dat", true, new HexDecoder);
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(16), val256, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(24), val256, 1) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CAST256Encryption, CAST256Decryption>(32), val256, 1) && pass;
@@ -1470,7 +1470,7 @@ bool ValidateSquare()
{
cout << "\nSquare validation suite running...\n\n";
- FileSource valdata("TestData/squareva.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/squareva.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<SquareEncryption, SquareDecryption>(), valdata);
}
@@ -1478,7 +1478,7 @@ bool ValidateSKIPJACK()
{
cout << "\nSKIPJACK validation suite running...\n\n";
- FileSource valdata("TestData/skipjack.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/skipjack.dat", true, new HexDecoder);
return BlockTransformationTest(FixedRoundsCipherFactory<SKIPJACKEncryption, SKIPJACKDecryption>(), valdata);
}
@@ -1582,7 +1582,7 @@ bool ValidateSHACAL2()
cout << "\nSHACAL-2 validation suite running...\n\n";
bool pass = true;
- FileSource valdata("TestData/shacal2v.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/shacal2v.dat", true, new HexDecoder);
pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(16), valdata, 4) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<SHACAL2Encryption, SHACAL2Decryption>(64), valdata, 10) && pass;
return pass;
@@ -1593,7 +1593,7 @@ bool ValidateCamellia()
cout << "\nCamellia validation suite running...\n\n";
bool pass = true;
- FileSource valdata("TestData/camellia.dat", true, new HexDecoder);
+ FileSource valdata(CRYPTOPP_DATA_DIR "TestData/camellia.dat", true, new HexDecoder);
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(16), valdata, 15) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(24), valdata, 15) && pass;
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(32), valdata, 15) && pass;
@@ -1604,38 +1604,38 @@ bool ValidateSalsa()
{
cout << "\nSalsa validation suite running...\n";
- return RunTestDataFile("TestVectors/salsa.txt");
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/salsa.txt");
}
bool ValidateSosemanuk()
{
cout << "\nSosemanuk validation suite running...\n";
- return RunTestDataFile("TestVectors/sosemanuk.txt");
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/sosemanuk.txt");
}
bool ValidateVMAC()
{
cout << "\nVMAC validation suite running...\n";
- return RunTestDataFile("TestVectors/vmac.txt");
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/vmac.txt");
}
bool ValidateCCM()
{
cout << "\nAES/CCM validation suite running...\n";
- return RunTestDataFile("TestVectors/ccm.txt");
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/ccm.txt");
}
bool ValidateGCM()
{
cout << "\nAES/GCM validation suite running...\n";
cout << "\n2K tables:";
- bool pass = RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)2048));
+ bool pass = RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)2048));
cout << "\n64K tables:";
- return RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)64*1024)) && pass;
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)64*1024)) && pass;
}
bool ValidateCMAC()
{
cout << "\nCMAC validation suite running...\n";
- return RunTestDataFile("TestVectors/cmac.txt");
+ return RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/cmac.txt");
}