[Hard-Fork] CT/CA: Put the asset surjection proof, value range proof, and issuance rangeproofs under the witness commitment

This commit is contained in:
Mark Friedenbach 2017-03-11 06:43:11 -08:00 committed by Gregory Sanders
parent b7704f1717
commit 4c8f785185
23 changed files with 314 additions and 165 deletions

View file

@ -67,7 +67,7 @@ static void VerifyScriptBench(benchmark::State& state)
CScript witScriptPubkey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(pubkeyHash) << OP_EQUALVERIFY << OP_CHECKSIG;
CTransaction txCredit = BuildCreditingTransaction(scriptPubKey);
CMutableTransaction txSpend = BuildSpendingTransaction(scriptSig, txCredit);
CScriptWitness& witness = txSpend.vin[0].scriptWitness;
CScriptWitness& witness = txSpend.wit.vtxinwit[0].scriptWitness;
witness.stack.emplace_back();
key.Sign(SignatureHash(witScriptPubkey, txSpend, 0, SIGHASH_ALL, txCredit.vout[0].nValue, SIGVERSION_WITNESS_V0), witness.stack.back(), 0);
witness.stack.back().push_back(static_cast<unsigned char>(SIGHASH_ALL));
@ -79,7 +79,7 @@ static void VerifyScriptBench(benchmark::State& state)
bool success = VerifyScript(
txSpend.vin[0].scriptSig,
txCredit.vout[0].scriptPubKey,
&txSpend.vin[0].scriptWitness,
&txSpend.wit.vtxinwit[0].scriptWitness,
flags,
MutableTransactionNoWithdrawsSignatureChecker(&txSpend, 0, txCredit.vout[0].nValue),
&err);