midnight_curves/
lib.rs

1//! # `blstrs`
2//!
3//! An implementation of the BLS12-381 pairing-friendly elliptic curve
4//! construction.
5
6#![deny(clippy::perf, clippy::correctness)]
7#![allow(clippy::many_single_char_names)]
8#![allow(clippy::wrong_self_convention)]
9
10#[cfg(not(target_endian = "little"))]
11compile_error!("blstrs is only supported on little endian architectures");
12
13#[macro_use]
14mod arithmetic;
15
16#[macro_use]
17mod derive;
18
19mod curve;
20pub mod ff_ext;
21pub mod fft;
22pub mod hash_to_curve;
23pub mod msm;
24pub mod serde;
25pub mod serde_traits;
26
27// Production curves (always available)
28pub mod bls12_381;
29mod jubjub;
30pub mod secp256k1;
31
32// Development/testing curves (feature-gated)
33#[cfg(any(test, feature = "dev-curves"))]
34pub mod bn256;
35
36// Re-exports for production curves
37pub use bls12_381::{
38    unique_messages, Bls12, Fp, Fq, G1Affine, G1Projective, G2Affine, G2Prepared, G2Projective, Gt,
39    MillerLoopResult, PairingG1G2, PairingG2G1, A, B,
40};
41pub use curve::{Coordinates, CurveAffine, CurveExt};
42pub use jubjub::*;
43// // Re-export pairing library for compatibility with halo2 ecosystem
44pub use pairing;
45
46#[cfg(feature = "serde")]
47mod serde_impl;
48
49#[cfg(test)]
50pub mod tests;
51
52#[cfg(feature = "__private_bench")]
53pub use bls12_381::{Fp12, Fp2};