summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_methods.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/ec/ecp_methods.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c
index 9593428870..a2a74334f4 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.26 2025/01/07 08:30:52 tb Exp $ */ 1/* $OpenBSD: ecp_methods.c,v 1.27 2025/01/11 13:38:42 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.
@@ -892,38 +892,6 @@ ec_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
892} 892}
893 893
894static int 894static int
895ec_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
896{
897 BIGNUM *x, *y;
898 int ret = 0;
899
900 if (point->Z_is_one || EC_POINT_is_at_infinity(group, point))
901 return 1;
902
903 BN_CTX_start(ctx);
904
905 if ((x = BN_CTX_get(ctx)) == NULL)
906 goto err;
907 if ((y = BN_CTX_get(ctx)) == NULL)
908 goto err;
909
910 if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
911 goto err;
912 if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
913 goto err;
914 if (!point->Z_is_one) {
915 ECerror(ERR_R_INTERNAL_ERROR);
916 goto err;
917 }
918 ret = 1;
919
920 err:
921 BN_CTX_end(ctx);
922
923 return ret;
924}
925
926static int
927ec_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], 895ec_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
928 BN_CTX *ctx) 896 BN_CTX *ctx)
929{ 897{
@@ -1462,7 +1430,6 @@ static const EC_METHOD ec_GFp_simple_method = {
1462 .invert = ec_invert, 1430 .invert = ec_invert,
1463 .is_on_curve = ec_is_on_curve, 1431 .is_on_curve = ec_is_on_curve,
1464 .point_cmp = ec_cmp, 1432 .point_cmp = ec_cmp,
1465 .make_affine = ec_make_affine,
1466 .points_make_affine = ec_points_make_affine, 1433 .points_make_affine = ec_points_make_affine,
1467 .mul_generator_ct = ec_mul_generator_ct, 1434 .mul_generator_ct = ec_mul_generator_ct,
1468 .mul_single_ct = ec_mul_single_ct, 1435 .mul_single_ct = ec_mul_single_ct,
@@ -1490,7 +1457,6 @@ static const EC_METHOD ec_GFp_mont_method = {
1490 .invert = ec_invert, 1457 .invert = ec_invert,
1491 .is_on_curve = ec_is_on_curve, 1458 .is_on_curve = ec_is_on_curve,
1492 .point_cmp = ec_cmp, 1459 .point_cmp = ec_cmp,
1493 .make_affine = ec_make_affine,
1494 .points_make_affine = ec_points_make_affine, 1460 .points_make_affine = ec_points_make_affine,
1495 .mul_generator_ct = ec_mul_generator_ct, 1461 .mul_generator_ct = ec_mul_generator_ct,
1496 .mul_single_ct = ec_mul_single_ct, 1462 .mul_single_ct = ec_mul_single_ct,