From 33e710d591c71d53bf67a171c067677cbbc59b5e Mon Sep 17 00:00:00 2001 From: aegroto Date: Mon, 16 Apr 2018 01:39:27 +0200 Subject: [PATCH] optimization to double hash tweak --- src/crypto/CryptoNight_x86.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crypto/CryptoNight_x86.h b/src/crypto/CryptoNight_x86.h index 333e2191..28d3b402 100644 --- a/src/crypto/CryptoNight_x86.h +++ b/src/crypto/CryptoNight_x86.h @@ -398,8 +398,7 @@ static inline void cryptonight_monero_tweak(uint64_t* mem_out, __m128i tmp) uint8_t x = vh >> 24; static const uint16_t table = 0x7531; - const uint8_t index = (((x >> 3) & 6) | (x & 1)) << 1; - vh ^= ((table >> index) & 0x3) << 28; + vh ^= ((table >> ((((x >> 3) & 6) | (x & 1)) << 1)) & 0x3) << 28; mem_out[1] = vh; }