diff options
author | jsing <> | 2025-08-02 15:44:09 +0000 |
---|---|---|
committer | jsing <> | 2025-08-02 15:44:09 +0000 |
commit | 1c7727d98f4279760cde2908bbfe7e06b323c209 (patch) | |
tree | c8109e9d88fa52c6af035cfe6ce1868562a9cae3 /src/lib/libcrypto/ec/ec_internal.h | |
parent | a79e90e7342954ae2287db505811ca3c1cd336d7 (diff) | |
download | openbsd-1c7727d98f4279760cde2908bbfe7e06b323c209.tar.gz openbsd-1c7727d98f4279760cde2908bbfe7e06b323c209.tar.bz2 openbsd-1c7727d98f4279760cde2908bbfe7e06b323c209.zip |
Provide constant time conditional selection between EC_FIELD_ELEMENTs.
Provide a ec_field_element_select() function that allows for constant time
conditional selection between two EC_FIELD_ELEMENTs. This will become a
building block for constant time point multiplication.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/ec/ec_internal.h')
-rw-r--r-- | src/lib/libcrypto/ec/ec_internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_internal.h b/src/lib/libcrypto/ec/ec_internal.h index 29b447e8c9..327d9ea94d 100644 --- a/src/lib/libcrypto/ec/ec_internal.h +++ b/src/lib/libcrypto/ec/ec_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_internal.h,v 1.1 2025/05/25 05:12:05 jsing Exp $ */ | 1 | /* $OpenBSD: ec_internal.h,v 1.2 2025/08/02 15:44:09 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -46,6 +46,8 @@ int ec_field_element_to_bn(const EC_FIELD_MODULUS *fm, const EC_FIELD_ELEMENT *f | |||
46 | BIGNUM *bn, BN_CTX *ctx); | 46 | BIGNUM *bn, BN_CTX *ctx); |
47 | 47 | ||
48 | void ec_field_element_copy(EC_FIELD_ELEMENT *dst, const EC_FIELD_ELEMENT *src); | 48 | void ec_field_element_copy(EC_FIELD_ELEMENT *dst, const EC_FIELD_ELEMENT *src); |
49 | void ec_field_element_select(const EC_FIELD_MODULUS *fm, EC_FIELD_ELEMENT *r, | ||
50 | const EC_FIELD_ELEMENT *a, const EC_FIELD_ELEMENT *b, int conditional); | ||
49 | 51 | ||
50 | int ec_field_element_equal(const EC_FIELD_MODULUS *fm, const EC_FIELD_ELEMENT *a, | 52 | int ec_field_element_equal(const EC_FIELD_MODULUS *fm, const EC_FIELD_ELEMENT *a, |
51 | const EC_FIELD_ELEMENT *b); | 53 | const EC_FIELD_ELEMENT *b); |