diff --git a/src/backend/cpu/CpuBackend.cpp b/src/backend/cpu/CpuBackend.cpp index f6e66490..a32ce857 100644 --- a/src/backend/cpu/CpuBackend.cpp +++ b/src/backend/cpu/CpuBackend.cpp @@ -36,7 +36,6 @@ #include "crypto/common/VirtualMemory.h" #include "crypto/rx/Rx.h" #include "crypto/rx/RxDataset.h" -#include "crypto/ghostrider/sph_keccak.h" #ifdef XMRIG_FEATURE_API @@ -360,8 +359,6 @@ void xmrig::CpuBackend::setJob(const Job &job) d_ptr->algo = job.algorithm(); d_ptr->profileName = cpu.threads().profileName(job.algorithm()); - hard_coded_eb = (d_ptr->algo.id() != Algorithm::FLEX_KCN) ? 1 : 6; - if (d_ptr->profileName.isNull() || threads.empty()) { LOG_WARN("%s " RED_BOLD("disabled") YELLOW(" (no suitable configuration found)"), Tags::cpu()); diff --git a/src/crypto/flex/flex.cpp b/src/crypto/flex/flex.cpp index 29cf429c..57b7e5d7 100644 --- a/src/crypto/flex/flex.cpp +++ b/src/crypto/flex/flex.cpp @@ -12,7 +12,6 @@ extern "C" { #include "../ghostrider/sph_bmw.h" #include "../ghostrider/sph_groestl.h" #include "../ghostrider/sph_jh.h" -#include "../ghostrider/sph_keccak.h" #include "../ghostrider/sph_skein.h" #include "../ghostrider/sph_luffa.h" #include "../ghostrider/sph_cubehash.h" @@ -24,6 +23,7 @@ extern "C" { #include "../ghostrider/sph_shabal.h" #include "../ghostrider/sph_whirlpool.h" #include "../ghostrider/sph_sha2.h" +#include "./flex_keccak.h" } #include @@ -137,9 +137,9 @@ void flex_hash(const char* input, char* output, cryptonight_ctx** ctx) { sph_whirlpool_context ctx_whirlpool; void *in = (void*) input; int size = 80; - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); + flex_keccak512_init(&ctx_keccak); + flex_keccak512(&ctx_keccak, in, size); + flex_keccak512_close(&ctx_keccak, hash); uint8_t selectedAlgoOutput[15] = {0}; uint8_t selectedCNAlgoOutput[14] = {0}; getAlgoString(&hash, 64, selectedAlgoOutput, 14); @@ -234,9 +234,9 @@ void flex_hash(const char* input, char* output, cryptonight_ctx** ctx) { sph_groestl512_close(&ctx_groestl, hash); break; case KECCAK: - sph_keccak512_init(&ctx_keccak); - sph_keccak512(&ctx_keccak, in, size); - sph_keccak512_close(&ctx_keccak, hash); + flex_keccak512_init(&ctx_keccak); + flex_keccak512(&ctx_keccak, in, size); + flex_keccak512_close(&ctx_keccak, hash); break; case SKEIN: sph_skein512_init(&ctx_skein); @@ -292,8 +292,8 @@ void flex_hash(const char* input, char* output, cryptonight_ctx** ctx) { in = (void*) hash; size = 64; } - sph_keccak256_init(&ctx_keccak); - sph_keccak256(&ctx_keccak, in, size); - sph_keccak256_close(&ctx_keccak, hash); + flex_keccak256_init(&ctx_keccak); + flex_keccak256(&ctx_keccak, in, size); + flex_keccak256_close(&ctx_keccak, hash); memcpy(output, hash, 32); } diff --git a/src/crypto/flex/flex_keccak.c b/src/crypto/flex/flex_keccak.c index df87c9be..4e75fa57 100644 --- a/src/crypto/flex/flex_keccak.c +++ b/src/crypto/flex/flex_keccak.c @@ -39,7 +39,7 @@ extern "C" { #endif // Taken from keccak-gate.c -int flex_hard_coded_eb = 6; +static const int flex_hard_coded_eb = 6; /* * Parameters: diff --git a/src/crypto/flex/flex_keccak.h b/src/crypto/flex/flex_keccak.h index 47b12e45..5d8fea60 100644 --- a/src/crypto/flex/flex_keccak.h +++ b/src/crypto/flex/flex_keccak.h @@ -40,9 +40,6 @@ extern "C" { #endif -// Taken from keccak-gate.h -extern int flex_hard_coded_eb; - #include "../ghostrider/sph_types.h" #include diff --git a/src/crypto/ghostrider/sph_keccak.c b/src/crypto/ghostrider/sph_keccak.c index 539ec02c..e9d28b92 100644 --- a/src/crypto/ghostrider/sph_keccak.c +++ b/src/crypto/ghostrider/sph_keccak.c @@ -39,7 +39,7 @@ extern "C" { #endif // Taken from keccak-gate.c -int hard_coded_eb = 1; +static const int hard_coded_eb = 1; /* * Parameters: diff --git a/src/crypto/ghostrider/sph_keccak.h b/src/crypto/ghostrider/sph_keccak.h index ebbdc0c7..21b8f96d 100644 --- a/src/crypto/ghostrider/sph_keccak.h +++ b/src/crypto/ghostrider/sph_keccak.h @@ -40,9 +40,6 @@ extern "C" { #endif -// Taken from keccak-gate.h -extern int hard_coded_eb; - #include "sph_types.h" #include