summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-01-11 15:26:07 +0000
committertb <>2025-01-11 15:26:07 +0000
commitdcb5b6ad7bdcf3cba425ba834efe54dd8220a758 (patch)
treed2a94bc40907a4d97a7da9c1f63b88d3ac7761c6
parent278e0b465548a0a6ec9f52855fc196e28cb7513b (diff)
downloadopenbsd-dcb5b6ad7bdcf3cba425ba834efe54dd8220a758.tar.gz
openbsd-dcb5b6ad7bdcf3cba425ba834efe54dd8220a758.tar.bz2
openbsd-dcb5b6ad7bdcf3cba425ba834efe54dd8220a758.zip
Rename the is_on_curve() method to point_is_on_curve()
Rename ec_is_on_curve() to ec_point_is_on_curve() and ec_cmp() to ec_point_cmp().
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c6
-rw-r--r--src/lib/libcrypto/ec/ec_local.h4
-rw-r--r--src/lib/libcrypto/ec/ecp_methods.c15
3 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index a8b74ce89d..5bfa16df3c 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.110 2025/01/11 15:02:42 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.111 2025/01/11 15:26:07 tb 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 */
@@ -1250,7 +1250,7 @@ EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
1250 if (ctx == NULL) 1250 if (ctx == NULL)
1251 goto err; 1251 goto err;
1252 1252
1253 if (group->meth->is_on_curve == NULL) { 1253 if (group->meth->point_is_on_curve == NULL) {
1254 ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 1254 ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
1255 goto err; 1255 goto err;
1256 } 1256 }
@@ -1258,7 +1258,7 @@ EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
1258 ECerror(EC_R_INCOMPATIBLE_OBJECTS); 1258 ECerror(EC_R_INCOMPATIBLE_OBJECTS);
1259 goto err; 1259 goto err;
1260 } 1260 }
1261 ret = group->meth->is_on_curve(group, point, ctx); 1261 ret = group->meth->point_is_on_curve(group, point, ctx);
1262 1262
1263 err: 1263 err:
1264 if (ctx != ctx_in) 1264 if (ctx != ctx_in)
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index 66ff15a4f8..ecb81fc50b 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.58 2025/01/11 15:20:23 tb Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.59 2025/01/11 15:26:07 tb 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 */
@@ -87,7 +87,7 @@ struct ec_method_st {
87 int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a, 87 int (*group_get_curve)(const EC_GROUP *, BIGNUM *p, BIGNUM *a,
88 BIGNUM *b, BN_CTX *); 88 BIGNUM *b, BN_CTX *);
89 89
90 int (*is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *); 90 int (*point_is_on_curve)(const EC_GROUP *, const EC_POINT *, BN_CTX *);
91 int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, 91 int (*point_cmp)(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b,
92 BN_CTX *); 92 BN_CTX *);
93 93
diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c
index 8477fa547f..2ab5d48a6f 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.32 2025/01/11 15:20:23 tb Exp $ */ 1/* $OpenBSD: ecp_methods.c,v 1.33 2025/01/11 15:26:07 tb 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.
@@ -167,7 +167,7 @@ ec_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
167} 167}
168 168
169static int 169static int
170ec_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) 170ec_point_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
171{ 171{
172 int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); 172 int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *);
173 int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); 173 int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
@@ -268,7 +268,8 @@ ec_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
268 */ 268 */
269 269
270static int 270static int
271ec_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) 271ec_point_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
272 BN_CTX *ctx)
272{ 273{
273 int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); 274 int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *);
274 int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); 275 int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
@@ -1324,8 +1325,8 @@ static const EC_METHOD ec_GFp_simple_method = {
1324 .field_type = NID_X9_62_prime_field, 1325 .field_type = NID_X9_62_prime_field,
1325 .group_set_curve = ec_group_set_curve, 1326 .group_set_curve = ec_group_set_curve,
1326 .group_get_curve = ec_group_get_curve, 1327 .group_get_curve = ec_group_get_curve,
1327 .is_on_curve = ec_is_on_curve, 1328 .point_is_on_curve = ec_point_is_on_curve,
1328 .point_cmp = ec_cmp, 1329 .point_cmp = ec_point_cmp,
1329 .point_set_affine_coordinates = ec_point_set_affine_coordinates, 1330 .point_set_affine_coordinates = ec_point_set_affine_coordinates,
1330 .point_get_affine_coordinates = ec_point_get_affine_coordinates, 1331 .point_get_affine_coordinates = ec_point_get_affine_coordinates,
1331 .points_make_affine = ec_points_make_affine, 1332 .points_make_affine = ec_points_make_affine,
@@ -1350,8 +1351,8 @@ static const EC_METHOD ec_GFp_mont_method = {
1350 .field_type = NID_X9_62_prime_field, 1351 .field_type = NID_X9_62_prime_field,
1351 .group_set_curve = ec_mont_group_set_curve, 1352 .group_set_curve = ec_mont_group_set_curve,
1352 .group_get_curve = ec_group_get_curve, 1353 .group_get_curve = ec_group_get_curve,
1353 .is_on_curve = ec_is_on_curve, 1354 .point_is_on_curve = ec_point_is_on_curve,
1354 .point_cmp = ec_cmp, 1355 .point_cmp = ec_point_cmp,
1355 .point_set_affine_coordinates = ec_point_set_affine_coordinates, 1356 .point_set_affine_coordinates = ec_point_set_affine_coordinates,
1356 .point_get_affine_coordinates = ec_point_get_affine_coordinates, 1357 .point_get_affine_coordinates = ec_point_get_affine_coordinates,
1357 .points_make_affine = ec_points_make_affine, 1358 .points_make_affine = ec_points_make_affine,