Skip to content

Commit

Permalink
Add another optblocker
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Oct 23, 2024
1 parent b8b8e6b commit 836a37d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,10 @@ ge25519_precomp_0(ge25519_precomp *h)
static unsigned char
equal(signed char b, signed char c)
{
unsigned char ub = b;
unsigned char uc = c;
unsigned char x = ub ^ uc; /* 0: yes; 1..255: no */
uint32_t y = (uint32_t) x; /* 0: yes; 1..255: no */
const unsigned char x = (unsigned char) b ^ (unsigned char) c; /* 0: yes; 1..255: no */
const uint32_t y = (uint32_t) x; /* 0: yes; 1..255: no */

y -= 1; /* 4294967295: yes; 0..254: no */
y >>= 31; /* 1: yes; 0: no */

return y;
return (((y - 1) >> 29) ^ optblocker_u8) >> 2; /* 1: yes; 0: no */
}

static unsigned char
Expand Down

0 comments on commit 836a37d

Please sign in to comment.