Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean duplicated code #20

Open
clearloop opened this issue Dec 4, 2020 · 0 comments
Open

Clean duplicated code #20

clearloop opened this issue Dec 4, 2020 · 0 comments

Comments

@clearloop
Copy link
Collaborator

clearloop commented Dec 4, 2020

Desc

Here are lots of duplicated code in this repo, for example

  • The tests in ArkWorks have 5 copys
  • The tests in matter-labs have 2 * 2copys
  • The tests in Zcash mixed the tests of matter-labs which should be placed in root/fuzz

Code

The code is ready to be optimized after this week, use traits flexibly, we should construct a Curve trait for all solutions.

//! path `/crates/core/src/lib.rs`
/// Megaclite Curve Trait
pub trait Curve {
    type G1;
    type G2;
    type G1Affine;
    type G2Affine;
    type G1Projective;
    type G2Projective;
    type Fr;
}

Just like what we already did in matter-labs and arkworks, but this time, the trait we'll constructing will adapt all solutions including arkworks, matter-labs and zcash.

This was referenced Dec 4, 2020
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

No branches or pull requests

1 participant