From d2c030638d9882ff24235471d5dff913189771b3 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 27 Jan 2019 08:46:05 -0500 Subject: [PATCH] Convert CONSTANT_TIME_CARRY to inline function --- poly1305.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {