bellpepper_core/lib.rs
1#![deny(missing_debug_implementations)]
2//! `bellpepper` is a crate for building zk-SNARK circuits. It provides circuit
3//! traits and and primitive structures, as well as basic gadget implementations
4//! such as booleans and number abstractions.
5//!
6//! # Example circuit
7//!
8//! Say we want to write a circuit that proves we know the preimage to some hash
9//! computed using SHA-256d (calling SHA-256 twice). The preimage must have a
10//! fixed length known in advance (because the circuit parameters will depend on
11//! it), but can otherwise have any value. We take the following strategy:
12//!
13//! - Witness each bit of the preimage.
14//! - Compute `hash = SHA-256d(preimage)` inside the circuit.
15//! - Expose `hash` as a public input using multiscalar packing.
16//!
17
18mod lc;
19pub use lc::{Index, LinearCombination, Variable};
20mod constraint_system;
21pub use constraint_system::{Circuit, ConstraintSystem, Namespace, SynthesisError};
22mod gadgets;
23pub use gadgets::{boolean, num};
24mod util_cs;
25pub use util_cs::{test_cs, Comparable, Constraint, Delta};
26
27pub const BELLPEPPER_VERSION: &str = env!("CARGO_PKG_VERSION");