diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -2,8 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include - #include #include #include @@ -16,6 +14,9 @@ #include #include +#include +#include + /* Number of bytes to hash per iteration */ static const uint64_t BUFFER_SIZE = 1000 * 1000; @@ -65,7 +66,8 @@ uint256 x; uint64_t k1 = 0; while (state.KeepRunning()) { - *((uint64_t *)x.begin()) = SipHashUint256(0, ++k1, x); + uint64_t hash64 = SipHashUint256(0, ++k1, x); + std::memcpy(x.begin(), &hash64, sizeof(hash64)); } }