Skip to content

Commit

Permalink
chore: verify_sp1_proof naming (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Aug 12, 2024
1 parent a9c454d commit cdee36b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion zkvm/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern "C" {
pub fn syscall_exit_unconstrained();

/// Defers the verification of a valid SP1 zkVM proof.
pub fn syscall_verify_sp1_proof(vkey: &[u32; 8], pv_digest: &[u8; 32]);
pub fn syscall_verify_sp1_proof(vk_digest: &[u32; 8], pv_digest: &[u8; 32]);

/// Returns the length of the next element in the hint stream.
pub fn syscall_hint_len() -> usize;
Expand Down
9 changes: 5 additions & 4 deletions zkvm/lib/src/verify.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::syscall_verify_sp1_proof;

/// Verifies the next proof in the proof input stream given a pkey digest and public values digest.
/// Verifies the next proof in the proof input stream given a verification key digest and public
/// values digest. If the proof is invalid, the function will panic.
///
/// Note: sp1_zkvm must also have feature `verify` enabled for this function to work.
pub fn verify_sp1_proof(pkey_digest: &[u32; 8], pv_digest: &[u8; 32]) {
/// Enable this function by adding the `verify` feature to both the `sp1-lib` AND `sp1-zkvm` crates.
pub fn verify_sp1_proof(vk_digest: &[u32; 8], pv_digest: &[u8; 32]) {
unsafe {
syscall_verify_sp1_proof(pkey_digest, pv_digest);
syscall_verify_sp1_proof(vk_digest, pv_digest);
}
}

0 comments on commit cdee36b

Please sign in to comment.