![]() |
Bitcoin Core
22.0.0
P2P Digital Currency
|
#include <hash.h>#include <script/script_error.h>#include <span.h>#include <primitives/transaction.h>#include <vector>#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | PrecomputedTransactionData |
| struct | ScriptExecutionData |
| class | BaseSignatureChecker |
| class | GenericTransactionSignatureChecker< T > |
| class | DeferringSignatureChecker |
Typedefs | |
| using | TransactionSignatureChecker = GenericTransactionSignatureChecker< CTransaction > |
| using | MutableTransactionSignatureChecker = GenericTransactionSignatureChecker< CMutableTransaction > |
Functions | |
| bool | CheckSignatureEncoding (const std::vector< unsigned char > &vchSig, unsigned int flags, ScriptError *serror) |
| template<class T > | |
| uint256 | SignatureHash (const CScript &scriptCode, const T &txTo, unsigned int nIn, int nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache=nullptr) |
| template<typename T > | |
| bool | SignatureHashSchnorr (uint256 &hash_out, const ScriptExecutionData &execdata, const T &tx_to, uint32_t in_pos, uint8_t hash_type, SigVersion sigversion, const PrecomputedTransactionData &cache, MissingDataBehavior mdb) |
| uint256 | ComputeTapleafHash (uint8_t leaf_version, const CScript &script) |
| Compute the BIP341 tapleaf hash from leaf version & script. More... | |
| uint256 | ComputeTaprootMerkleRoot (Span< const unsigned char > control, const uint256 &tapleaf_hash) |
| Compute the BIP341 taproot script tree Merkle root from control block and leaf hash. More... | |
| bool | EvalScript (std::vector< std::vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptExecutionData &execdata, ScriptError *error=nullptr) |
| bool | EvalScript (std::vector< std::vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptError *error=nullptr) |
| bool | VerifyScript (const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror=nullptr) |
| size_t | CountWitnessSigOps (const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags) |
| bool | CheckMinimalPush (const std::vector< unsigned char > &data, opcodetype opcode) |
| int | FindAndDelete (CScript &script, const CScript &b) |
Variables | |
| static constexpr size_t | WITNESS_V0_SCRIPTHASH_SIZE = 32 |
| Signature hash sizes. More... | |
| static constexpr size_t | WITNESS_V0_KEYHASH_SIZE = 20 |
| static constexpr size_t | WITNESS_V1_TAPROOT_SIZE = 32 |
| static constexpr uint8_t | TAPROOT_LEAF_MASK = 0xfe |
| static constexpr uint8_t | TAPROOT_LEAF_TAPSCRIPT = 0xc0 |
| static constexpr size_t | TAPROOT_CONTROL_BASE_SIZE = 33 |
| static constexpr size_t | TAPROOT_CONTROL_NODE_SIZE = 32 |
| static constexpr size_t | TAPROOT_CONTROL_MAX_NODE_COUNT = 128 |
| static constexpr size_t | TAPROOT_CONTROL_MAX_SIZE = TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * TAPROOT_CONTROL_MAX_NODE_COUNT |
| const CHashWriter | HASHER_TAPLEAF |
| Hasher with tag "TapLeaf" pre-fed to it. More... | |
| const CHashWriter | HASHER_TAPBRANCH |
| Hasher with tag "TapBranch" pre-fed to it. More... | |
Definition at line 290 of file interpreter.h.
Definition at line 289 of file interpreter.h.
| anonymous enum |
Signature hash types/flags.
Definition at line 25 of file interpreter.h.
| anonymous enum |
Script verification flags.
All flags are intended to be soft forks: the set of acceptable scripts under flags (A | B) is a subset of the acceptable scripts under flag (A).
Definition at line 42 of file interpreter.h.
|
strong |
Enum to specify what *TransactionSignatureChecker's behavior should be when dealing with missing transaction data.
| Enumerator | |
|---|---|
| ASSERT_FAIL | Abort execution through assertion failure (for consensus code) |
| FAIL | Just act as if the signature was invalid. |
Definition at line 257 of file interpreter.h.
|
strong |
Definition at line 177 of file interpreter.h.
| bool CheckMinimalPush | ( | const std::vector< unsigned char > & | data, |
| opcodetype | opcode | ||
| ) |
Definition at line 228 of file interpreter.cpp.
| bool CheckSignatureEncoding | ( | const std::vector< unsigned char > & | vchSig, |
| unsigned int | flags, | ||
| ScriptError * | serror | ||
| ) |
Definition at line 200 of file interpreter.cpp.
Compute the BIP341 tapleaf hash from leaf version & script.
Definition at line 1850 of file interpreter.cpp.
| uint256 ComputeTaprootMerkleRoot | ( | Span< const unsigned char > | control, |
| const uint256 & | tapleaf_hash | ||
| ) |
Compute the BIP341 taproot script tree Merkle root from control block and leaf hash.
Requires control block to have valid length (33 + k*32, with k in {0,1,..,128}).
Definition at line 1855 of file interpreter.cpp.
| size_t CountWitnessSigOps | ( | const CScript & | scriptSig, |
| const CScript & | scriptPubKey, | ||
| const CScriptWitness * | witness, | ||
| unsigned int | flags | ||
| ) |
Definition at line 2106 of file interpreter.cpp.
| bool EvalScript | ( | std::vector< std::vector< unsigned char > > & | stack, |
| const CScript & | script, | ||
| unsigned int | flags, | ||
| const BaseSignatureChecker & | checker, | ||
| SigVersion | sigversion, | ||
| ScriptExecutionData & | execdata, | ||
| ScriptError * | error = nullptr |
||
| ) |
Definition at line 431 of file interpreter.cpp.
| bool EvalScript | ( | std::vector< std::vector< unsigned char > > & | stack, |
| const CScript & | script, | ||
| unsigned int | flags, | ||
| const BaseSignatureChecker & | checker, | ||
| SigVersion | sigversion, | ||
| ScriptError * | error = nullptr |
||
| ) |
Definition at line 253 of file interpreter.cpp.
| uint256 SignatureHash | ( | const CScript & | scriptCode, |
| const T & | txTo, | ||
| unsigned int | nIn, | ||
| int | nHashType, | ||
| const CAmount & | amount, | ||
| SigVersion | sigversion, | ||
| const PrecomputedTransactionData * | cache = nullptr |
||
| ) |
Definition at line 1590 of file interpreter.cpp.
| bool SignatureHashSchnorr | ( | uint256 & | hash_out, |
| const ScriptExecutionData & | execdata, | ||
| const T & | tx_to, | ||
| uint32_t | in_pos, | ||
| uint8_t | hash_type, | ||
| SigVersion | sigversion, | ||
| const PrecomputedTransactionData & | cache, | ||
| MissingDataBehavior | mdb | ||
| ) |
Definition at line 1503 of file interpreter.cpp.
| bool VerifyScript | ( | const CScript & | scriptSig, |
| const CScript & | scriptPubKey, | ||
| const CScriptWitness * | witness, | ||
| unsigned int | flags, | ||
| const BaseSignatureChecker & | checker, | ||
| ScriptError * | serror = nullptr |
||
| ) |
Definition at line 1969 of file interpreter.cpp.
| const CHashWriter HASHER_TAPBRANCH |
Hasher with tag "TapBranch" pre-fed to it.
Definition at line 1488 of file interpreter.cpp.
| const CHashWriter HASHER_TAPLEAF |
Hasher with tag "TapLeaf" pre-fed to it.
Definition at line 1487 of file interpreter.cpp.
|
static |
Definition at line 217 of file interpreter.h.
|
static |
Definition at line 219 of file interpreter.h.
|
static |
Definition at line 220 of file interpreter.h.
|
static |
Definition at line 218 of file interpreter.h.
|
static |
Definition at line 215 of file interpreter.h.
|
static |
Definition at line 216 of file interpreter.h.
|
static |
Definition at line 212 of file interpreter.h.
|
static |
Signature hash sizes.
Definition at line 211 of file interpreter.h.
|
static |
Definition at line 213 of file interpreter.h.
1.8.14