From d81c31f5fbdd0627741aa7f80c6289986ed0419b Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 29 Jul 2016 00:02:22 -0700 Subject: [PATCH] Extend try catch block around calls to libsnark, per discussion in #1126. --- src/zcash/JoinSplit.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index 0d9e789d7..3eb30a4f3 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -139,25 +139,25 @@ public: throw std::runtime_error("JoinSplit verifying key not loaded"); } - r1cs_ppzksnark_proof r1cs_proof; - std::stringstream ss; - std::string proof_str(proof.begin(), proof.end()); - ss.str(proof_str); - ss >> r1cs_proof; - - uint256 h_sig = this->h_sig(randomSeed, nullifiers, pubKeyHash); - - auto witness = joinsplit_gadget::witness_map( - rt, - h_sig, - macs, - nullifiers, - commitments, - vpub_old, - vpub_new - ); - try { + r1cs_ppzksnark_proof r1cs_proof; + std::stringstream ss; + std::string proof_str(proof.begin(), proof.end()); + ss.str(proof_str); + ss >> r1cs_proof; + + uint256 h_sig = this->h_sig(randomSeed, nullifiers, pubKeyHash); + + auto witness = joinsplit_gadget::witness_map( + rt, + h_sig, + macs, + nullifiers, + commitments, + vpub_old, + vpub_new + ); + return r1cs_ppzksnark_verifier_strong_IC(*vk, witness, r1cs_proof); } catch (...) { return false;