From 075ada9c29ab18a7e800cd182462251c86a24f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= <4142+huitseeker@users.noreply.github.com> Date: Fri, 16 Oct 2020 18:28:25 -0400 Subject: [PATCH] Fold panics in the enclosing Error case (#27) --- src/nizk/mod.rs | 9 ++++----- src/r1csproof.rs | 19 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/nizk/mod.rs b/src/nizk/mod.rs index ddd2408..9182fe3 100644 --- a/src/nizk/mod.rs +++ b/src/nizk/mod.rs @@ -530,11 +530,10 @@ impl DotProductProofLog { let Gamma = Cx.unpack()? + Cy.unpack()?; - let (g_hat, Gamma_hat, a_hat) = self - .bullet_reduction_proof - .verify(n, a, transcript, &Gamma, &gens.gens_n.G) - .unwrap(); - + let (g_hat, Gamma_hat, a_hat) = + self + .bullet_reduction_proof + .verify(n, a, transcript, &Gamma, &gens.gens_n.G)?; self.delta.append_to_transcript(b"delta", transcript); self.beta.append_to_transcript(b"beta", transcript); diff --git a/src/r1csproof.rs b/src/r1csproof.rs index e66cdd9..11a867b 100644 --- a/src/r1csproof.rs +++ b/src/r1csproof.rs @@ -437,17 +437,14 @@ impl R1CSProof { .compress(); // verify the joint claim with a sum-check protocol - let (comm_claim_post_phase2, ry) = self - .sc_proof_phase2 - .verify( - &comm_claim_phase2, - num_rounds_y, - 2, - &gens.gens_sc.gens_1, - &gens.gens_sc.gens_3, - transcript, - ) - .unwrap(); + let (comm_claim_post_phase2, ry) = self.sc_proof_phase2.verify( + &comm_claim_phase2, + num_rounds_y, + 2, + &gens.gens_sc.gens_1, + &gens.gens_sc.gens_3, + transcript, + )?; // verify Z(ry) proof against the initial commitment assert!(self