Skip to content

elliptic-curve: add MulByGeneratorVartime trait#2381

Merged
tarcieri merged 1 commit intomasterfrom
elliptic-curve/vartime-basepoint-multiplication-apis
Apr 11, 2026
Merged

elliptic-curve: add MulByGeneratorVartime trait#2381
tarcieri merged 1 commit intomasterfrom
elliptic-curve/vartime-basepoint-multiplication-apis

Conversation

@tarcieri
Copy link
Copy Markdown
Member

Closes #2375

We now have variable-time precomputed basepoint tables that use wNAF when the basepoint-table and alloc features are enabled, which can be opportunistically used when these features are enabled to accelerate this operation.

We use Group::mul_by_generator for the constant-time basepoint tables, however for an extension trait this is captured as MulByGeneratorVartime::mul_by_generator_vartime.

As discussed in the above issue, and inspired by curve25519-dalek's EdwardsPoint::vartime_double_scalar_mul_basepoint function, this adds MulByGeneratorVartime::mul_by_generator_and_mul_add_point_vartime as a provided method. This function is the core of many signature algorithms, and when the basepoint tables and alloc are unavailable it can fall back to a linear combination and still provide better performance than the naive constant time version.

Closes #2375

We now have variable-time precomputed basepoint tables that use wNAF
when the `basepoint-table` and `alloc` features are enabled, which can
be opportunistically used when these features are enabled to accelerate
this operation.

We use `Group::mul_by_generator` for the constant-time basepoint tables,
however for an extension trait this is captured as
`MulByGeneratorVartime::mul_by_generator_vartime`.

As discussed in the above issue, and inspired by `curve25519-dalek`'s
`EdwardsPoint::vartime_double_scalar_mul_basepoint` function, this adds
`MulByGeneratorVartime::mul_by_generator_and_mul_add_point_vartime`
as a provided method. This function is the core of many signature
algorithms, and when the basepoint tables and alloc are unavailable it
can fall back to a linear combination and still provide better
performance than the naive constant time version.
@tarcieri tarcieri merged commit 45489da into master Apr 11, 2026
15 checks passed
@tarcieri tarcieri deleted the elliptic-curve/vartime-basepoint-multiplication-apis branch April 11, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elliptic-curve: trait(s) for variable-time multiplication by the base point

1 participant