arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/bw6_761/src/curves/mod.rs
bw6_761/src/curves/mod.rsRaw
 1use ark_ec::{
 2    bw6,
 3    bw6::{BW6Config, TwistType, BW6},
 4};
 5use ark_ff::{biginteger::BigInteger768 as BigInteger, BigInt};
 6
 7use crate::*;
 8
 9pub mod g1;
10pub mod g2;
11
12#[cfg(test)]
13mod tests;
14
15#[derive(PartialEq, Eq)]
16pub struct Config;
17
18impl BW6Config for Config {
19    const X: BigInteger = BigInt::new([
20        0x8508c00000000001,
21        0x0,
22        0x0,
23        0x0,
24        0x0,
25        0x0,
26        0x0,
27        0x0,
28        0x0,
29        0x0,
30        0x0,
31        0x0,
32    ]);
33    /// `x` is positive.
34    const X_IS_NEGATIVE: bool = false;
35    // X+1
36    const ATE_LOOP_COUNT_1: &'static [u64] = &[0x8508c00000000002];
37    const ATE_LOOP_COUNT_1_IS_NEGATIVE: bool = false;
38    // X^3-X^2-X
39    const ATE_LOOP_COUNT_2: &'static [i8] = &[
40        -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43        0, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
44        0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, 0,
45        1, 0, 0, 0, -1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, -1, 0, 1, 0, 1, 0, 0, 0, 1,
46        0, -1, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1,
47    ];
48    const ATE_LOOP_COUNT_2_IS_NEGATIVE: bool = false;
49    const TWIST_TYPE: TwistType = TwistType::M;
50    type Fp = Fq;
51    type Fp3Config = Fq3Config;
52    type Fp6Config = Fq6Config;
53    type G1Config = g1::Config;
54    type G2Config = g2::Config;
55}
56
57pub type BW6_761 = BW6<Config>;
58
59pub type G1Affine = bw6::G1Affine<Config>;
60pub type G1Projective = bw6::G1Projective<Config>;
61pub type G2Affine = bw6::G2Affine<Config>;
62pub type G2Projective = bw6::G2Projective<Config>;