28 std::vector<CScript> prev_spks;
31 for (
int i = 0; i < 32; i++) {
35 keystore.
keys.emplace(key_id, privkey);
36 keystore.
pubkeys.emplace(key_id, pubkey);
45 prev_spks.push_back(prev_spk);
52 unsigned_tx.
vin.emplace_back(prevout);
58 std::map<COutPoint, Coin> coins;
59 CScript prev_spk = prev_spks[(iter++) % prev_spks.size()];
60 coins[prevout] =
Coin(
CTxOut(10000, prev_spk), 100,
false);
61 std::map<int, bilingual_str> input_errors;
78 std::vector<unsigned char> sig(64);
81 bool success = key.SignSchnorr(
msg, sig, &merkle_root, aux);
BENCHMARK(SignTransactionECDSA, benchmark::PriorityLevel::HIGH)
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, const UniValue &hashType, UniValue &result)
Sign a transaction with the given keystore and previous transactions.
static void SignSchnorrWithMerkleRoot(benchmark::Bench &bench)
RAII class initializing and deinitializing global state for elliptic curve support.
CPubKey GetPubKey() const
Compute the public key from a private key.
std::map< CKeyID, CKey > keys
static void SignSchnorrTapTweakBenchmark(benchmark::Bench &bench, bool use_null_merkle_root)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
CKey GenerateRandomKey(bool compressed) noexcept
ANKERL_NANOBENCH(NODISCARD) std Bench & minEpochIterations(uint64_t numIters) noexcept
Sets the minimum number of iterations each epoch should take.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
An encapsulated public key.
std::map< CKeyID, CPubKey > pubkeys
An output of a transaction.
static uint256 InsecureRand256()
An outpoint - a combination of a transaction hash and an index n into its vout.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
static void SignTransactionECDSA(benchmark::Bench &bench)
static void SignTransactionSingleInput(benchmark::Bench &bench, InputType input_type)
Serialized script, used inside transaction inputs and outputs.
static transaction_identifier FromUint256(const uint256 &id)
A reference to a CKey: the Hash160 of its serialized public key.
A mutable version of CTransaction.
Main entry point to nanobench's benchmarking facility.
An encapsulated private key.
static void SignSchnorrWithNullMerkleRoot(benchmark::Bench &bench)
static void SignTransactionSchnorr(benchmark::Bench &bench)