ark-curves-cherry-picked/bls12_381/src/curves/mod.rs
bls12_381/src/curves/mod.rsRaw
1use ark_ec::bls12::{Bls12, Bls12Parameters, TwistType};
2
3use crate::{Fq, Fq12Config, Fq2Config, Fq6Config};
4
5pub mod g1;
6pub mod g2;
7
8#[cfg(test)]
9mod tests;
10
11pub use self::{
12 g1::{G1Affine, G1Projective},
13 g2::{G2Affine, G2Projective},
14};
15
16pub type Bls12_381 = Bls12<Parameters>;
17
18pub struct Parameters;
19
20impl Bls12Parameters for Parameters {
21 const X: &'static [u64] = &[0xd201000000010000];
22 const X_IS_NEGATIVE: bool = true;
23 const TWIST_TYPE: TwistType = TwistType::M;
24 type Fp = Fq;
25 type Fp2Config = Fq2Config;
26 type Fp6Config = Fq6Config;
27 type Fp12Config = Fq12Config;
28 type G1Parameters = self::g1::Parameters;
29 type G2Parameters = self::g2::Parameters;
30}