From 394f41853bfe51c980176fd93ab20e9330a785e5 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Tue, 25 Apr 2017 09:57:40 -0600 Subject: [PATCH] Integrate low memory prover. --- src/zcash/JoinSplit.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index c7b468f89..409d3c89b 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -293,11 +293,14 @@ public: // estimate that it doesn't matter if we check every time. pb.constraint_system.swap_AB_if_beneficial(); - r1cs_ppzksnark_proving_key pk; - loadFromFile(pkPath, pk); + std::ifstream fh(pkPath, std::ios::binary); - return ZCProof(r1cs_ppzksnark_prover( - pk, + if(!fh.is_open()) { + throw std::runtime_error((boost::format("could not load param file at %s") % pkPath).str()); + } + + return ZCProof(r1cs_ppzksnark_prover_streaming( + fh, primary_input, aux_input, pb.constraint_system