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