From d239d3ffb56418f5dafecd901dbd75f2e9afb75c Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 26 Sep 2022 10:44:28 -0700 Subject: [PATCH] fix --- plonky2/examples/square_root.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plonky2/examples/square_root.rs b/plonky2/examples/square_root.rs index 5cbdf02e..a19130fa 100644 --- a/plonky2/examples/square_root.rs +++ b/plonky2/examples/square_root.rs @@ -68,8 +68,12 @@ fn main() -> Result<()> { let data = builder.build::(); let proof = data.prove(pw)?; - println!("Random field element: {}", proof.public_inputs[1]); - println!("Its square root: {}", proof.public_inputs[0]); + let x_actual = proof.public_inputs[0]; + let x_squared_actual = proof.public_inputs[1]; + println!("Random field element: {}", x_squared_actual); + println!("Its square root: {}", x_actual); + + assert!(x_actual * x_actual == x_squared_actual); data.verify(proof) }