diff options
author | weidai <weidai11@users.noreply.github.com> | 2007-05-04 15:25:08 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2007-05-04 15:25:08 +0000 |
commit | 240a14e5618a90a3a85318f7b9e0738952f696be (patch) | |
tree | 454a8e80ecf9c6183835d206680036952f95596a /validat1.cpp | |
parent | d2510f30c75b341dcbc45432a4bd38c0513f2616 (diff) | |
download | cryptopp-git-240a14e5618a90a3a85318f7b9e0738952f696be.tar.gz |
add word128
Diffstat (limited to 'validat1.cpp')
-rw-r--r-- | validat1.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/validat1.cpp b/validat1.cpp index c68adadb..3134cbf3 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -2,7 +2,7 @@ #include "pch.h" -#define CRYPTOPP_ENABLE_NAMESPACE_WEAK +#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 #include "files.h" #include "hex.h" #include "base32.h" @@ -92,6 +92,7 @@ bool ValidateAll(bool thorough) pass=ValidateCamellia() && pass; pass=ValidateSalsa() && pass; pass=ValidateSosemanuk() && pass; + pass=ValidateVMAC() && pass; pass=ValidateBBS() && pass; pass=ValidateDH() && pass; @@ -199,6 +200,17 @@ bool TestSettings() cout << "passed: word64 not available" << endl; #endif +#ifdef CRYPTOPP_WORD128_AVAILABLE + if (sizeof(word128) == 16) + cout << "passed: "; + else + { + cout << "FAILED: "; + pass = false; + } + cout << "sizeof(word128) == " << sizeof(word128) << endl; +#endif + if (sizeof(word) == 2*sizeof(hword) #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE && sizeof(dword) == 2*sizeof(word) @@ -501,15 +513,13 @@ bool ValidateDES() bool TestModeIV(SymmetricCipher &e, SymmetricCipher &d) { - SecByteBlock lastIV; + SecByteBlock lastIV, iv(e.IVSize()); StreamTransformationFilter filter(e, new StreamTransformationFilter(d)); byte plaintext[20480]; for (unsigned int i=1; i<sizeof(plaintext); i*=2) { - SecByteBlock iv(e.IVSize()); - e.GetNextIV(iv); - + e.GetNextIV(GlobalRNG(), iv); if (iv == lastIV) return false; else @@ -1330,6 +1340,11 @@ bool ValidateSalsa() bool ValidateSosemanuk() { cout << "\nSosemanuk validation suite running...\n"; - return RunTestDataFile("TestVectors/sosemanuk.txt"); } + +bool ValidateVMAC() +{ + cout << "\nVMAC validation suite running...\n"; + return RunTestDataFile("TestVectors/vmac.txt"); +} |