mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
Add a constant time zero check function for 64-bit integers
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
This commit is contained in:
parent
eb7bcff67c
commit
ceaa6b319e
@ -182,6 +182,11 @@ static ossl_inline uint32_t constant_time_is_zero_32(uint32_t a)
|
||||
return constant_time_msb_32(~a & (a - 1));
|
||||
}
|
||||
|
||||
static ossl_inline uint64_t constant_time_is_zero_64(uint64_t a)
|
||||
{
|
||||
return constant_time_msb_64(~a & (a - 1));
|
||||
}
|
||||
|
||||
static ossl_inline unsigned int constant_time_eq(unsigned int a,
|
||||
unsigned int b)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user