ethrex_crypto/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2
3#[cfg(not(feature = "std"))]
4extern crate alloc;
5
6pub mod blake2f;
7#[cfg(feature = "blst")]
8mod bls_blst;
9pub mod keccak;
10pub mod kzg;
11pub mod native;
12#[cfg(feature = "aws-lc-rs")]
13mod p256_awslc;
14pub mod provider;
15pub use native::NativeCrypto;
16pub use provider::{Crypto, CryptoError};
17
18/// `true` when `NativeCrypto` routes `secp256r1_verify` through the native
19/// aws-lc-rs backend; `false` when it falls back to the portable `p256` trait
20/// default (e.g. zkVM guest builds). Differential tests assert this so they
21/// fail loudly instead of silently comparing the pure-Rust backend to itself.
22pub const NATIVE_P256_BACKEND: bool = cfg!(feature = "aws-lc-rs");
23
24/// `true` when `NativeCrypto` routes BLS12-381 through the native blst backend;
25/// `false` when it falls back to the portable `bls12_381` trait default (e.g.
26/// zkVM guest builds). Differential tests assert this so they fail loudly
27/// instead of silently comparing the pure-Rust backend to itself.
28pub const NATIVE_BLS_BACKEND: bool = cfg!(feature = "blst");