diff options
| author | jsing <> | 2025-05-25 05:19:26 +0000 |
|---|---|---|
| committer | jsing <> | 2025-05-25 05:19:26 +0000 |
| commit | 26512301343d2b40a68a67d4f4175ddec368d2fe (patch) | |
| tree | 158af8a3059a17256965840a4bec7c251f8c6151 /src/lib/libcrypto/ec/ec_local.h | |
| parent | 2f7bf75477a5741ad76c3c793c7ed887b41fcceb (diff) | |
| download | openbsd-26512301343d2b40a68a67d4f4175ddec368d2fe.tar.gz openbsd-26512301343d2b40a68a67d4f4175ddec368d2fe.tar.bz2 openbsd-26512301343d2b40a68a67d4f4175ddec368d2fe.zip | |
Provide an EC method that uses homogeneous projective coordinates.
This makes use of EC_FIELD_ELEMENT to perform fixed width constant
time operations.
Addition and doubling of points makes use of the formulas from
"Complete addition formulas for prime order elliptic curves"
(https://eprint.iacr.org/2015/1060). These are complete and
operate in constant time.
Further work will continue in tree.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/ec/ec_local.h')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_local.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h index c0ff026fb2..75a3e25247 100644 --- a/src/lib/libcrypto/ec/ec_local.h +++ b/src/lib/libcrypto/ec/ec_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_local.h,v 1.68 2025/05/24 08:25:58 jsing Exp $ */ | 1 | /* $OpenBSD: ec_local.h,v 1.69 2025/05/25 05:19:26 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -76,6 +76,7 @@ | |||
| 76 | #include <openssl/objects.h> | 76 | #include <openssl/objects.h> |
| 77 | 77 | ||
| 78 | #include "bn_local.h" | 78 | #include "bn_local.h" |
| 79 | #include "ec_internal.h" | ||
| 79 | 80 | ||
| 80 | __BEGIN_HIDDEN_DECLS | 81 | __BEGIN_HIDDEN_DECLS |
| 81 | 82 | ||
| @@ -158,6 +159,10 @@ struct ec_group_st { | |||
| 158 | 159 | ||
| 159 | /* Montgomery context used by EC_GFp_mont_method. */ | 160 | /* Montgomery context used by EC_GFp_mont_method. */ |
| 160 | BN_MONT_CTX *mont_ctx; | 161 | BN_MONT_CTX *mont_ctx; |
| 162 | |||
| 163 | EC_FIELD_MODULUS fm; | ||
| 164 | EC_FIELD_ELEMENT fe_a; | ||
| 165 | EC_FIELD_ELEMENT fe_b; | ||
| 161 | } /* EC_GROUP */; | 166 | } /* EC_GROUP */; |
| 162 | 167 | ||
| 163 | struct ec_point_st { | 168 | struct ec_point_st { |
| @@ -171,6 +176,10 @@ struct ec_point_st { | |||
| 171 | BIGNUM *Y; | 176 | BIGNUM *Y; |
| 172 | BIGNUM *Z; | 177 | BIGNUM *Z; |
| 173 | int Z_is_one; /* enable optimized point arithmetics for special case */ | 178 | int Z_is_one; /* enable optimized point arithmetics for special case */ |
| 179 | |||
| 180 | EC_FIELD_ELEMENT fe_x; | ||
| 181 | EC_FIELD_ELEMENT fe_y; | ||
| 182 | EC_FIELD_ELEMENT fe_z; | ||
| 174 | } /* EC_POINT */; | 183 | } /* EC_POINT */; |
| 175 | 184 | ||
| 176 | const EC_METHOD *EC_GFp_simple_method(void); | 185 | const EC_METHOD *EC_GFp_simple_method(void); |
