Clear asserts under DEBUG builds
parent
fd7115fc8b
commit
2ffa70fbc6
|
|
@ -405,8 +405,9 @@ RandomNumberGenerator & NullRNG()
|
||||||
|
|
||||||
bool HashTransformation::TruncatedVerify(const byte *digest, size_t digestLength)
|
bool HashTransformation::TruncatedVerify(const byte *digest, size_t digestLength)
|
||||||
{
|
{
|
||||||
|
// Allocate at least 1 for calculated to avoid triggering diagnostics
|
||||||
ThrowIfInvalidTruncatedSize(digestLength);
|
ThrowIfInvalidTruncatedSize(digestLength);
|
||||||
SecByteBlock calculated(digestLength);
|
SecByteBlock calculated(digestLength ? digestLength : 1);
|
||||||
TruncatedFinal(calculated, digestLength);
|
TruncatedFinal(calculated, digestLength);
|
||||||
return VerifyBufsEqual(calculated, digest, digestLength);
|
return VerifyBufsEqual(calculated, digest, digestLength);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ bool CryptoSystemValidate(PK_Decryptor &priv, PK_Encryptor &pub, bool thorough)
|
||||||
std::cout << (fail ? "FAILED " : "passed ");
|
std::cout << (fail ? "FAILED " : "passed ");
|
||||||
std::cout << "cryptosystem key validation\n";
|
std::cout << "cryptosystem key validation\n";
|
||||||
|
|
||||||
const byte *message = (byte *)"test message";
|
const byte message[] = "test message";
|
||||||
const int messageLen = 12;
|
const int messageLen = 12;
|
||||||
SecByteBlock ciphertext(priv.CiphertextLength(messageLen));
|
SecByteBlock ciphertext(priv.CiphertextLength(messageLen));
|
||||||
SecByteBlock plaintext(priv.MaxPlaintextLength(ciphertext.size()));
|
SecByteBlock plaintext(priv.MaxPlaintextLength(ciphertext.size()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue