ark-curves-cherry-picked/mnt6_298/src/curves/g1.rs
mnt6_298/src/curves/g1.rsRaw
1use ark_ec::{
2 mnt6,
3 models::{ModelParameters, SWModelParameters},
4};
5use ark_ff::{biginteger::BigInteger320, field_new};
6
7use crate::{Fq, Fr};
8
9pub type G1Affine = mnt6::G1Affine<crate::Parameters>;
10pub type G1Projective = mnt6::G1Projective<crate::Parameters>;
11pub type G1Prepared = mnt6::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 =
23 #[rustfmt::skip]
24 const COEFF_A: Fq = field_new!(Fq, BigInteger320([
25 0xb9b2411bfd0eafef,
26 0xc61a10fadd9fecbd,
27 0x89f128e59811f3fb,
28 0x980c0f780adadabb,
29 0x9ba1f11320,
30 ]));
31
32 /// COEFF_B =
33 #[rustfmt::skip]
34 const COEFF_B: Fq = field_new!(Fq, BigInteger320([
35 0xa94cb16ed8e733b,
36 0xe1ed15e8119bae6,
37 0xae927592157c8121,
38 0x990dbcbc6661cf95,
39 0xecff0892ef,
40 ]));
41
42 /// COFACTOR = 1
43 const COFACTOR: &'static [u64] = &[1];
44
45 /// COFACTOR^(-1) mod r =
46 /// 1
47 #[rustfmt::skip]
48 const COFACTOR_INV: Fr = field_new!(Fr, BigInteger320([
49 1784298994435064924,
50 16852041090100268533,
51 14258261760832875328,
52 2961187778261111191,
53 1929014752195,
54 ]));
55
56 /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
57 const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
58 (G1_GENERATOR_X, G1_GENERATOR_Y);
59}
60
61/// G1_GENERATOR_X =
62#[rustfmt::skip]
63pub const G1_GENERATOR_X: Fq = field_new!(Fq, BigInteger320([
64 0x1a663562f74e1d24,
65 0xc1d1d583fccd1b79,
66 0xda077538a9763df2,
67 0x70c4a4ea36aa01d9,
68 0x86537578a8,
69]));
70
71/// G1_GENERATOR_Y =
72#[rustfmt::skip]
73pub const G1_GENERATOR_Y: Fq = field_new!(Fq, BigInteger320([
74 0x7ad5bfd16dcfffb2,
75 0x88dd739252215070,
76 0x43f137a8b517b339,
77 0x9a7fac709a8c463c,
78 0x3140fbc3593,
79]));