nalinbhardwaj/Nova-Scotia

Use traits for cycle fields/groups instead of hardcoding

nalinbhardwaj opened this issue · 0 comments

Currently, all the types are hardcoded:

Nova-Scotia/src/lib.rs

Lines 28 to 38 in 1bc7e39

pub type G1 = pasta_curves::pallas::Point;
pub type F1 = <G1 as Group>::Scalar;
pub type EE1 = nova_snark::provider::ipa_pc::EvaluationEngine<G1>;
pub type S1 = nova_snark::spartan::RelaxedR1CSSNARK<G1, EE1>;
pub type G2 = pasta_curves::vesta::Point;
pub type F2 = <G2 as Group>::Scalar;
pub type EE2 = nova_snark::provider::ipa_pc::EvaluationEngine<G2>;
pub type S2 = nova_snark::spartan::RelaxedR1CSSNARK<G2, EE2>;
pub type C1 = CircomCircuit<F1>;
pub type C2 = TrivialTestCircuit<F2>;

These can be made generic and all the individual functions can be made trait-based for cleanliness. This can also be done for upstream Nova library code that hardcodes many functions similarly.