summaryrefslogtreecommitdiff
path: root/blake2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-08-21 11:25:39 -0400
committerJeffrey Walton <noloader@gmail.com>2018-08-21 11:25:39 -0400
commit6b93c284fe50d3d617228481fb78c2d20f24f6c8 (patch)
treeb88e39114c7bf48099a9f62cee5345f078d7914f /blake2.cpp
parenta9c5c56d21720cac77d30a2426ab7faf01f2a957 (diff)
downloadcryptopp-git-6b93c284fe50d3d617228481fb78c2d20f24f6c8.tar.gz
Use bitwise not 0 for last block flag
Diffstat (limited to 'blake2.cpp')
-rw-r--r--blake2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/blake2.cpp b/blake2.cpp
index a97564a5..517849a9 100644
--- a/blake2.cpp
+++ b/blake2.cpp
@@ -473,11 +473,11 @@ void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
// Set last block unconditionally
State& state = *m_state.data();
- state.f[0] = static_cast<W>(-1);
+ state.f[0] = ~static_cast<W>(0);
// Set last node if tree mode
if (m_treeMode)
- state.f[1] = static_cast<W>(-1);
+ state.f[1] = ~static_cast<W>(0);
// Increment counter for tail bytes only
IncrementCounter(state.length);