summaryrefslogtreecommitdiff
path: root/whrlpool.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-05-05 22:56:15 -0400
committerJeffrey Walton <noloader@gmail.com>2018-05-05 22:56:15 -0400
commit3159969808669a35a3a185bd6bef8955f0cf1822 (patch)
tree0b4fb88b70d4f6c5767db3048d4d7542d989389a /whrlpool.cpp
parent3deb24b7dee3d3aee4b5c2a0bc502237b065bcd1 (diff)
downloadcryptopp-git-3159969808669a35a3a185bd6bef8955f0cf1822.tar.gz
Back-off on Hash asserts (GH #652)
The asserts were a little aggressive and caused very noisy Debug runs. The library itself was one of the biggest offenders.
Diffstat (limited to 'whrlpool.cpp')
-rw-r--r--whrlpool.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/whrlpool.cpp b/whrlpool.cpp
index e0e401cc..3986e225 100644
--- a/whrlpool.cpp
+++ b/whrlpool.cpp
@@ -96,6 +96,7 @@ void Whirlpool::InitState(HashWordType *state)
void Whirlpool::TruncatedFinal(byte *hash, size_t size)
{
+ CRYPTOPP_ASSERT(hash != NULLPTR);
ThrowIfInvalidTruncatedSize(size);
PadLastBlock(32);
@@ -407,6 +408,9 @@ const word64 Whirlpool_C[4*256+R] = {
// Whirlpool basic transformation. Transforms state based on block.
void Whirlpool::Transform(word64 *digest, const word64 *block)
{
+ CRYPTOPP_ASSERT(digest != NULLPTR);
+ CRYPTOPP_ASSERT(block != NULLPTR);
+
#if CRYPTOPP_SSE2_ASM_AVAILABLE
if (HasSSE2())
{