diff --git a/phase2/src/bin/filter_zeros.rs b/phase2/src/bin/filter_zeros.rs new file mode 100644 index 0000000..f3b53b3 --- /dev/null +++ b/phase2/src/bin/filter_zeros.rs @@ -0,0 +1,21 @@ +extern crate phase2; +extern crate exitcode; + +use std::fs::File; +use phase2::circom_circuit::{load_params_file, filter_params}; + +fn main() { + let args: Vec = std::env::args().collect(); + if args.len() != 3 { + println!("Usage: \n "); + std::process::exit(exitcode::USAGE); + } + let in_params = &args[1]; + let out_params = &args[2]; + println!("Exporting {}...", in_params); + let mut params = load_params_file(in_params); + filter_params(&mut params); + let mut writer = File::create(out_params).unwrap(); + params.write(&mut writer).unwrap(); + println!("Created {}.", out_params); +}