summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_local.h')
-rw-r--r--src/lib/libcrypto/ec/ec_local.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index c7a54d3a2b..eac9e6d26c 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.67 2025/03/24 13:07:04 jsing Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.70 2025/08/03 15:07:57 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
@@ -85,6 +86,9 @@ typedef struct ec_method_st {
85 int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a, 86 int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a,
86 BIGNUM *b, BN_CTX *); 87 BIGNUM *b, BN_CTX *);
87 88
89 int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *);
90 int (*point_is_at_infinity)(const EC_GROUP *, const EC_POINT *);
91
88 int (*point_is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *); 92 int (*point_is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *);
89 int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, 93 int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b,
90 BN_CTX *); 94 BN_CTX *);
@@ -155,6 +159,10 @@ struct ec_group_st {
155 159
156 /* Montgomery context used by EC_GFp_mont_method. */ 160 /* Montgomery context used by EC_GFp_mont_method. */
157 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;
158} /* EC_GROUP */; 166} /* EC_GROUP */;
159 167
160struct ec_point_st { 168struct ec_point_st {
@@ -168,10 +176,15 @@ struct ec_point_st {
168 BIGNUM *Y; 176 BIGNUM *Y;
169 BIGNUM *Z; 177 BIGNUM *Z;
170 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;
171} /* EC_POINT */; 183} /* EC_POINT */;
172 184
173const EC_METHOD *EC_GFp_simple_method(void); 185const EC_METHOD *EC_GFp_simple_method(void);
174const EC_METHOD *EC_GFp_mont_method(void); 186const EC_METHOD *EC_GFp_mont_method(void);
187const EC_METHOD *EC_GFp_homogeneous_projective_method(void);
175 188
176/* Compute r = scalar1 * point1 + scalar2 * point2 in non-constant time. */ 189/* Compute r = scalar1 * point1 + scalar2 * point2 in non-constant time. */
177int ec_wnaf_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar1, 190int ec_wnaf_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar1,