diff --git a/include/bitcoin/system/hash/siphash.hpp b/include/bitcoin/system/hash/siphash.hpp index 7c174aa60f..4eae98008c 100644 --- a/include/bitcoin/system/hash/siphash.hpp +++ b/include/bitcoin/system/hash/siphash.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace libbitcoin { @@ -37,7 +38,13 @@ BC_API uint64_t siphash(const siphash_key& key, BC_API uint64_t siphash(const half_hash& hash, const data_slice& message) NOEXCEPT; -BC_API siphash_key to_siphash_key(const half_hash& hash) NOEXCEPT; +constexpr siphash_key to_siphash_key(const half_hash& hash) NOEXCEPT +{ + const auto part = split(hash); + const auto hi = from_little_endian(part.first); + const auto lo = from_little_endian(part.second); + return std::make_tuple(hi, lo); +} } // namespace system } // namespace libbitcoin diff --git a/src/hash/siphash.cpp b/src/hash/siphash.cpp index 42c55051df..d423b3d889 100644 --- a/src/hash/siphash.cpp +++ b/src/hash/siphash.cpp @@ -110,14 +110,5 @@ uint64_t siphash(const half_hash& hash, return siphash(to_siphash_key(hash), message); } -// TODO: constexpr -siphash_key to_siphash_key(const half_hash& hash) NOEXCEPT -{ - const auto part = split(hash); - const auto hi = from_little_endian(part.first); - const auto lo = from_little_endian(part.second); - return std::make_tuple(hi, lo); -} - } // namespace system } // namespace libbitcoin