summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorjsing <>2025-01-22 09:56:58 +0000
committerjsing <>2025-01-22 09:56:58 +0000
commite7605a5f9628e0963785991b55f4323b645d578d (patch)
treed2ec6435082a34e334b6f6b0786fa0de6fecc1c7 /src/lib/libcrypto/ec/ec_lib.c
parentbd450906a6797685e2415f6b369eaba032238591 (diff)
downloadopenbsd-e7605a5f9628e0963785991b55f4323b645d578d.tar.gz
openbsd-e7605a5f9628e0963785991b55f4323b645d578d.tar.bz2
openbsd-e7605a5f9628e0963785991b55f4323b645d578d.zip
Remove the mul_generator_ct function pointer from EC_METHOD.
There's no need for a separate mul_generator_ct() function pointer - we really only need mul_single_ct() and mul_double_nonct(). And rather than calling ec_mul_ct() and having it figure out which point to use, explicitly pass the generator point when calling mul_single_ct(). ok tb@
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index f906054603..a60543ab98 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.112 2025/01/21 17:01:25 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.113 2025/01/22 09:56:58 jsing 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 */
@@ -1347,8 +1347,7 @@ EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
1347 if (ctx == NULL) 1347 if (ctx == NULL)
1348 goto err; 1348 goto err;
1349 1349
1350 if (group->meth->mul_generator_ct == NULL || 1350 if (group->meth->mul_single_ct == NULL ||
1351 group->meth->mul_single_ct == NULL ||
1352 group->meth->mul_double_nonct == NULL) { 1351 group->meth->mul_double_nonct == NULL) {
1353 ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 1352 ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
1354 goto err; 1353 goto err;
@@ -1363,7 +1362,8 @@ EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
1363 * secret. This is why we ignore if BN_FLG_CONSTTIME is actually 1362 * secret. This is why we ignore if BN_FLG_CONSTTIME is actually
1364 * set and we always call the constant time version. 1363 * set and we always call the constant time version.
1365 */ 1364 */
1366 ret = group->meth->mul_generator_ct(group, r, g_scalar, ctx); 1365 ret = group->meth->mul_single_ct(group, r, g_scalar,
1366 group->generator, ctx);
1367 } else if (g_scalar == NULL && point != NULL && p_scalar != NULL) { 1367 } else if (g_scalar == NULL && point != NULL && p_scalar != NULL) {
1368 /* 1368 /*
1369 * In this case we want to compute p_scalar * GenericPoint: 1369 * In this case we want to compute p_scalar * GenericPoint: