Skip to content

primeorder: faster lincomb_vartime when alloc enabled#1758

Merged
tarcieri merged 1 commit intomasterfrom
primeorder/faster-lincomb-vartime
May 7, 2026
Merged

primeorder: faster lincomb_vartime when alloc enabled#1758
tarcieri merged 1 commit intomasterfrom
primeorder/faster-lincomb-vartime

Conversation

@tarcieri
Copy link
Copy Markdown
Member

@tarcieri tarcieri commented May 7, 2026

Companion PR to RustCrypto/group#14, which adds WnafBase::multiscalar_mul using Straus' method.

When the alloc feature is enabled, this is used to compute LinearCombination::lincomb_vartime.

Also includes updated tests and benchmarks for p256 to ensure lincomb_vartime computes the same results as using the Add and Mul traits, and show the relative performance improvement, which is a ~28% speedup on p256 for a 3 scalar/point input:

ProjectivePoint operations/point-scalar lincomb (variable-time)
    time:   [149.13 µs 149.80 µs 150.84 µs]
    change: [−27.999% −27.645% −27.267%] (p = 0.00 < 0.05)

Companion PR to RustCrypto/group#14, which adds
`WnafBase::multiscalar_mul` using Straus' method.

When the `alloc` feature is enabled, this is used to compute
`LinearCombination::lincomb_vartime`.

Also includes updated tests and benchmarks for `p256` to ensure
`lincomb_vartime` computes the same results as using the `Add` and `Mul`
traits, and show the relative performance improvement, which is a
~28% speedup on `p256` for a 3 scalar/point input:

    ProjectivePoint operations/point-scalar lincomb (variable-time)
	time:   [149.13 µs 149.80 µs 150.84 µs]
	change: [−27.999% −27.645% −27.267%] (p = 0.00 < 0.05)
@tarcieri tarcieri force-pushed the primeorder/faster-lincomb-vartime branch from 42466ca to 5590b8b Compare May 7, 2026 01:28
@tarcieri tarcieri merged commit ddbaa08 into master May 7, 2026
159 checks passed
@tarcieri tarcieri deleted the primeorder/faster-lincomb-vartime branch May 7, 2026 01:48
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