ark-curves-cherry-picked/bw6_761/src/curves/mod.rs
bw6_761/src/curves/mod.rsRaw
1use ark_ec::{
2 bw6,
3 bw6::{BW6Parameters, 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 Parameters;
17
18impl BW6Parameters for Parameters {
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 G1Parameters = g1::Parameters;
54 type G2Parameters = g2::Parameters;
55}
56
57pub type BW6_761 = BW6<Parameters>;
58
59pub type G1Affine = bw6::G1Affine<Parameters>;
60pub type G1Projective = bw6::G1Projective<Parameters>;
61pub type G2Affine = bw6::G2Affine<Parameters>;
62pub type G2Projective = bw6::G2Projective<Parameters>;