From caf9e032e6b4ccb114a74a3936c916bcfaba262d Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 2 Mar 2009 02:39:17 +0000 Subject: changes for 5.6: - added AuthenticatedSymmetricCipher interface class and Filter wrappers - added CCM, GCM (with SSE2 assembly), CMAC, and SEED - improved AES speed on x86 and x64 - removed WORD64_AVAILABLE; compiler 64-bit int support is now required git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@433 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- validat1.cpp | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'validat1.cpp') diff --git a/validat1.cpp b/validat1.cpp index 1fb26c7..e0aac92 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -93,6 +93,10 @@ bool ValidateAll(bool thorough) pass=ValidateSalsa() && pass; pass=ValidateSosemanuk() && pass; pass=ValidateVMAC() && pass; + pass=ValidateCCM() && pass; + pass=ValidateGCM() && pass; + pass=ValidateCMAC() && pass; + pass=RunTestDataFile("TestVectors/seed.txt") && pass; pass=ValidateBBS() && pass; pass=ValidateDH() && pass; @@ -181,7 +185,6 @@ bool TestSettings() } cout << "sizeof(word32) == " << sizeof(word32) << endl; -#ifdef WORD64_AVAILABLE if (sizeof(word64) == 8) cout << "passed: "; else @@ -190,15 +193,6 @@ bool TestSettings() pass = false; } cout << "sizeof(word64) == " << sizeof(word64) << endl; -#elif defined(CRYPTOPP_NATIVE_DWORD_AVAILABLE) - if (sizeof(dword) >= 8) - { - cout << "FAILED: sizeof(dword) >= 8, but WORD64_AVAILABLE not defined" << endl; - pass = false; - } - else - cout << "passed: word64 not available" << endl; -#endif #ifdef CRYPTOPP_WORD128_AVAILABLE if (sizeof(word128) == 16) @@ -1080,13 +1074,14 @@ bool ValidateMARS() bool ValidateRijndael() { - cout << "\nRijndael validation suite running...\n\n"; + cout << "\nRijndael (AES) validation suite running...\n\n"; FileSource valdata("rijndael.dat", true, new HexDecoder); bool pass = true; pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 4) && pass; pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 3) && pass; pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 2) && pass; + pass = RunTestDataFile("TestVectors/aes.txt") && pass; return pass; } @@ -1168,13 +1163,8 @@ bool ValidateSHARK() { cout << "\nSHARK validation suite running...\n\n"; -#ifdef WORD64_AVAILABLE FileSource valdata("sharkval.dat", true, new HexDecoder); return BlockTransformationTest(FixedRoundsCipherFactory(), valdata); -#else - cout << "word64 not available, skipping SHARK validation." << endl; - return true; -#endif } bool ValidateCAST() @@ -1350,3 +1340,24 @@ bool ValidateVMAC() cout << "\nVMAC validation suite running...\n"; return RunTestDataFile("TestVectors/vmac.txt"); } + +bool ValidateCCM() +{ + cout << "\nAES/CCM validation suite running...\n"; + return RunTestDataFile("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)); + cout << "\n64K tables:"; + return RunTestDataFile("TestVectors/gcm.txt", MakeParameters(Name::TableSize(), (int)64*1024)) && pass; +} + +bool ValidateCMAC() +{ + cout << "\nCMAC validation suite running...\n"; + return RunTestDataFile("TestVectors/cmac.txt"); +} -- cgit v1.2.1