Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: example sha2 rust #161

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions prover/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ rustflags = ["--cfg", 'target_os="zkvm"',"-C", "target-feature=+crt-static", "-C
* Build the Sha2/Revme

```
cd prover/examples/sha2
cd prover/examples/sha2-rust
cargo build --target=mips-unknown-linux-musl
```

Expand All @@ -80,7 +80,7 @@ cargo build --target=mips-unknown-linux-musl

cd ../..

ARGS="711e9609339e92b03ddc0a211827dba421f38f9ed8b9d806e1ffdd8c15ffa03d world!" RUST_LOG=info ELF_PATH=examples/sha2/target/mips-unknown-linux-musl/debug/sha2-bench HOST_PROGRAM=sha2_bench SEG_OUTPUT=/tmp/output cargo run --release --example zkmips prove_host_program
ARGS="711e9609339e92b03ddc0a211827dba421f38f9ed8b9d806e1ffdd8c15ffa03d world!" RUST_LOG=info ELF_PATH=examples/sha2-rust/target/mips-unknown-linux-musl/debug/sha2-rust HOST_PROGRAM=sha2_rust SEG_OUTPUT=/tmp/output cargo run --release --example zkmips prove_host_program

Or

Expand Down
2 changes: 1 addition & 1 deletion prover/examples/sha2-rust/Cargo.lock

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

2 changes: 1 addition & 1 deletion prover/examples/sha2-rust/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-04-06-x86_64-unknown-linux-gnu"
channel = "nightly-2023-04-06"
targets = ["mips-unknown-linux-musl"]
profile = "minimal"
3 changes: 1 addition & 2 deletions prover/examples/zkmips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fn prove_sha2_rust() {
// 1. split ELF into segs
let elf_path = env::var("ELF_PATH").expect("ELF file is missing");
let seg_path = env::var("SEG_OUTPUT").expect("Segment output path is missing");
let seg_size = env::var("SEG_SIZE").unwrap_or("0".to_string());
let seg_size = env::var("SEG_SIZE").unwrap_or("65536".to_string());
let seg_size = seg_size.parse::<_>().unwrap_or(0);

let mut state = load_elf_with_patch(&elf_path, vec![]);
Expand Down Expand Up @@ -280,7 +280,6 @@ fn prove_sha2_rust() {
if seg_size != 0 {
seg_num = (total_steps + seg_size - 1) / seg_size;
}

prove_multi_seg_common(&seg_path, "", "", "", seg_size, seg_num, 0).unwrap()
}

Expand Down
Loading