dcrypt_algorithms/ec/bls12_381/
mod.rs

1//! BLS12-381 pairing-friendly elliptic curve implementation.
2//!
3//! **Warning:** Unaudited implementation. Use at your own risk.
4
5// External crates
6#[cfg(feature = "alloc")]
7extern crate alloc;
8
9// Module declarations
10mod field;
11mod g1;
12mod g2;
13mod pairings;
14mod scalar;
15
16#[cfg(test)]
17mod tests;
18
19// Internal use for submodules
20use scalar::Scalar;
21
22// Public API exports (following dcrypt conventions)
23pub use g1::{G1Affine, G1Projective};
24pub use g2::{G2Affine, G2Projective};
25pub use pairings::{pairing, Bls12, Gt, MillerLoopResult};
26pub use self::scalar::Scalar as Bls12_381Scalar;
27// Remove the duplicate: pub use self::scalar::Scalar;
28
29#[cfg(feature = "alloc")]
30pub use pairings::{multi_miller_loop, G2Prepared};
31
32// BLS curve parameters
33/// BLS parameter x = -0xd201000000010000
34const BLS_X: u64 = 0xd201_0000_0001_0000;
35/// Sign of BLS parameter x
36const BLS_X_IS_NEGATIVE: bool = true;