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::{biginteger::BigInteger768, field_new};
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
21impl SWModelParameters for Parameters {
22 /// COEFF_A = 2
23 #[rustfmt::skip]
24 const COEFF_A: Fq = field_new!(Fq, BigInteger768([
25 3553860551672651396,
26 2565472393707818253,
27 3424927325234966109,
28 17487811826058095619,
29 15730291918544907998,
30 4332070408724822737,
31 7212646118208244402,
32 12904649141092619460,
33 9289117987390442562,
34 2254330573517213976,
35 3065472942259520298,
36 271095073719429,
37 ]));
38
39 /// COEFF_B = 0x01373684A8C9DCAE7A016AC5D7748D3313CD8E39051C596560835DF0C9E50A5B59B882A92C78DC537E51A16703EC9855C77FC3D8BB21C8D68BB8CFB9DB4B8C8FBA773111C36C8B1B4E8F1ECE940EF9EAAD265458E06372009C9A0491678EF4
40 #[rustfmt::skip]
41 const COEFF_B: Fq = field_new!(Fq, BigInteger768([
42 2672638521926201442,
43 17587766986973859626,
44 1309143029066506763,
45 1756412671449422902,
46 5395165286423163724,
47 589638022240022974,
48 7360845090332416697,
49 9829497896347590557,
50 9341553552113883496,
51 5888515763059971584,
52 10173739464651404689,
53 456607542322059,
54 ]));
55
56 /// COFACTOR = 1
57 const COFACTOR: &'static [u64] = &[1];
58
59 /// COFACTOR^(-1) mod r =
60 /// 1
61 #[rustfmt::skip]
62 const COFACTOR_INV: Fr = FR_ONE;
63
64 /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
65 const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
66 (G1_GENERATOR_X, G1_GENERATOR_Y);
67}
68
69// Generator of G1
70// X = 7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569,
71// Y = 6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648,
72/// G1_GENERATOR_X =
73#[rustfmt::skip]
74pub const G1_GENERATOR_X: Fq = field_new!(Fq, BigInteger768([
75 9433494781491502420,
76 373642694095780604,
77 7974079134466535382,
78 15325904219470166885,
79 16825705122208020751,
80 898733863352481713,
81 3802318585082797759,
82 14417069684372068941,
83 4332882897981414838,
84 15138727514183191816,
85 16850594895992448907,
86 30598511593902
87]));
88
89/// G1_GENERATOR_Y =
90#[rustfmt::skip]
91pub const G1_GENERATOR_Y: Fq = field_new!(Fq, BigInteger768([
92 15710199097794077134,
93 3645667958306606136,
94 8298269426007169475,
95 5277073422205725562,
96 10451808582969862130,
97 14392820246664025579,
98 4365987620174557815,
99 14007263953321073101,
100 1355600847400958219,
101 3872959105252355444,
102 18016882244107198324,
103 424779036457857
104]));