Auto merge of #2159 - bitcartel:1.0.7_payment_disclosure, r=str4d

Payment disclosure (experimental feature)
This commit is contained in:
Homu
2017-11-14 14:06:22 -08:00
27 changed files with 1324 additions and 14 deletions

View File

@@ -16,7 +16,9 @@ JSDescription::JSDescription(ZCJoinSplit& params,
const boost::array<libzcash::JSOutput, ZC_NUM_JS_OUTPUTS>& outputs,
CAmount vpub_old,
CAmount vpub_new,
bool computeProof) : vpub_old(vpub_old), vpub_new(vpub_new), anchor(anchor)
bool computeProof,
uint256 *esk // payment disclosure
) : vpub_old(vpub_old), vpub_new(vpub_new), anchor(anchor)
{
boost::array<libzcash::Note, ZC_NUM_JS_OUTPUTS> notes;
@@ -34,7 +36,8 @@ JSDescription::JSDescription(ZCJoinSplit& params,
vpub_old,
vpub_new,
anchor,
computeProof
computeProof,
esk // payment disclosure
);
}
@@ -49,7 +52,9 @@ JSDescription JSDescription::Randomized(
CAmount vpub_old,
CAmount vpub_new,
bool computeProof,
std::function<int(int)> gen)
uint256 *esk, // payment disclosure
std::function<int(int)> gen
)
{
// Randomize the order of the inputs and outputs
inputMap = {0, 1};
@@ -62,7 +67,9 @@ JSDescription JSDescription::Randomized(
return JSDescription(
params, pubKeyHash, anchor, inputs, outputs,
vpub_old, vpub_new, computeProof);
vpub_old, vpub_new, computeProof,
esk // payment disclosure
);
}
bool JSDescription::Verify(