Skip to content

Commit

Permalink
chore: Amend test to use dylib; add timings for zkey
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarth committed Nov 3, 2023
1 parent 3ec5f62 commit 0042ae7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mopro-core/src/middleware/circom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ pub fn initialize(dylib_path: &Path) {
.expect("Failed to set WITNESS_CALCULATOR");

// Initialize ZKEY
// TODO: Speed this up
let now = std::time::Instant::now();
Lazy::force(&ZKEY);
println!("Initializing zkey took: {:.2?}", now.elapsed());
}

/// Creates a `WitnessCalculator` instance from a dylib file.
Expand Down Expand Up @@ -499,6 +502,16 @@ mod tests {

#[test]
fn test_generate_proof2() {
// XXX: This can be done better
#[cfg(feature = "dylib")]
{
// Assumes that the dylib file has been built and is in the following location
let dylib_path = "target/debug/aarch64-apple-darwin/keccak256.dylib";

// Initialize libray
initialize(Path::new(&dylib_path));
}

let input_vec = vec![
116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
Expand Down

0 comments on commit 0042ae7

Please sign in to comment.