sp1_verifier/
lib.rs

1//! This crate provides verifiers for SP1 Groth16 and Plonk BN254 proofs in a no-std environment.
2//! It is patched for efficient verification within the SP1 zkVM context.
3
4#![cfg_attr(not(any(feature = "std", test)), no_std)]
5extern crate alloc;
6
7use lazy_static::lazy_static;
8
9lazy_static! {
10    /// The PLONK verifying key for this SP1 version.
11    pub static ref PLONK_VK_BYTES: &'static [u8] = include_bytes!("../bn254-vk/plonk_vk.bin");
12}
13
14lazy_static! {
15    /// The Groth16 verifying key for this SP1 version.
16    pub static ref GROTH16_VK_BYTES: &'static [u8] = include_bytes!("../bn254-vk/groth16_vk.bin");
17}
18
19#[cfg(feature = "compressed")]
20pub mod compressed;
21#[cfg(feature = "compressed")]
22pub use compressed::{CompressedError, CompressedVerifier};
23
24mod constants;
25pub mod converter;
26mod error;
27
28mod utils;
29pub use utils::*;
30
31pub use groth16::{converter::*, error::Groth16Error, Groth16Verifier};
32mod groth16;
33
34#[cfg(feature = "ark")]
35pub use groth16::ark_converter::*;
36
37pub use plonk::{error::PlonkError, PlonkVerifier};
38mod plonk;
39
40#[cfg(test)]
41mod tests;