Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
puma314 committed Feb 10, 2024
1 parent 3591fdf commit fc095d7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion core/src/cpu/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ impl<F: PrimeField> MachineAir<F> for CpuChip {
rows_with_events.into_iter().for_each(|row_with_events| {
let (row, alu_events, blu_events, field_events) = row_with_events;
rows.extend(row);
new_alu_events.extend(alu_events);
for (key, value) in alu_events {
new_alu_events
.entry(key)
.and_modify(|op_new_events: &mut Vec<AluEvent>| {
op_new_events.extend(value.clone())
})
.or_insert(value);
}
new_blu_events.extend(blu_events);
new_field_events.extend(field_events);
});
Expand Down
7 changes: 7 additions & 0 deletions examples/ssz-withdrawals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
version = "0.1.0"
name = "ssz"
edition = "2021"

[dependencies]
succinct-core = { path = "../../core" }
23 changes: 23 additions & 0 deletions examples/ssz-withdrawals/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use succinct_core::{utils, SuccinctProver, SuccinctStdin, SuccinctVerifier};

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

fn main() {
// Generate proof.
// utils::setup_tracer();
utils::setup_logger();

let stdin = SuccinctStdin::new();
let proof = SuccinctProver::prove(ELF, stdin).expect("proving failed");

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

// Save proof.
proof
.save("proof-with-pis.json")
.expect("saving proof failed");

println!("succesfully generated and verified proof for the program!")
}

0 comments on commit fc095d7

Please sign in to comment.