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