diff --git a/src/Makefile.am b/src/Makefile.am index 3550f11a..251e22e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -231,6 +231,7 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/ripemd160.cpp \ crypto/ripemd160.h \ crypto/scrypt.cpp \ + crypto/scrypt-sse2.cpp \ crypto/scrypt.h \ crypto/sha1.cpp \ crypto/sha1.h \ diff --git a/src/crypto/scrypt-sse2.cpp b/src/crypto/scrypt-sse2.cpp index d9e7ffcc..65b494e6 100644 --- a/src/crypto/scrypt-sse2.cpp +++ b/src/crypto/scrypt-sse2.cpp @@ -33,6 +33,8 @@ #include #include +#if defined(USE_SSE2) + #include static inline void xor_salsa8_sse2(__m128i B[4], const __m128i Bx[4]) @@ -134,3 +136,5 @@ void scrypt_1024_1_1_256_sp_sse2(const char *input, char *output, char *scratchp PBKDF2_SHA256((const uint8_t *)input, 80, B, 128, 1, (uint8_t *)output, 32); } + +#endif diff --git a/src/crypto/scrypt.cpp b/src/crypto/scrypt.cpp index 887f5877..275e26df 100644 --- a/src/crypto/scrypt.cpp +++ b/src/crypto/scrypt.cpp @@ -28,7 +28,7 @@ */ #include "crypto/scrypt.h" -//#include "util.h" +#include "util.h" #include #include #include @@ -293,7 +293,7 @@ void (*scrypt_1024_1_1_256_sp_detected)(const char *input, char *output, char *s void scrypt_detect_sse2() { #if defined(USE_SSE2_ALWAYS) - printf("scrypt: using scrypt-sse2 as built.\n"); + LogPrintf("scrypt: using scrypt-sse2 as built.\n"); #else // USE_SSE2_ALWAYS // 32bit x86 Linux or Windows, detect cpuid features unsigned int cpuid_edx=0; @@ -311,12 +311,12 @@ void scrypt_detect_sse2() if (cpuid_edx & 1<<26) { scrypt_1024_1_1_256_sp_detected = &scrypt_1024_1_1_256_sp_sse2; - printf("scrypt: using scrypt-sse2 as detected.\n"); + LogPrintf("scrypt: using scrypt-sse2 as detected.\n"); } else { scrypt_1024_1_1_256_sp_detected = &scrypt_1024_1_1_256_sp_generic; - printf("scrypt: using scrypt-generic, SSE2 unavailable.\n"); + LogPrintf("scrypt: using scrypt-generic, SSE2 unavailable.\n"); } #endif // USE_SSE2_ALWAYS } diff --git a/src/init.cpp b/src/init.cpp index c3337814..f71fa4a1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -14,6 +14,7 @@ #include "checkpoints.h" #include "compat/sanity.h" #include "consensus/validation.h" +#include "crypto/scrypt.h" #include "key.h" #include "main.h" #include "miner.h"