diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_methods.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c index 5adc049ab7..fcb48d9e33 100644 --- a/src/lib/libcrypto/ec/ecp_methods.c +++ b/src/lib/libcrypto/ec/ecp_methods.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecp_methods.c,v 1.46 2025/05/10 05:54:38 tb Exp $ */ | 1 | /* $OpenBSD: ecp_methods.c,v 1.47 2025/05/24 08:25:58 jsing Exp $ */ |
| 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> | 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> |
| 3 | * for the OpenSSL project. | 3 | * for the OpenSSL project. |
| 4 | * Includes code written by Bodo Moeller for the OpenSSL project. | 4 | * Includes code written by Bodo Moeller for the OpenSSL project. |
| @@ -180,6 +180,21 @@ ec_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | static int | 182 | static int |
| 183 | ec_point_set_to_infinity(const EC_GROUP *group, EC_POINT *point) | ||
| 184 | { | ||
| 185 | BN_zero(point->Z); | ||
| 186 | point->Z_is_one = 0; | ||
| 187 | |||
| 188 | return 1; | ||
| 189 | } | ||
| 190 | |||
| 191 | static int | ||
| 192 | ec_point_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) | ||
| 193 | { | ||
| 194 | return BN_is_zero(point->Z); | ||
| 195 | } | ||
| 196 | |||
| 197 | static int | ||
| 183 | ec_point_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) | 198 | ec_point_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) |
| 184 | { | 199 | { |
| 185 | BIGNUM *rh, *tmp, *Z4, *Z6; | 200 | BIGNUM *rh, *tmp, *Z4, *Z6; |
| @@ -1281,6 +1296,8 @@ ec_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, | |||
| 1281 | static const EC_METHOD ec_GFp_simple_method = { | 1296 | static const EC_METHOD ec_GFp_simple_method = { |
| 1282 | .group_set_curve = ec_group_set_curve, | 1297 | .group_set_curve = ec_group_set_curve, |
| 1283 | .group_get_curve = ec_group_get_curve, | 1298 | .group_get_curve = ec_group_get_curve, |
| 1299 | .point_set_to_infinity = ec_point_set_to_infinity, | ||
| 1300 | .point_is_at_infinity = ec_point_is_at_infinity, | ||
| 1284 | .point_is_on_curve = ec_point_is_on_curve, | 1301 | .point_is_on_curve = ec_point_is_on_curve, |
| 1285 | .point_cmp = ec_point_cmp, | 1302 | .point_cmp = ec_point_cmp, |
| 1286 | .point_set_affine_coordinates = ec_point_set_affine_coordinates, | 1303 | .point_set_affine_coordinates = ec_point_set_affine_coordinates, |
| @@ -1304,6 +1321,8 @@ EC_GFp_simple_method(void) | |||
| 1304 | static const EC_METHOD ec_GFp_mont_method = { | 1321 | static const EC_METHOD ec_GFp_mont_method = { |
| 1305 | .group_set_curve = ec_mont_group_set_curve, | 1322 | .group_set_curve = ec_mont_group_set_curve, |
| 1306 | .group_get_curve = ec_group_get_curve, | 1323 | .group_get_curve = ec_group_get_curve, |
| 1324 | .point_set_to_infinity = ec_point_set_to_infinity, | ||
| 1325 | .point_is_at_infinity = ec_point_is_at_infinity, | ||
| 1307 | .point_is_on_curve = ec_point_is_on_curve, | 1326 | .point_is_on_curve = ec_point_is_on_curve, |
| 1308 | .point_cmp = ec_point_cmp, | 1327 | .point_cmp = ec_point_cmp, |
| 1309 | .point_set_affine_coordinates = ec_point_set_affine_coordinates, | 1328 | .point_set_affine_coordinates = ec_point_set_affine_coordinates, |
