sigma_rs/
lib.rs

1//! # Σ-rs: Sigma Protocols in Rust
2//!
3//! **Σ-rs** is a Rust library for constructing zero-knowledge proofs using Sigma protocols (Σ-protocols).
4//! It allows proving knowledge of secret data without revealing the data itself.
5//!
6//! ---
7//!
8//! ## What are Sigma Protocols?
9//!
10//! Sigma protocols are interactive cryptographic protocols that allow a prover to convince
11//! a verifier they know a secret (like a private key) without revealing the secret itself.
12//! They follow a simple three-step pattern: commitment, challenge, response.
13//!
14//! ---
15//!
16//! ## Key Features
17//!
18//! - **Composable**: Combine multiple proofs into compound statements
19//! - **Generic**: Works with any cryptographic group supporting the required operations
20//! - **Flexible Hashing**: Multiple hash function backends for different use cases
21//! - **Non-Interactive Ready**: Support for Fiat–Shamir transformation
22//!
23//! ---
24//!
25//! ## Basic Usage
26//!
27//! The library provides building blocks for creating zero-knowledge proofs:
28//!
29//! 1. Define your mathematical relation using [`LinearRelation`]
30//! 2. Create a Sigma protocol with [`schnorr_protocol::SchnorrProof`]
31//! 3. Convert to non-interactive using [`fiat_shamir::NISigmaProtocol`]
32//! 4. Generate and verify proofs using the protocol interface
33//!
34//! ---
35//!
36//! ## Core Components
37//!
38//! - **[`traits::SigmaProtocol`]**: The fundamental three-move protocol interface
39//! - **[`linear_relation::LinearRelation`]**: Express mathematical relations over groups
40//! - **[`fiat_shamir::NISigmaProtocol`]**: Convert interactive proofs to standalone proofs
41//! - **[`composition::Protocol`]**: Combine multiple proofs together
42//! - **[`codec`]**: Hash function backends for proof generation
43//!
44//! ---
45//!
46//! Σ-rs is designed to be modular, extensible, and easy to integrate into zero-knowledge applications.
47
48#![allow(non_snake_case)]
49#![doc(html_logo_url = "https://mmaker.github.io/sigma-rs/")]
50#![deny(unused_variables)]
51#![deny(unused_mut)]
52
53pub mod composition;
54pub mod errors;
55pub mod fiat_shamir;
56pub mod linear_relation;
57pub mod schnorr_protocol;
58pub mod serialization;
59pub mod traits;
60
61pub mod codec;
62pub mod duplex_sponge;
63
64#[cfg(test)]
65pub mod tests;
66
67pub use fiat_shamir::NISigmaProtocol;
68pub use linear_relation::LinearRelation;