Add GenIdentity, an identity function for MappedShuffle.

We use this function in z_sendmany as part of the fix for #1779.
This commit is contained in:
Simon
2016-11-05 14:12:41 -07:00
parent 7c463780cf
commit 38276c6ba2
5 changed files with 24 additions and 6 deletions

View File

@@ -57,10 +57,11 @@ JSDescription JSDescription::Randomized(
// Randomize the order of the inputs and outputs
inputMap = {0, 1};
outputMap = {0, 1};
if (gen) {
MappedShuffle(inputs.begin(), inputMap.begin(), ZC_NUM_JS_INPUTS, gen);
MappedShuffle(outputs.begin(), outputMap.begin(), ZC_NUM_JS_OUTPUTS, gen);
}
assert(gen);
MappedShuffle(inputs.begin(), inputMap.begin(), ZC_NUM_JS_INPUTS, gen);
MappedShuffle(outputs.begin(), outputMap.begin(), ZC_NUM_JS_OUTPUTS, gen);
return JSDescription(
params, pubKeyHash, anchor, inputs, outputs,