From 1011fd48916446ac4d03f619760c5b7615139164 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 24 Mar 2018 10:14:21 +0700 Subject: [PATCH] Partial fix for ARMv7 --- src/crypto/CryptoNight_monero.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/crypto/CryptoNight_monero.h b/src/crypto/CryptoNight_monero.h index 61d63b46..a667a3b3 100644 --- a/src/crypto/CryptoNight_monero.h +++ b/src/crypto/CryptoNight_monero.h @@ -27,12 +27,22 @@ // VARIANT ALTERATIONS -#define VARIANT1_INIT(part) \ +#ifndef XMRIG_ARM +# define VARIANT1_INIT(part) \ uint64_t tweak1_2_##part = 0; \ if (VARIANT > 0) { \ tweak1_2_##part = (*reinterpret_cast(input + 35 + part * size) ^ \ *(reinterpret_cast(ctx->state##part) + 24)); \ } +#else +# define VARIANT1_INIT(part) \ + uint64_t tweak1_2_##part = 0; \ + if (VARIANT > 0) { \ + volatile const uint64_t a = *reinterpret_cast(input + 35 + part * size); \ + volatile const uint64_t b = *(reinterpret_cast(ctx->state##part) + 24); \ + tweak1_2_##part = a ^ b; \ + } +#endif #define VARIANT1_1(p) \ if (VARIANT > 0) { \