From 18dfea0dd082af18dfb02981b7ee1cd44d514388 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Sat, 14 Jul 2018 16:03:28 -0700 Subject: Always create 70 byte signatures with low R values When extra entropy is not specified by the caller, CKey::Sign will now always create a signature that has a low R value and is at most 70 bytes. The resulting signature on the stack will be 71 bytes when the sighash byte is included. Using low R signatures means that the resulting DER encoded signature will never need to have additional padding to account for high R values. --- src/bench/verify_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bench/verify_script.cpp') diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index ae60588c2d..1d599b2685 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -76,7 +76,7 @@ static void VerifyScriptBench(benchmark::State& state) CMutableTransaction txSpend = BuildSpendingTransaction(scriptSig, txCredit); CScriptWitness& witness = txSpend.vin[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); + key.Sign(SignatureHash(witScriptPubkey, txSpend, 0, SIGHASH_ALL, txCredit.vout[0].nValue, SigVersion::WITNESS_V0), witness.stack.back()); witness.stack.back().push_back(static_cast(SIGHASH_ALL)); witness.stack.push_back(ToByteVector(pubkey)); -- cgit v1.2.3