Skip to main content

taceo_groth16_material/
lib.rs

1//! Groth16 zk-SNARK proof generation and verification.
2//!
3//! This crate provides functionality for working with R1CS witnesses and Groth16 proofs.
4//!
5//! Currently, it supports circuits defined using Circom.
6#![deny(missing_docs)]
7
8#[cfg(feature = "circom")]
9pub mod circom;
10
11/// Errors that can occur during Groth16 proof generation and verification.
12#[derive(Debug, thiserror::Error)]
13pub enum Groth16Error {
14    /// Failed to generate a witness for the circuit.
15    #[error("failed to generate witness")]
16    WitnessGeneration(#[source] eyre::Report),
17    /// Failed to generate a Groth16 proof.
18    #[error("failed to generate proof")]
19    ProofGeneration(#[source] eyre::Report),
20    /// Generated proof could not be verified against the verification key.
21    #[error("proof could not be verified")]
22    InvalidProof,
23}