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, fields::FpParameters, Fp3};
 2
 3use ark_ec::models::mnt6::{MNT6Parameters, MNT6};
 4
 5use crate::{Fq, Fq3, Fq3Parameters, Fq6Parameters, FqParameters, 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        field_new!(Fq, BigInteger320([
29            0xb9b2411bfd0eafef,
30            0xc61a10fadd9fecbd,
31            0x89f128e59811f3fb,
32            0x980c0f780adadabb,
33            0x9ba1f11320,
34        ])),
35    );
36    const ATE_LOOP_COUNT: &'static [u64] = &[0xdc9a1b671660000, 0x46609756bec2a33f, 0x1eef55];
37    const ATE_IS_LOOP_COUNT_NEG: bool = true;
38    const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger320 = BigInteger320([0x1, 0x0, 0x0, 0x0, 0x0]);
39    const FINAL_EXPONENT_LAST_CHUNK_W0_IS_NEG: bool = true;
40    const FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0: BigInteger320 =
41        BigInteger320([0xdc9a1b671660000, 0x46609756bec2a33f, 0x1eef55, 0x0, 0x0]);
42    type Fp = Fq;
43    type Fr = Fr;
44    type Fp3Params = Fq3Parameters;
45    type Fp6Params = Fq6Parameters;
46    type G1Parameters = self::g1::Parameters;
47    type G2Parameters = self::g2::Parameters;
48}
49
50pub const FQ_ZERO: Fq = field_new!(Fq, BigInteger320([0, 0, 0, 0, 0]));
51pub const FQ_ONE: Fq = field_new!(Fq, FqParameters::R);