summaryrefslogtreecommitdiff
path: root/keccak.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 /keccak.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 'keccak.cpp')
-rw-r--r--keccak.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/keccak.cpp b/keccak.cpp
index cc1771cf..3450dd6a 100644
--- a/keccak.cpp
+++ b/keccak.cpp
@@ -251,8 +251,8 @@ static void KeccakF1600(word64 *state)
void Keccak::Update(const byte *input, size_t length)
{
- CRYPTOPP_ASSERT((input && length) || !(input || length));
- if (!length) { return; }
+ CRYPTOPP_ASSERT(!(input == NULLPTR && length != 0));
+ if (length == 0) { return; }
size_t spaceLeft;
while (length >= (spaceLeft = r() - m_counter))
@@ -278,6 +278,7 @@ void Keccak::Restart()
void Keccak::TruncatedFinal(byte *hash, size_t size)
{
+ CRYPTOPP_ASSERT(hash != NULLPTR);
ThrowIfInvalidTruncatedSize(size);
m_state.BytePtr()[m_counter] ^= 1;