c_kzg/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3#[macro_use]
4extern crate alloc;
5
6// This `extern crate` invocation tells `rustc` that we actually need the symbols from `blst`.
7// Without it, the compiler won't link to `blst` when compiling this crate.
8// See: https://kornel.ski/rust-sys-crate#linking
9extern crate blst;
10
11mod bindings;
12
13#[cfg(feature = "ethereum_kzg_settings")]
14mod ethereum_kzg_settings;
15
16// Expose relevant types with idiomatic names.
17pub use bindings::{
18    KZGCommitment as KzgCommitment, KZGProof as KzgProof, KZGSettings as KzgSettings,
19    C_KZG_RET as CkzgError,
20};
21
22// Expose the default settings.
23#[cfg(feature = "ethereum_kzg_settings")]
24pub use ethereum_kzg_settings::{ethereum_kzg_settings, ethereum_kzg_settings_arc};
25
26// Expose the constants.
27pub use bindings::{
28    BYTES_PER_BLOB, BYTES_PER_COMMITMENT, BYTES_PER_FIELD_ELEMENT, BYTES_PER_G1_POINT,
29    BYTES_PER_G2_POINT, BYTES_PER_PROOF, FIELD_ELEMENTS_PER_BLOB,
30};
31// Expose the remaining relevant types.
32pub use bindings::{Blob, Bytes32, Bytes48, Error};