diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-01-27 08:46:05 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-01-27 08:46:05 -0500 |
commit | d2c030638d9882ff24235471d5dff913189771b3 (patch) | |
tree | 0c00e2d30eacf2135484157cd388e6b7401f148c /poly1305.cpp | |
parent | 143537467f35504a4588c8f38608b2134bfa52f4 (diff) | |
download | cryptopp-git-d2c030638d9882ff24235471d5dff913189771b3.tar.gz |
Convert CONSTANT_TIME_CARRY to inline function
Diffstat (limited to 'poly1305.cpp')
-rw-r--r-- | poly1305.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/poly1305.cpp b/poly1305.cpp index 88acffa6..d1ddba87 100644 --- a/poly1305.cpp +++ b/poly1305.cpp @@ -30,7 +30,11 @@ ANONYMOUS_NAMESPACE_BEGIN
using namespace CryptoPP;
-#define CONSTANT_TIME_CARRY(a,b) ((a ^ ((a ^ b) | ((a - b) ^ b))) >> (sizeof(a) * 8 - 1))
+
+inline word32 CONSTANT_TIME_CARRY(word32 a, word32 b)
+{
+ return ((a ^ ((a ^ b) | ((a - b) ^ b))) >> (sizeof(a) * 8 - 1));
+}
void Poly1305_HashBlocks(word32 h[5], word32 r[4], const byte *input, size_t length, word32 padbit)
{
|