From f151c7131d4101b089ecb232d89030c4ceeafc76 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 29 Aug 2018 19:52:33 +0200 Subject: [PATCH] Removed excess code for v0 & v1 --- src/crypto/CryptoNight_arm.h | 10 +++++++--- src/crypto/CryptoNight_x86.h | 14 ++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/crypto/CryptoNight_arm.h b/src/crypto/CryptoNight_arm.h index 7f273765..1df4ec5d 100644 --- a/src/crypto/CryptoNight_arm.h +++ b/src/crypto/CryptoNight_arm.h @@ -527,7 +527,9 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si idx0 = d ^ q; } } - bx1 = bx0; + if (VARIANT == xmrig::VARIANT_2) { + bx1 = bx0; + } bx0 = cx; } @@ -699,9 +701,11 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si idx1 = d ^ q; } } - bx01 = bx00; + if (VARIANT == xmrig::VARIANT_2) { + bx01 = bx00; + bx11 = bx10; + } bx00 = cx0; - bx11 = bx10; bx10 = cx1; } diff --git a/src/crypto/CryptoNight_x86.h b/src/crypto/CryptoNight_x86.h index e234d41d..e134abac 100644 --- a/src/crypto/CryptoNight_x86.h +++ b/src/crypto/CryptoNight_x86.h @@ -553,7 +553,9 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si idx0 = d ^ q; ptr0 = (uint64_t*)&l0[idx0 & MASK]; } - bx1 = bx0; + if (VARIANT == xmrig::VARIANT_2) { + bx1 = bx0; + } bx0 = cx; } @@ -731,9 +733,11 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si ptr1 = (uint64_t*)&l1[idx1 & MASK]; } - bx01 = bx00; + if (VARIANT == xmrig::VARIANT_2) { + bx01 = bx00; + bx11 = bx10; + } bx00 = cx0; - bx11 = bx10; bx10 = cx1; } @@ -812,7 +816,9 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si \ idx = d ^ q; \ } \ - b1 = b0; \ + if (VARIANT == xmrig::VARIANT_2) { \ + b1 = b0; \ + } \ b0 = c;