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