ark-curves-cherry-picked/mnt6_298/src/curves/mod.rs
mnt6_298/src/curves/mod.rsRaw
1use ark_ff::{biginteger::BigInteger320, field_new, Fp3};
2
3use ark_ec::{
4 models::mnt6::{MNT6Parameters, MNT6},
5 SWModelParameters,
6};
7
8use crate::{Fq, Fq3, Fq3Parameters, Fq6Parameters, Fr};
9
10pub mod g1;
11pub mod g2;
12
13#[cfg(test)]
14mod tests;
15
16pub use self::{
17 g1::{G1Affine, G1Prepared, G1Projective},
18 g2::{G2Affine, G2Prepared, G2Projective},
19};
20
21pub type MNT6_298 = MNT6<Parameters>;
22
23pub struct Parameters;
24
25impl MNT6Parameters for Parameters {
26 const TWIST: Fp3<Self::Fp3Params> = field_new!(Fq3, FQ_ZERO, FQ_ONE, FQ_ZERO);
27 #[rustfmt::skip]
28 const TWIST_COEFF_A: Fp3<Self::Fp3Params> = field_new!(Fq3,
29 FQ_ZERO,
30 FQ_ZERO,
31 g1::Parameters::COEFF_A,
32 );
33 const ATE_LOOP_COUNT: &'static [u64] = &[0xdc9a1b671660000, 0x46609756bec2a33f, 0x1eef55];
34 const ATE_IS_LOOP_COUNT_NEG: bool = true;
35 const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger320 = BigInteger320([0x1, 0x0, 0x0, 0x0, 0x0]);
36 const FINAL_EXPONENT_LAST_CHUNK_W0_IS_NEG: bool = true;
37 const FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0: BigInteger320 =
38 BigInteger320([0xdc9a1b671660000, 0x46609756bec2a33f, 0x1eef55, 0x0, 0x0]);
39 type Fp = Fq;
40 type Fr = Fr;
41 type Fp3Params = Fq3Parameters;
42 type Fp6Params = Fq6Parameters;
43 type G1Parameters = self::g1::Parameters;
44 type G2Parameters = self::g2::Parameters;
45}
46
47pub const FQ_ZERO: Fq = field_new!(Fq, "0");
48pub const FQ_ONE: Fq = field_new!(Fq, "1");