parent
347c0e56c6
commit
5c5d3e4c26
15
validat1.cpp
15
validat1.cpp
|
|
@ -3262,7 +3262,7 @@ bool ValidateEncoder()
|
||||||
// string of '*'. To round trip a string both IsolatedInitialize
|
// string of '*'. To round trip a string both IsolatedInitialize
|
||||||
// must be called and work correctly.
|
// must be called and work correctly.
|
||||||
std::cout << "\nCustom encoder validation running...\n\n";
|
std::cout << "\nCustom encoder validation running...\n\n";
|
||||||
bool pass1 = true, pass2 = false;
|
bool pass = true;
|
||||||
|
|
||||||
int lookup[256];
|
int lookup[256];
|
||||||
const char alphabet[64+1] =
|
const char alphabet[64+1] =
|
||||||
|
|
@ -3292,10 +3292,10 @@ bool ValidateEncoder()
|
||||||
decoder.Put((const byte*) str1.data(), str1.size());
|
decoder.Put((const byte*) str1.data(), str1.size());
|
||||||
decoder.MessageEnd();
|
decoder.MessageEnd();
|
||||||
|
|
||||||
pass1 = (str1 == std::string(expected)) && pass1;
|
pass = (str1 == std::string(expected)) && pass;
|
||||||
pass1 = (str2 == std::string(alphabet, 64)) && pass1;
|
pass = (str2 == std::string(alphabet, 64)) && pass;
|
||||||
|
|
||||||
std::cout << (pass1 ? "passed:" : "FAILED:");
|
std::cout << (pass ? "passed:" : "FAILED:");
|
||||||
std::cout << " Encode and decode\n";
|
std::cout << " Encode and decode\n";
|
||||||
|
|
||||||
// Try forcing an empty message. This is the Monero bug
|
// Try forcing an empty message. This is the Monero bug
|
||||||
|
|
@ -3315,14 +3315,11 @@ bool ValidateEncoder()
|
||||||
volatile lword size = decoder2.MaxRetrievable();
|
volatile lword size = decoder2.MaxRetrievable();
|
||||||
lword shadow = size;
|
lword shadow = size;
|
||||||
CRYPTOPP_UNUSED(shadow);
|
CRYPTOPP_UNUSED(shadow);
|
||||||
|
|
||||||
pass2 = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << (pass2 ? "passed:" : "FAILED:");
|
std::cout << "passed: 0-length message\n";
|
||||||
std::cout << " 0-length message\n";
|
|
||||||
|
|
||||||
return pass1 && pass2;
|
return pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ValidateSHACAL2()
|
bool ValidateSHACAL2()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue