From 651637d6377a25f2c9b47c48085bad0d3c598d61 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 3 Jun 2018 00:22:26 +0700 Subject: [PATCH] #446 Better fix, second variable always aligned. --- src/crypto/CryptoNight_monero.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/crypto/CryptoNight_monero.h b/src/crypto/CryptoNight_monero.h index 942940a46..28572d88c 100644 --- a/src/crypto/CryptoNight_monero.h +++ b/src/crypto/CryptoNight_monero.h @@ -38,10 +38,8 @@ # define VARIANT1_INIT(part) \ uint64_t tweak1_2_##part = 0; \ if (VARIANT > 0) { \ - uint64_t a, b; \ - memcpy(&a, input + 35 + part * size, sizeof a); \ - memcpy(&b, ctx[part]->state + 192, sizeof b); \ - tweak1_2_##part = a ^ b; \ + memcpy(&tweak1_2_##part, input + 35 + part * size, sizeof tweak1_2_##part); \ + tweak1_2_##part ^= *(reinterpret_cast(ctx[part]->state) + 24); \ } #endif