Skip to content

elliptic-curve: add BasepointTableVartime::lincomb#2405

Merged
tarcieri merged 1 commit intomasterfrom
elliptic-curve/basepoint-table-vartime-lincomb
May 7, 2026
Merged

elliptic-curve: add BasepointTableVartime::lincomb#2405
tarcieri merged 1 commit intomasterfrom
elliptic-curve/basepoint-table-vartime-lincomb

Conversation

@tarcieri
Copy link
Copy Markdown
Member

@tarcieri tarcieri commented May 7, 2026

Uses WnafBase::multiscalar_mul added in RustCrypto/group#14 to provide a variable-time linear combination operation which can use the precomputed wNAF for a basepoint.

This has been tested in p256 where it provides a 25% speedup for ECDSA verification.

Uses `WnafBase::multiscalar_mul` added in RustCrypto/group#14 to provide
a variable-time linear combination operation which can use the
precomputed wNAF for a basepoint.

This has been tested in `p256` where it provides a 25% speedup for ECDSA
verification.
@tarcieri tarcieri merged commit 95838a0 into master May 7, 2026
86 checks passed
@tarcieri tarcieri deleted the elliptic-curve/basepoint-table-vartime-lincomb branch May 7, 2026 03:38
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request May 7, 2026
Adds a trait method that can be overridden to plug in variable-time
linear combinations using precomputed wNAF for the basepoint which
otherwise uses `lincomb_vartime` by default.

When used in `p256` in combination with RustCrypto/traits#2405 which
added `BasepointTableVartime::lincomb`, this results in a 25% speedup
for ECDSA verification:

    ECDSA/P-256 (SHA-256)/verify
        time:   [146.21 µs 147.14 µs 148.38 µs]
        change: [−25.356% −24.522% −23.756%] (p = 0.00 < 0.05)
        Performance has improved.

Also applies the optimization to `p384`, `p521`, and `sm2`.
tarcieri added a commit to RustCrypto/elliptic-curves that referenced this pull request May 7, 2026
…1759)

Adds a trait method that can be overridden to plug in variable-time
linear combinations using precomputed wNAF for the basepoint which
otherwise uses `lincomb_vartime` by default.

When used in `p256` in combination with RustCrypto/traits#2405 which
added `BasepointTableVartime::lincomb`, this results in a 25% speedup
for ECDSA verification:

    ECDSA/P-256 (SHA-256)/verify
        time:   [146.21 µs 147.14 µs 148.38 µs]
        change: [−25.356% −24.522% −23.756%] (p = 0.00 < 0.05)
        Performance has improved.

Also applies the optimization to `p384`, `p521`, and `sm2`.
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.

1 participant