arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/bw6_767/src/curves/mod.rs
bw6_767/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    // X is the same as in bls12_381
20    const X: BigInteger = BigInt!("0xd201000000010000");
21    const X_IS_NEGATIVE: bool = true;
22    // X
23    const ATE_LOOP_COUNT_1: &'static [u64] = &[0xd201000000010000];
24    const X_MINUS_1_DIV_3: BigInteger = BigInt!("0x460055555555aaab");
25    const ATE_LOOP_COUNT_1_IS_NEGATIVE: bool = true;
26    // X^2-X-1
27    const ATE_LOOP_COUNT_2: &'static [i8] = &[
28        -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29        0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
30        1, 0, -1, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
31        0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, -1, 0, -1, 0, 1, 0, 0, 1,
32        0, 0, 0, -1, 0, -1, 0, -1, 0, 1,
33    ];
34    const ATE_LOOP_COUNT_2_IS_NEGATIVE: bool = false;
35    const TWIST_TYPE: TwistType = TwistType::M;
36    const H_T: i64 = -4;
37    const H_Y: i64 = -6;
38    const T_MOD_R_IS_ZERO: bool = true;
39    type Fp = Fq;
40    type Fp3Config = Fq3Config;
41    type Fp6Config = Fq6Config;
42    type G1Config = g1::Config;
43    type G2Config = g2::Config;
44}
45
46pub type BW6_767 = BW6<Config>;
47
48pub type G1Affine = bw6::G1Affine<Config>;
49pub type G1Projective = bw6::G1Projective<Config>;
50pub type G2Affine = bw6::G2Affine<Config>;
51pub type G2Projective = bw6::G2Projective<Config>;