diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2021-01-04 22:58:58 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-01-08 03:46:35 +0100 |
commit | 91bac5e95b1b0debf9b2b4f05c20dcfa96b368b9 (patch) | |
tree | 1174a47d454137f0b15c7882e7c9a0e4366ca86c /sntrup761.c | |
parent | upstream: Prevent redefinition of `crypto_int32' error with gcc3. (diff) | |
download | openssh-91bac5e95b1b0debf9b2b4f05c20dcfa96b368b9.tar.xz openssh-91bac5e95b1b0debf9b2b4f05c20dcfa96b368b9.zip |
upstream: estructure sntrup761.sh to process all files in a single
list, which will make it easier to reorder. Re-inline int32_MINMAX. ok
tobhe@
OpenBSD-Commit-ID: d145c6c19b08bb93c9e14bfaa7af589d90f144c0
Diffstat (limited to 'sntrup761.c')
-rw-r--r-- | sntrup761.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sntrup761.c b/sntrup761.c index c7ef95c77..de18ca953 100644 --- a/sntrup761.c +++ b/sntrup761.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sntrup761.c,v 1.3 2021/01/03 18:05:21 tobhe Exp $ */ +/* $OpenBSD: sntrup761.c,v 1.4 2021/01/04 21:58:58 dtucker Exp $ */ /* * Public Domain, Authors: @@ -12,10 +12,21 @@ #include <string.h> #include "crypto_api.h" -#include "int32_minmax.inc" #define CRYPTO_NAMESPACE(s) s +/* from supercop-20201130/crypto_sort/int32/portable4/int32_minmax.inc */ +#define int32_MINMAX(a,b) \ +do { \ + int64_t ab = (int64_t)b ^ (int64_t)a; \ + int64_t c = (int64_t)b - (int64_t)a; \ + c ^= ab & (c ^ b); \ + c >>= 31; \ + c &= ab; \ + a ^= c; \ + b ^= c; \ +} while(0) + /* from supercop-20201130/crypto_sort/int32/portable4/sort.c */ #define int32 crypto_int32 |