Reduce duplicate code across different curve cycle providers#255
Reduce duplicate code across different curve cycle providers#255srinathsetty merged 3 commits intomicrosoft:mainfrom
Conversation
321bc70 to
6f9990e
Compare
Does it actually close the issue? There is still impl_traits that is duplicated between mod.rs and pasta.rs, right? |
I don't fully understand this question. Can you please elaborate? |
Exactly.
Sorry for confusing. It seems we can't save the number of constraints, because the Weierstrass affine coordinate still needs condition branch. |
* Small code improvement to the minroot example (microsoft#264) about 10% improvement for the non-release mode * Reduce duplicate code across different curve cycle providers (microsoft#255) * refactor: impl folding macro * refactor: generalize curve test * chore: rename impl_folding to impl_engine * reorganize provider module (microsoft#267) --------- Co-authored-by: field-worker <[email protected]> Co-authored-by: ashWhiteHat <[email protected]> Co-authored-by: Srinath Setty <[email protected]>
I reduced test and transcript trait code across curve cycle by macros.
improvement
curve cycle group methods difference is only vartime_multiscalar_mul.
https://github.com/microsoft/Nova/blob/main/src/provider/mod.rs#L159
If we call msm method through such that
Self::msm(), we can use same trait between pasta and other cycle pair.question
Is there any reason not to use complete addition for
eccgadget?https://github.com/microsoft/Nova/blob/main/src/gadgets/ecc.rs#L135
We can skip condition branch constraint.
typo

theduplicationhttps://eprint.iacr.org/2023/1192.pdf#page=4&zoom=100,100,250
I would appreciate it if you could confirm.
Thank you.