Skip to content

Commit

Permalink
fix input for common program
Browse files Browse the repository at this point in the history
  • Loading branch information
weilzkm committed Oct 22, 2024
1 parent 0c0e470 commit f1ba81b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prover/examples/zkmips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ fn split_segments() {
let seg_path = env::var("SEG_OUTPUT").expect("Segment output path is missing");
let seg_size = env::var("SEG_SIZE").unwrap_or(format!("{SEGMENT_STEPS}"));
let seg_size = seg_size.parse::<_>().unwrap_or(SEGMENT_STEPS);
let args = env::var("ARGS").unwrap_or("data-to-hash".to_string());
let args = env::var("ARGS").unwrap_or("".to_string());
// assume the first arg is the hash output(which is a public input), and the others are the input.
let args: Vec<&str> = args.split_whitespace().collect();
let mut state = load_elf_with_patch(&elf_path, vec![]);

if args.len() > 0 {
let public_input: Vec<u8> = hex::decode(args[0]).unwrap();
let public_input: Vec<u8> = args[0].as_bytes().to_vec();
state.add_input_stream(&public_input);
}

Expand Down

0 comments on commit f1ba81b

Please sign in to comment.