Add optional bool to disable computation of proof in JSDescription constructor

This commit is contained in:
Jack Grigg
2016-08-24 15:49:38 +12:00
parent 77a99f4a2a
commit 5db5e42ec3
4 changed files with 18 additions and 7 deletions

View File

@@ -173,9 +173,10 @@ public:
boost::array<uint256, NumOutputs>& out_commitments,
uint64_t vpub_old,
uint64_t vpub_new,
const uint256& rt
const uint256& rt,
bool computeProof
) {
if (!pk) {
if (computeProof && !pk) {
throw std::runtime_error("JoinSplit proving key not loaded");
}
@@ -231,6 +232,10 @@ public:
out_macs[i] = PRF_pk(inputs[i].key, i, h_sig);
}
if (!computeProof) {
return ZCProof();
}
protoboard<FieldT> pb;
{
joinsplit_gadget<FieldT, NumInputs, NumOutputs> g(pb);