Convert CONSTANT_TIME_CARRY to inline function

pull/795/head
Jeffrey Walton 2019-01-27 08:46:05 -05:00
parent 143537467f
commit d2c030638d
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 5 additions and 1 deletions

View File

@ -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)
{