Skip to content

Commit 6b93c28

Browse files
committed
Use bitwise not 0 for last block flag
1 parent a9c5c56 commit 6b93c28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blake2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@ void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
473473

474474
// Set last block unconditionally
475475
State& state = *m_state.data();
476-
state.f[0] = static_cast<W>(-1);
476+
state.f[0] = ~static_cast<W>(0);
477477

478478
// Set last node if tree mode
479479
if (m_treeMode)
480-
state.f[1] = static_cast<W>(-1);
480+
state.f[1] = ~static_cast<W>(0);
481481

482482
// Increment counter for tail bytes only
483483
IncrementCounter(state.length);

0 commit comments

Comments
 (0)