2023-01-31 15:57:28 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use multiplier::public::Multiplier;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn multiplier_proof() {
|
2023-02-27 06:16:16 +00:00
|
|
|
let mul = Multiplier::new().unwrap();
|
2023-01-31 15:57:28 +00:00
|
|
|
|
|
|
|
let mut output_data: Vec<u8> = Vec::new();
|
|
|
|
let _ = mul.prove(&mut output_data);
|
|
|
|
|
|
|
|
let proof_data = &output_data[..];
|
|
|
|
|
|
|
|
// XXX Pass as arg?
|
|
|
|
//let pvk = prepare_verifying_key(&mul.params.vk);
|
|
|
|
|
|
|
|
let verified = mul.verify(proof_data).unwrap();
|
|
|
|
|
|
|
|
assert!(verified);
|
|
|
|
}
|
|
|
|
}
|