elliptic-curves icon indicating copy to clipboard operation
elliptic-curves copied to clipboard

Optimize point multiplication using larger window size

Open cookingypq opened this issue 11 months ago • 2 comments

Hey there!

I noticed we could improve the performance of point multiplication in the primeorder crate by using a larger window size in the sliding window algorithm.

Currently we're using a 4-bit window which requires more point additions than necessary.

By increasing the window size to 5 or 6 bits, we can reduce the number of point additions while keeping the precomputation table size reasonable.

This should give us a nice performance boost for scalar multiplication operations.

I'd be happy to implement this change if you think it's a good idea!

cookingypq avatar May 07 '25 12:05 cookingypq

In the mul implementation in primeorder/src/projective.rs

we can improve performance by optimizing the dot product algorithm

cookingypq avatar May 07 '25 12:05 cookingypq

It's worth experimenting with, though it would be good to see the performance improvements reflected in benchmarks

tarcieri avatar May 07 '25 23:05 tarcieri