From 409b3a70adab4211d2cf4c996a01b3aa6d74bd21 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Oct 2024 18:54:54 +0200 Subject: [PATCH] More optblocker usage --- src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c index 9577e30a64..04b734799b 100644 --- a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +++ b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c @@ -574,12 +574,9 @@ equal(signed char b, signed char c) static unsigned char negative(signed char b) { - /* 18446744073709551361..18446744073709551615: yes; 0..255: no */ - uint64_t x = b; + const uint8_t x = (uint8_t) b; /* 0..127: no 128..255: yes */ - x >>= 63; /* 1: yes; 0: no */ - - return x; + return ((x >> 5) ^ optblocker_u8) >> 2; /* 1: yes; 0: no */ } static void