diff options
author | cynecx <[email protected]> | 2016-01-26 23:54:54 +0100 |
---|---|---|
committer | cynecx <[email protected]> | 2016-01-26 23:54:54 +0100 |
commit | f7cf7ba37fe57ea5996f7f05861f8648a024354f (patch) | |
tree | 7463cc3d027e28cb29a46f25bba2e37a5ccb795a /src/lib/hash/blake2/blake2b.cpp | |
parent | c5303cbc194978d0a1a72920031d693aada4187c (diff) |
Blake2b: Fix for MSVC
Diffstat (limited to 'src/lib/hash/blake2/blake2b.cpp')
-rw-r--r-- | src/lib/hash/blake2/blake2b.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/hash/blake2/blake2b.cpp b/src/lib/hash/blake2/blake2b.cpp index d2d9b4d4e..14788bcd5 100644 --- a/src/lib/hash/blake2/blake2b.cpp +++ b/src/lib/hash/blake2/blake2b.cpp @@ -45,9 +45,7 @@ Blake2b::Blake2b(size_t output_bits) : m_output_bits(output_bits), m_buffer(BLAKE2B_BLOCKBYTES), m_buflen(0), - m_H(BLAKE2B_IVU64COUNT), - m_T{0}, - m_F{0} { + m_H(BLAKE2B_IVU64COUNT) { if(output_bits == 0 || output_bits % 8 != 0 || output_bits / 8 > BLAKE2B_OUTBYTES) { throw Invalid_Argument("Bad output bits size for Blake2b"); @@ -59,6 +57,8 @@ Blake2b::Blake2b(size_t output_bits) : inline void Blake2b::state_init() { std::copy(std::begin(blake2b_IV), std::end(blake2b_IV), m_H.begin()); m_H[0] ^= 0x01010000 ^ static_cast<byte>(output_length()); + m_T[0] = m_T[1] = 0; + m_F[0] = m_F[1] = 0; } void Blake2b::compress(bool lastblock) { @@ -198,8 +198,6 @@ void Blake2b::clear() { zeroise(m_H); zeroise(m_buffer); m_buflen = 0; - m_T[0] = m_T[1] = 0; - m_F[0] = m_F[1] = 0; state_init(); } |