diff --git a/crates/nargo/src/cli/fs/keys.rs b/crates/nargo/src/cli/fs/keys.rs index a8aec69af86..6bd104605c0 100644 --- a/crates/nargo/src/cli/fs/keys.rs +++ b/crates/nargo/src/cli/fs/keys.rs @@ -7,7 +7,7 @@ use acvm::{acir::circuit::Circuit, hash_constraint_system}; use std::path::{Path, PathBuf}; pub(crate) fn save_key_to_dir>( - key: Vec, + key: &[u8], key_name: &str, key_dir: P, is_proving_key: bool, @@ -80,8 +80,8 @@ mod tests { // These values are not meaningful, we just need distinct values. let pk: Vec = vec![0]; let vk: Vec = vec![1, 2]; - save_key_to_dir(pk.clone(), circuit_name, &circuit_build_path, true).unwrap(); - save_key_to_dir(vk.clone(), circuit_name, &circuit_build_path, false).unwrap(); + save_key_to_dir(&pk, circuit_name, &circuit_build_path, true).unwrap(); + save_key_to_dir(&vk, circuit_name, &circuit_build_path, false).unwrap(); save_acir_hash_to_dir(&circuit, circuit_name, &circuit_build_path); circuit_build_path.push(circuit_name); diff --git a/crates/nargo/src/cli/preprocess_cmd.rs b/crates/nargo/src/cli/preprocess_cmd.rs index 4f6716fb5eb..9023fffe1c6 100644 --- a/crates/nargo/src/cli/preprocess_cmd.rs +++ b/crates/nargo/src/cli/preprocess_cmd.rs @@ -41,8 +41,8 @@ pub(crate) fn preprocess_with_path>( // If hash doesn't match then the circuit has been updated and keys are stale. save_acir_hash_to_dir(circuit, key_name, &preprocess_dir); - let pk_path = save_key_to_dir(proving_key, key_name, &preprocess_dir, true)?; - let vk_path = save_key_to_dir(verification_key, key_name, preprocess_dir, false)?; + let pk_path = save_key_to_dir(&proving_key, key_name, &preprocess_dir, true)?; + let vk_path = save_key_to_dir(&verification_key, key_name, preprocess_dir, false)?; Ok((pk_path, vk_path)) }