zkmega
zkmega copied to clipboard
Clean duplicated code
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.