Skip to content

Commit

Permalink
chore: Update program/script and recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
wwared committed Apr 17, 2024
1 parent 37782ae commit 7a1b0f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Binary file modified examples/ski/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/ski/program/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
#![no_main]
wp1_zkvm::entrypoint!(main);

use ski::{ITerm, Mem, SKI};
use ski::{Term, Mem, SKI};

// INFO summary: cycles=254197, e2e=4552, khz=55.84, proofSize=1.24 MiB
// (S(K(SI))K)KI evaled to K
#[allow(dead_code)]
pub fn main() {
let ski = wp1_zkvm::io::read::<SKI>();
let mem = &mut Mem::new();
let term = ITerm::try_from_ski(mem, &ski).unwrap();
let term = Term::try_from_ski(mem, &ski).unwrap();
let evaled = term.eval(mem, 0).to_ski(mem);

wp1_zkvm::io::write(&evaled);
wp1_zkvm::io::commit(&evaled);
}
9 changes: 5 additions & 4 deletions examples/ski/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::str::FromStr;

const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf");

use wp1_sdk::{utils, SP1Prover, SP1Stdin, SP1Verifier};
use wp1_sdk::{utils, ProverClient, SP1Stdin};

use ski::SKI;

Expand All @@ -16,15 +16,16 @@ fn main() {
let ski = SKI::from_str(&"(S(K(SI))K)KI").unwrap();
stdin.write(&ski);

let mut proof = SP1Prover::prove(ELF, stdin).expect("proving failed");
let client = ProverClient::new();
let mut proof = client.prove(ELF, stdin).expect("proving failed");

// Read output.
let evaled = proof.stdout.read::<SKI>();
let evaled = proof.public_values.read::<SKI>();
assert_eq!("K", evaled.to_string());
println!("{ski} evaled to {evaled}");

// Verify proof.
SP1Verifier::verify(ELF, &proof).expect("verification failed");
client.verify(ELF, &proof).expect("verification failed");

// Save proof.
proof
Expand Down

0 comments on commit 7a1b0f6

Please sign in to comment.