openvm_stark_backend/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Backend for proving and verifying mixed-matrix STARKs.
//! The backend is designed to be modular and compatible with different proof systems.
//! The aim is to support different circuit representations and permutation/lookup arguments.

// Re-export all Plonky3 crates
pub use p3_air;
pub use p3_challenger;
pub use p3_commit;
pub use p3_field;
pub use p3_matrix;
pub use p3_maybe_rayon;
pub use p3_util;

/// AIR builders for prover and verifier, including support for cross-matrix permutation arguments.
pub mod air_builders;
/// Trait for stateful chip that owns trace generation
mod chip;
/// API trait for circuit prover/verifier.
pub mod circuit_api;
/// Types for tracking matrix in system with multiple commitments, each to multiple matrices.
pub mod commit;
/// Helper types associated to generic STARK config.
pub mod config;
/// Trait for STARK backend engine proving keygen, proviing, verifying API functions.
pub mod engine;
/// GKR batch prover for Grand Product and LogUp lookup arguments.
pub mod gkr;
/// Log-up permutation argument implementation as RAP.
pub mod interaction;
/// Proving and verifying key generation
pub mod keygen;
/// Polynomials
pub mod poly;
/// Prover implementation for partitioned multi-matrix AIRs.
pub mod prover;
/// Trait for RAP (Randomized AIR with Preprocessing)
pub mod rap;
pub mod sumcheck;
/// Utility functions
pub mod utils;
/// Verifier implementation
pub mod verifier;

pub use chip::{Chip, ChipUsageGetter};

// Use jemalloc as global allocator for performance
#[cfg(all(feature = "jemalloc", unix, not(test)))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

// Use mimalloc as global allocator
#[cfg(all(feature = "mimalloc", not(test)))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;