From 4fb789e9b2ffdf48fd50293b3982b3fce4d5fbdf Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Fri, 24 Aug 2018 14:48:23 -0700 Subject: Extract CSipHasher to it's own file in crypto/ directory. This is a move-only commit with the exception of changes to includes. --- src/Makefile.am | 4 +- src/bench/block_assemble.cpp | 1 + src/bench/crypto_hash.cpp | 1 + src/blockencodings.cpp | 3 +- src/blockfilter.cpp | 1 + src/coins.cpp | 1 + src/coins.h | 2 +- src/crypto/siphash.cpp | 173 +++++++++++++++++++++++++++++++++++++++++++ src/crypto/siphash.h | 47 ++++++++++++ src/hash.cpp | 168 ----------------------------------------- src/hash.h | 35 --------- src/net.h | 1 + src/test/hash_tests.cpp | 1 + src/txmempool.h | 1 + src/undo.h | 1 + 15 files changed, 234 insertions(+), 206 deletions(-) create mode 100644 src/crypto/siphash.cpp create mode 100644 src/crypto/siphash.h diff --git a/src/Makefile.am b/src/Makefile.am index 703304cebd..662c8bb4d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -321,7 +321,9 @@ crypto_libbitcoin_crypto_base_a_SOURCES = \ crypto/sha256.cpp \ crypto/sha256.h \ crypto/sha512.cpp \ - crypto/sha512.h + crypto/sha512.h \ + crypto/siphash.cpp \ + crypto/siphash.h if USE_ASM crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index ac2299374c..2def0b23e2 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp index d7499a3767..dc0b054420 100644 --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -14,6 +14,7 @@ #include #include #include +#include /* Number of bytes to hash per iteration */ static const uint64_t BUFFER_SIZE = 1000*1000; diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index a06bced11b..10f51931f0 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -6,7 +6,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/src/blockfilter.cpp b/src/blockfilter.cpp index 91623fe70a..163e2a52ef 100644 --- a/src/blockfilter.cpp +++ b/src/blockfilter.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include