pub struct Groth16Verifier;Expand description
A verifier for Groth16 zero-knowledge proofs.
Implementations§
Source§impl Groth16Verifier
impl Groth16Verifier
Sourcepub fn verify(
proof: &[u8],
sp1_public_inputs: &[u8],
sp1_vkey_hash: &str,
groth16_vk: &[u8],
) -> Result<(), Groth16Error>
pub fn verify( proof: &[u8], sp1_public_inputs: &[u8], sp1_vkey_hash: &str, groth16_vk: &[u8], ) -> Result<(), Groth16Error>
Verifies a Groth16 proof.
§Arguments
proof- The proof bytes.public_inputs- The SP1 public inputs.sp1_vkey_hash- The SP1 vkey hash. This is generated in the following manner:
ⓘ
use sp1_sdk::ProverClient;
let client = ProverClient::new();
let (pk, vk) = client.setup(ELF);
let sp1_vkey_hash = vk.bytes32();groth16_vk- The Groth16 verifying key bytes. Usually this will be the [static@crate::GROTH16_VK_BYTES] constant, which is the Groth16 verifying key for the current SP1 version.
§Returns
A success Result if verification succeeds, or a Groth16Error if verification fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Groth16Verifier
impl RefUnwindSafe for Groth16Verifier
impl Send for Groth16Verifier
impl Sync for Groth16Verifier
impl Unpin for Groth16Verifier
impl UnwindSafe for Groth16Verifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more