From c18478a6b4ab7ea2d2365830b5dde7aa427b934c Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 3 May 2020 13:38:34 +0700 Subject: [PATCH] Small cleanups. --- src/crypto/randomx/blake2/blake2b.c | 6 +++--- src/crypto/randomx/jit_compiler_x86.cpp | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/crypto/randomx/blake2/blake2b.c b/src/crypto/randomx/blake2/blake2b.c index 24305c3c..29a402d8 100644 --- a/src/crypto/randomx/blake2/blake2b.c +++ b/src/crypto/randomx/blake2/blake2b.c @@ -87,7 +87,7 @@ static FORCE_INLINE void blake2b_init0(blake2b_state *S) { memcpy(S->h, blake2b_IV, sizeof(S->h)); } -int blake2b_init_param(blake2b_state *S, const blake2b_param *P) { +int rx_blake2b_init_param(blake2b_state *S, const blake2b_param *P) { const unsigned char *p = (const unsigned char *)P; unsigned int i; @@ -130,7 +130,7 @@ int rx_blake2b_init(blake2b_state *S, size_t outlen) { memset(P.salt, 0, sizeof(P.salt)); memset(P.personal, 0, sizeof(P.personal)); - return blake2b_init_param(S, &P); + return rx_blake2b_init_param(S, &P); } int rx_blake2b_init_key(blake2b_state *S, size_t outlen, const void *key, size_t keylen) { @@ -163,7 +163,7 @@ int rx_blake2b_init_key(blake2b_state *S, size_t outlen, const void *key, size_t memset(P.salt, 0, sizeof(P.salt)); memset(P.personal, 0, sizeof(P.personal)); - if (blake2b_init_param(S, &P) < 0) { + if (rx_blake2b_init_param(S, &P) < 0) { blake2b_invalidate_state(S); return -1; } diff --git a/src/crypto/randomx/jit_compiler_x86.cpp b/src/crypto/randomx/jit_compiler_x86.cpp index 095f4d3c..178d35a5 100644 --- a/src/crypto/randomx/jit_compiler_x86.cpp +++ b/src/crypto/randomx/jit_compiler_x86.cpp @@ -36,7 +36,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "crypto/randomx/program.hpp" #include "crypto/randomx/reciprocal.h" #include "crypto/randomx/virtual_memory.hpp" -#include "crypto/rx/Rx.h" + +#ifdef XMRIG_FIX_RYZEN +# include "crypto/rx/Rx.h" +#endif #ifdef _MSC_VER # include