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::TruncatedFinal(byte *hash, size_t size) // Set last block unconditionally State& state = *m_state.data(); - state.f[0] = static_cast(-1); + state.f[0] = ~static_cast(0); // Set last node if tree mode if (m_treeMode) - state.f[1] = static_cast(-1); + state.f[1] = ~static_cast(0); // Increment counter for tail bytes only IncrementCounter(state.length);