From afdc57eab5bd921a48cd2b40985eee6550c7da44 Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 24 Jun 2023 18:21:07 +0000 Subject: [PATCH] Remove precompute_mult/have_precompute_mult from EC_METHOD. These are no longer in use - stub EC_GROUP_precompute_mult() and EC_GROUP_have_precompute_mult() to match their existing behaviour. ok tb@ --- lib/libcrypto/ec/ec_lib.c | 26 +++----------------------- lib/libcrypto/ec/ec_local.h | 4 +--- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index 93a90651290..cb581f6e1c1 100644 --- a/lib/libcrypto/ec/ec_lib.c +++ b/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.59 2023/06/24 17:49:44 jsing Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.60 2023/06/24 18:21:07 jsing Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -1390,33 +1390,13 @@ EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx_in) { - BN_CTX *ctx; - int ret = 0; - - if (group->meth->precompute_mult == NULL) - return 1; - - if ((ctx = ctx_in) == NULL) - ctx = BN_CTX_new(); - if (ctx == NULL) - goto err; - - ret = group->meth->precompute_mult(group, ctx); - - err: - if (ctx != ctx_in) - BN_CTX_free(ctx); - - return ret; + return 1; } int EC_GROUP_have_precompute_mult(const EC_GROUP *group) { - if (group->meth->have_precompute_mult == NULL) - return 0; - - return group->meth->have_precompute_mult(group); + return 0; } int diff --git a/lib/libcrypto/ec/ec_local.h b/lib/libcrypto/ec/ec_local.h index c0689a3c3e6..caa73bc7288 100644 --- a/lib/libcrypto/ec/ec_local.h +++ b/lib/libcrypto/ec/ec_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_local.h,v 1.16 2023/06/24 17:49:44 jsing Exp $ */ +/* $OpenBSD: ec_local.h,v 1.17 2023/06/24 18:21:07 jsing Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -145,8 +145,6 @@ struct ec_method_st { int (*mul_double_nonct)(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, const BIGNUM *p_scalar, const EC_POINT *point, BN_CTX *); - int (*precompute_mult)(EC_GROUP *group, BN_CTX *); - int (*have_precompute_mult)(const EC_GROUP *group); /* * Internal methods. -- 2.20.1