diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-05-05 22:56:15 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-05-05 22:56:15 -0400 |
commit | 3159969808669a35a3a185bd6bef8955f0cf1822 (patch) | |
tree | 0b4fb88b70d4f6c5767db3048d4d7542d989389a /blake2.cpp | |
parent | 3deb24b7dee3d3aee4b5c2a0bc502237b065bcd1 (diff) | |
download | cryptopp-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 'blake2.cpp')
-rw-r--r-- | blake2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -356,6 +356,9 @@ void BLAKE2_Base<W, T_64bit>::Restart(const BLAKE2_ParameterBlock<T_64bit>& bloc template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Update(const byte *input, size_t length)
{
+ CRYPTOPP_ASSERT(input != NULLPTR);
+ if (length == 0) { return; }
+
State& state = *m_state.data();
if (state.length + length > BLOCKSIZE)
{
@@ -390,6 +393,7 @@ void BLAKE2_Base<W, T_64bit>::Update(const byte *input, size_t length) template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
{
+ CRYPTOPP_ASSERT(hash != NULLPTR);
this->ThrowIfInvalidTruncatedSize(size);
// Set last block unconditionally
|