RustCrypto / elliptic-curves

Collection of pure Rust elliptic curve implementations: NIST P-224, P-256, P-384, P-521, secp256k1, SM2
681 stars 189 forks source link

Generalizing MulByGenerator for other points #939

Open randombit opened 1 year ago

randombit commented 1 year ago

MulByGenerator exposes a faster multiplication using a precomputed table. Is there any interest in extending this support for handling other (application supplied) points, where the cost of precomputation can similarly be amortized over many multiplications?

For context DFINITY's threshold ECDSA implementation uses k256 and p256 and there we have two generators, namely the typical one used in the group plus a second (derived using hash to curve) so we can do Pedersen commitments.

tarcieri commented 1 year ago

Better precomputation support, including precomputing tables for arbitrary points, and especially via a trait-based API that could be used across curves, would definitely be something nice to have