ark-curves-cherry-picked/mnt4_753/src/curves/g1.rs
mnt4_753/src/curves/g1.rsRaw
1use ark_ec::{
2 mnt4,
3 models::{ModelParameters, SWModelParameters},
4};
5use ark_ff::MontFp;
6
7use crate::{Fq, Fr, FR_ONE};
8
9pub type G1Affine = mnt4::G1Affine<crate::Parameters>;
10pub type G1Projective = mnt4::G1Projective<crate::Parameters>;
11pub type G1Prepared = mnt4::G1Prepared<crate::Parameters>;
12
13#[derive(Clone, Default, PartialEq, Eq)]
14pub struct Parameters;
15
16impl ModelParameters for Parameters {
17 type BaseField = Fq;
18 type ScalarField = Fr;
19
20 /// COFACTOR = 1
21 const COFACTOR: &'static [u64] = &[1];
22
23 /// COFACTOR^(-1) mod r = 1
24 const COFACTOR_INV: Fr = FR_ONE;
25}
26
27impl SWModelParameters for Parameters {
28 /// COEFF_A = 2
29 const COEFF_A: Fq = MontFp!(Fq, "2");
30
31 /// COEFF_B = 0x01373684A8C9DCAE7A016AC5D7748D3313CD8E39051C596560835DF0C9E50A5B59B882A92C78DC537E51A16703EC9855C77FC3D8BB21C8D68BB8CFB9DB4B8C8FBA773111C36C8B1B4E8F1ECE940EF9EAAD265458E06372009C9A0491678EF4
32 const COEFF_B: Fq = MontFp!(Fq, "28798803903456388891410036793299405764940372360099938340752576406393880372126970068421383312482853541572780087363938442377933706865252053507077543420534380486492786626556269083255657125025963825610840222568694137138741554679540");
33
34 /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
35 const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
36 (G1_GENERATOR_X, G1_GENERATOR_Y);
37}
38
39// Generator of G1
40// X = 7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569,
41// Y = 6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648,
42/// G1_GENERATOR_X =
43/// 7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569
44pub const G1_GENERATOR_X: Fq = MontFp!(Fq, "7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569");
45
46/// G1_GENERATOR_Y =
47/// 6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648
48pub const G1_GENERATOR_Y: Fq = MontFp!(Fq, "6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648");