From 65fc25f0127c246c6ca0b80faa55bd49fa2ef13f Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 31 Oct 2024 15:37:53 +0000 Subject: Retire the oct2point and point2oct EC_METHOD members Both our remaining EC_METHODs use the methods that used to be called ec_GFp_simple_{oct2point,point2oct}() so there's no need for the function pointer indirection. Make the public API call them directly. ok jsing --- src/lib/libcrypto/ec/ec_convert.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/lib/libcrypto/ec/ec_convert.c') diff --git a/src/lib/libcrypto/ec/ec_convert.c b/src/lib/libcrypto/ec/ec_convert.c index a151850f46..3fdbaf3ce7 100644 --- a/src/lib/libcrypto/ec/ec_convert.c +++ b/src/lib/libcrypto/ec/ec_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_convert.c,v 1.6 2024/10/31 05:03:57 tb Exp $ */ +/* $OpenBSD: ec_convert.c,v 1.7 2024/10/31 15:37:53 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -218,8 +218,8 @@ ec_oct_get_field_element_cbs(CBS *cbs, const EC_GROUP *group, BIGNUM *bn) return 1; } -size_t -ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, +static size_t +ec_oct_point2oct(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t conversion_form, unsigned char *buf, size_t len, BN_CTX *ctx) { @@ -308,8 +308,8 @@ ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, return ret; } -int -ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, +static int +ec_oct_oct2point(const EC_GROUP *group, EC_POINT *point, const unsigned char *buf, size_t len, BN_CTX *ctx) { CBS cbs; @@ -447,15 +447,11 @@ EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, if (ctx == NULL) goto err; - if (group->meth->point2oct == NULL) { - ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - goto err; - } if (group->meth != point->meth) { ECerror(EC_R_INCOMPATIBLE_OBJECTS); goto err; } - ret = group->meth->point2oct(group, point, form, buf, len, ctx); + ret = ec_oct_point2oct(group, point, form, buf, len, ctx); err: if (ctx != ctx_in) @@ -477,15 +473,11 @@ EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, if (ctx == NULL) goto err; - if (group->meth->oct2point == NULL) { - ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - goto err; - } if (group->meth != point->meth) { ECerror(EC_R_INCOMPATIBLE_OBJECTS); goto err; } - ret = group->meth->oct2point(group, point, buf, len, ctx); + ret = ec_oct_oct2point(group, point, buf, len, ctx); err: if (ctx != ctx_in) -- cgit v1.2.3-55-g6feb