summaryrefslogtreecommitdiffstats
path: root/include/internal/constant_time.h
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@ozlabs.org>2021-02-01 06:20:12 +0100
committerMatt Caswell <matt@openssl.org>2021-04-08 13:18:10 +0200
commitceaa6b319e01bd1ac74e3e7c5662745d3d3b3b9d (patch)
tree2c8ebf6f43ecd04198eb6c185836bc6942bbcedf /include/internal/constant_time.h
parentcurve448: Remove the unrolled loop version (diff)
downloadopenssl-ceaa6b319e01bd1ac74e3e7c5662745d3d3b3b9d.tar.xz
openssl-ceaa6b319e01bd1ac74e3e7c5662745d3d3b3b9d.zip
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)
Diffstat (limited to '')
-rw-r--r--include/internal/constant_time.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/internal/constant_time.h b/include/internal/constant_time.h
index cb4ce80830..0ed6f823c1 100644
--- a/include/internal/constant_time.h
+++ b/include/internal/constant_time.h
@@ -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)
{