summaryrefslogtreecommitdiff
path: root/3way.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-11-25 02:52:19 -0500
committerJeffrey Walton <noloader@gmail.com>2017-11-25 02:52:19 -0500
commita074722bfa82d82c12879b8fdd9a62bac8bcaf89 (patch)
tree6321fd7bb3c9a3340ce8463242854a19bc0ef4e1 /3way.cpp
parent2d4614084a4250ce4d60d535ccf506605477e4ed (diff)
downloadcryptopp-git-a074722bfa82d82c12879b8fdd9a62bac8bcaf89.tar.gz
Switch to rotlConstant and rotrConstant
This will help Clang and its need for a constexpr
Diffstat (limited to '3way.cpp')
-rw-r--r--3way.cpp18
1 files changed, 9 insertions, 9 deletions
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; \