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
19mod constants;
20mod converter;
21mod error;
22
23mod utils;
24pub use utils::*;
25
26pub use groth16::{error::Groth16Error, Groth16Verifier};
27mod groth16;
28
29#[cfg(feature = "ark")]
30pub use groth16::ark_converter::*;
31
32pub use plonk::{error::PlonkError, PlonkVerifier};
33mod plonk;
34
35#[cfg(test)]
36mod tests;