From a074722bfa82d82c12879b8fdd9a62bac8bcaf89 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 25 Nov 2017 02:52:19 -0500 Subject: Switch to rotlConstant and rotrConstant This will help Clang and its need for a constexpr --- 3way.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to '3way.cpp') diff --git a/3way.cpp b/3way.cpp index 60bd0e13..bd610536 100644 --- a/3way.cpp +++ b/3way.cpp @@ -36,14 +36,14 @@ static inline word32 reverseBits(word32 a) a2 = t; \ } -#define pi_gamma_pi(a0, a1, a2) \ -{ \ - word32 b0, b2; \ - b2 = rotlFixed(a2, 1U); \ - b0 = rotlFixed(a0, 22U); \ - a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \ - a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\ - a1 ^= (b2|(~b0)); \ +#define pi_gamma_pi(a0, a1, a2) \ +{ \ + word32 b0, b2; \ + b2 = rotlConstant<1>(a2); \ + b0 = rotlConstant<22>(a0); \ + a0 = rotlConstant<1>(b0 ^ (a1|(~b2))); \ + a2 = rotlConstant<22>(b2 ^ (b0|(~a1))); \ + a1 ^= (b2|(~b0)); \ } // thanks to Paulo Barreto for this optimized theta() @@ -51,7 +51,7 @@ static inline word32 reverseBits(word32 a) { \ word32 b0, b1, c; \ c = a0 ^ a1 ^ a2; \ - c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \ + c = rotlConstant<16>(c) ^ rotlConstant<8>(c); \ b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \ b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \ a0 ^= c ^ b0; \ -- cgit v1.2.1