From edb45c2b1144a5b396f02254716c3eca85f9df7d Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 6 Feb 2026 16:09:52 -0500 Subject: [PATCH 1/2] Add lincomb_vartime function to LinearCombination trait --- elliptic-curve/src/ops.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/elliptic-curve/src/ops.rs b/elliptic-curve/src/ops.rs index de87b5806..3dc3b1230 100644 --- a/elliptic-curve/src/ops.rs +++ b/elliptic-curve/src/ops.rs @@ -172,6 +172,15 @@ where .map(|(point, scalar)| point * scalar) .sum() } + + /// Calculates `x1 * k1 + ... + xn * kn`. + /// + /// This is equivalent to [`LinearCombination::lincomb`] except + /// that it may leak the value of the points and/or scalars due to + /// variable-time behavior. + fn lincomb_vartime(points_and_scalars: &PointsAndScalars) -> Self { + lincomb(points_and_scalars) + } } /// Modular reduction to a non-zero output. From 34b7a1320db42e9a52d57857921aaaeb4046cf4b Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 6 Feb 2026 14:16:24 -0700 Subject: [PATCH 2/2] Update elliptic-curve/src/ops.rs --- elliptic-curve/src/ops.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elliptic-curve/src/ops.rs b/elliptic-curve/src/ops.rs index 3dc3b1230..84dddd60d 100644 --- a/elliptic-curve/src/ops.rs +++ b/elliptic-curve/src/ops.rs @@ -179,7 +179,7 @@ where /// that it may leak the value of the points and/or scalars due to /// variable-time behavior. fn lincomb_vartime(points_and_scalars: &PointsAndScalars) -> Self { - lincomb(points_and_scalars) + Self::lincomb(points_and_scalars) } }