56
58
pass=ValidateMD5() && pass;
57
59
pass=ValidateSHA() && pass;
58
60
pass=ValidateSHA2() && pass;
59
pass=ValidateHAVAL() && pass;
60
61
pass=ValidateTiger() && pass;
61
62
pass=ValidateRIPEMD() && pass;
62
63
pass=ValidatePanama() && pass;
63
64
pass=ValidateWhirlpool() && pass;
65
pass=ValidateMD5MAC() && pass;
66
66
pass=ValidateHMAC() && pass;
67
pass=ValidateXMACC() && pass;
68
67
pass=ValidateTTMAC() && pass;
70
69
pass=ValidatePBKDF() && pass;
92
91
pass=ValidateSHACAL2() && pass;
93
92
pass=ValidateCamellia() && pass;
94
93
pass=ValidateSalsa() && pass;
94
pass=ValidateSosemanuk() && pass;
96
96
pass=ValidateBBS() && pass;
97
97
pass=ValidateDH() && pass;
191
191
cout << "sizeof(word64) == " << sizeof(word64) << endl;
192
#elif CRYPTOPP_NATIVE_DWORD_AVAILABLE
192
#elif defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE)
193
193
if (sizeof(dword) >= 8)
195
195
cout << "FAILED: sizeof(dword) >= 8, but WORD64_AVAILABLE not defined" << endl;
219
bool hasMMX = HasMMX();
220
bool hasSSE2 = HasSSE2();
221
bool hasSSSE3 = HasSSSE3();
223
int cacheLineSize = GetCacheLineSize();
225
if ((isP4 && (!hasMMX || !hasSSE2)) || (hasSSE2 && !hasMMX) || (cacheLineSize < 16 || cacheLineSize > 256 || !IsPowerOf2(cacheLineSize)))
233
cout << "hasMMX == " << hasMMX << ", hasSSE2 == " << hasSSE2 << ", hasSSSE3 == " << hasSSSE3 << ", isP4 == " << isP4 << ", cacheLineSize == " << cacheLineSize;
221
237
cout << "Some critical setting in config.h is in error. Please fix it and recompile." << endl;
978
994
// VC60 workaround: auto_ptr lacks reset()
979
member_ptr<ARC4> arc4;
995
member_ptr<Weak::ARC4> arc4;
980
996
bool pass=true, fail;
983
999
cout << "\nARC4 validation suite running...\n\n";
985
arc4.reset(new ARC4(Key0, sizeof(Key0)));
1001
arc4.reset(new Weak::ARC4(Key0, sizeof(Key0)));
986
1002
arc4->ProcessString(Input0, sizeof(Input0));
987
1003
fail = memcmp(Input0, Output0, sizeof(Input0)) != 0;
988
1004
cout << (fail ? "FAILED" : "passed") << " Test 0" << endl;
989
1005
pass = pass && !fail;
991
arc4.reset(new ARC4(Key1, sizeof(Key1)));
1007
arc4.reset(new Weak::ARC4(Key1, sizeof(Key1)));
992
1008
arc4->ProcessString(Key1, Input1, sizeof(Key1));
993
1009
fail = memcmp(Output1, Key1, sizeof(Key1)) != 0;
994
1010
cout << (fail ? "FAILED" : "passed") << " Test 1" << endl;
995
1011
pass = pass && !fail;
997
arc4.reset(new ARC4(Key2, sizeof(Key2)));
1013
arc4.reset(new Weak::ARC4(Key2, sizeof(Key2)));
998
1014
for (i=0, fail=false; i<sizeof(Input2); i++)
999
1015
if (arc4->ProcessByte(Input2[i]) != Output2[i])
1001
1017
cout << (fail ? "FAILED" : "passed") << " Test 2" << endl;
1002
1018
pass = pass && !fail;
1004
arc4.reset(new ARC4(Key3, sizeof(Key3)));
1020
arc4.reset(new Weak::ARC4(Key3, sizeof(Key3)));
1005
1021
for (i=0, fail=false; i<sizeof(Input3); i++)
1006
1022
if (arc4->ProcessByte(Input3[i]) != Output3[i])
1008
1024
cout << (fail ? "FAILED" : "passed") << " Test 3" << endl;
1009
1025
pass = pass && !fail;
1011
arc4.reset(new ARC4(Key4, sizeof(Key4)));
1027
arc4.reset(new Weak::ARC4(Key4, sizeof(Key4)));
1012
1028
for (i=0, fail=false; i<sizeof(Input4); i++)
1013
1029
if (arc4->ProcessByte(Input4[i]) != Output4[i])
1297
1313
cout << "\nCamellia validation suite running...\n\n";
1299
#ifdef WORD64_AVAILABLE
1300
1315
bool pass = true;
1301
1316
FileSource valdata("camellia.dat", true, new HexDecoder);
1302
1317
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(16), valdata, 15) && pass;
1303
1318
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(24), valdata, 15) && pass;
1304
1319
pass = BlockTransformationTest(FixedRoundsCipherFactory<CamelliaEncryption, CamelliaDecryption>(32), valdata, 15) && pass;
1307
cout << "word64 not available, skipping Camellia validation." << endl;
1312
1323
bool ValidateSalsa()