Skip to content

Commit

Permalink
revert examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ctian1 committed May 21, 2024
1 parent 527304e commit 8571908
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
15 changes: 5 additions & 10 deletions examples/aggregation/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const FIBONACCI_ELF: &[u8] =
include_bytes!("../../programs/fibonacci/elf/riscv32im-succinct-zkvm-elf");

/// An input to the aggregation program.
///
///
/// Consists of a proof and a verification key.
struct AggregationInput {
pub proof: SP1CompressedProof,
Expand All @@ -26,7 +26,7 @@ fn main() {
let client = ProverClient::new();

// Setup the proving and verifying keys.
let (aggregation_pk, aggregation_vk) = client.setup(AGGREGATION_ELF);
let (aggregation_pk, _) = client.setup(AGGREGATION_ELF);
let (fibonacci_pk, fibonacci_vk) = client.setup(FIBONACCI_ELF);

// Generate the fibonacci proofs.
Expand Down Expand Up @@ -79,11 +79,10 @@ fn main() {
stdin.write::<Vec<[u32; 8]>>(&vkeys);

// Write the public values.
let mut public_values = inputs
let public_values = inputs
.iter()
.map(|input| input.proof.public_values.to_vec())
.collect::<Vec<_>>();
public_values[0][0] = 3;
stdin.write::<Vec<Vec<u8>>>(&public_values);

// Write the proofs.
Expand All @@ -95,12 +94,8 @@ fn main() {
}

// Generate the groth16 proof.
let proof = client
client
.prove_groth16(&aggregation_pk, stdin)
.expect("proving failed");

client
.verify_groth16(&proof, &aggregation_vk)
.expect("verification failed");
});
});
}
Binary file modified examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/fibonacci/program/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ pub fn main() {
// outputs to the prover.
sp1_zkvm::io::commit(&a);
sp1_zkvm::io::commit(&b);

panic!("wtf");
}
Binary file modified examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
1 change: 0 additions & 1 deletion examples/ssz-withdrawals/program/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ fn main() {
}

println!("sum: {}", sum);
panic!("wtf");
}
4 changes: 2 additions & 2 deletions examples/ssz-withdrawals/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ fn main() {
let stdin = SP1Stdin::new();
let client = ProverClient::new();
let (pk, vk) = client.setup(ELF);
let proof = client.prove_groth16(&pk, stdin).expect("proving failed");
let proof = client.prove_compressed(&pk, stdin).expect("proving failed");

// Verify proof.
client
.verify_groth16(&proof, &vk)
.verify_compressed(&proof, &vk)
.expect("verification failed");

// Save proof.
Expand Down
4 changes: 2 additions & 2 deletions examples/tendermint/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ fn main() {

let client = ProverClient::new();
let (pk, vk) = client.setup(TENDERMINT_ELF);
let proof = client.prove_groth16(&pk, stdin).expect("proving failed");
let proof = client.prove_compressed(&pk, stdin).expect("proving failed");

// Verify proof.
client
.verify_groth16(&proof, &vk)
.verify_compressed(&proof, &vk)
.expect("verification failed");

// Verify the public values
Expand Down

0 comments on commit 8571908

Please sign in to comment.