use ark_ec::{ mnt4, models::{ModelParameters, SWModelParameters}, }; use ark_ff::MontFp; use crate::{Fq, Fr, FR_ONE}; pub type G1Affine = mnt4::G1Affine; pub type G1Projective = mnt4::G1Projective; pub type G1Prepared = mnt4::G1Prepared; #[derive(Clone, Default, PartialEq, Eq)] pub struct Parameters; impl ModelParameters for Parameters { type BaseField = Fq; type ScalarField = Fr; /// COFACTOR = 1 const COFACTOR: &'static [u64] = &[1]; /// COFACTOR^(-1) mod r = /// 1 const COFACTOR_INV: Fr = FR_ONE; } impl SWModelParameters for Parameters { /// COEFF_A = 2 /// Reference: const COEFF_A: Fq = MontFp!(Fq, "2"); /// COEFF_B = 423894536526684178289416011533888240029318103673896002803341544124054745019340795360841685 /// Reference: const COEFF_B: Fq = MontFp!(Fq, "423894536526684178289416011533888240029318103673896002803341544124054745019340795360841685"); /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y) const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) = (G1_GENERATOR_X, G1_GENERATOR_Y); } // Generator of G1 // X = 60760244141852568949126569781626075788424196370144486719385562369396875346601926534016838, // Y = 363732850702582978263902770815145784459747722357071843971107674179038674942891694705904306, /// G1_GENERATOR_X /// Reference: pub const G1_GENERATOR_X: Fq = MontFp!( Fq, "60760244141852568949126569781626075788424196370144486719385562369396875346601926534016838" ); /// G1_GENERATOR_Y /// Reference: pub const G1_GENERATOR_Y: Fq = MontFp!( Fq, "363732850702582978263902770815145784459747722357071843971107674179038674942891694705904306" );