Trust-Machines / p256k1

Wrappers around secp256k1 to expose the underlying math, specifically unwrapped points and scalars with multiexponentiation
Apache License 2.0
12 stars 6 forks source link

Add a MultiMult trait and a Point fn which uses it for the multimult operation #70

Closed xoloki closed 1 year ago

xoloki commented 1 year ago

This PR adds a trait MultiMult and a Point::multimult_trait fn which uses it for multimult ops. The existing ScalarsPoints object now implements the trait, and the existing Point::multimult fn now just makes a ScalarsPoints object and passes it to multimult_trait. This resolves #69

The trait also defines a fn get_scratch_size with a default implementation of get_size() * 512, which was empirically determined to be an optimal scratch size. This resolves #17

codecov[bot] commented 1 year ago

Codecov Report

Merging #70 (c94c3fd) into master (e299a92) will increase coverage by 0.05%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   55.89%   55.94%   +0.05%     
==========================================
  Files           9       10       +1     
  Lines         662      681      +19     
==========================================
+ Hits          370      381      +11     
- Misses        292      300       +8     
Impacted Files Coverage Δ
p256k1/src/point.rs 66.83% <94.73%> (-1.32%) :arrow_down:
p256k1/src/traits.rs 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

cloudflare-workers-and-pages[bot] commented 1 year ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c94c3fd
Status: ✅  Deploy successful!
Preview URL: https://308d94a5.p256k1.pages.dev
Branch Preview URL: https://trait-multi.p256k1.pages.dev

View logs