Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
interpreter.cpp
Go to the documentation of this file.
188 bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror) {
194 if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsValidSignatureEncoding(vchSig)) {
205 bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags, ScriptError* serror) {
235 bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* serror)
832 valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32);
873 if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) {
947 if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) {
1039 CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) :
1156 uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, const CAmount& amount, SigVersion sigversion, const PrecomputedTransactionData* cache)
1160 static const uint256 one(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
1179 bool TransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const
1184 bool TransactionSignatureChecker::CheckSig(const std::vector<unsigned char>& vchSigIn, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const
1197 uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion, this->txdata);
1261 const uint32_t nLockTimeMask = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | CTxIn::SEQUENCE_LOCKTIME_MASK;
1273 (txToSequenceMasked < CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked < CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) ||
1274 (txToSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)
1287 bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror)
Definition: script.h:133
Definition: script.h:62
Definition: script.h:118
Definition: script_error.h:20
Definition: script_error.h:46
virtual bool CheckLockTime(const CScriptNum &nLockTime) const
Definition: interpreter.h:124
Definition: transaction.h:16
Definition: script.h:56
const PrecomputedTransactionData * txdata
Definition: interpreter.h:143
Definition: interpreter.h:25
Definition: script.h:160
Definition: script_error.h:50
Definition: script.h:101
Definition: script.h:112
Definition: script_error.h:25
Definition: script.h:122
Definition: script.h:154
enum ScriptError_t ScriptError
Definition: script.h:93
virtual bool VerifySignature(const std::vector< unsigned char > &vchSig, const CPubKey &vchPubKey, const uint256 &sighash) const
Definition: interpreter.cpp:1179
Definition: script.h:127
Definition: script_error.h:12
Definition: interpreter.h:116
Definition: script_error.h:51
void WriteCompactSize(CSizeComputer &os, uint64_t nSize)
Definition: serialize.h:1289
Definition: script_error.h:21
Definition: interpreter.h:55
Definition: script.h:79
Definition: script.h:72
Definition: script.h:172
Definition: script.h:68
Definition: script.h:165
Definition: script.h:95
Definition: script_error.h:47
Definition: interpreter.h:102
Definition: script.h:132
Definition: script.h:106
Definition: script.h:150
Definition: script_error.h:29
Definition: script.h:60
Definition: script.h:139
Definition: script.h:66
static const uint32_t SEQUENCE_LOCKTIME_DISABLE_FLAG
Definition: transaction.h:84
Definition: script.h:61
Definition: interpreter.h:26
bool CheckSequence(const CScriptNum &nSequence) const override
Definition: interpreter.cpp:1241
Definition: script.h:80
Definition: script.h:149
Definition: script_error.h:40
static bool CheckLowS(const std::vector< unsigned char > &vchSig)
Check whether a signature is normalized (lower-S).
Definition: pubkey.cpp:274
Definition: script.h:151
Definition: prevector.h:100
Definition: script.h:174
Definition: script_error.h:17
Definition: script.h:161
Definition: script.h:114
Definition: script_error.h:33
Definition: script.h:168
Definition: script.h:167
Definition: interpreter.h:40
Definition: script.h:162
Definition: script.h:153
Definition: interpreter.h:45
bool CheckSig(const std::vector< unsigned char > &scriptSig, const std::vector< unsigned char > &vchPubKey, const CScript &scriptCode, SigVersion sigversion) const override
Definition: interpreter.cpp:1184
Definition: script_error.h:43
Definition: script.h:141
static bool CheckMinimalPush(const valtype &data, opcodetype opcode)
Definition: interpreter.cpp:212
Definition: script.h:94
Definition: script.h:74
Definition: script.h:156
Definition: script_error.h:19
Definition: script.h:70
Definition: script.h:129
Definition: script.h:119
Definition: interpreter.h:27
Definition: interpreter.h:111
Definition: script.h:181
Definition: script.h:182
Definition: script.h:148
Definition: script.h:146
Definition: script.h:63
Definition: script.h:91
Definition: script.h:178
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, unsigned int nIn, int nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache)
Definition: interpreter.cpp:1156
Definition: script.h:140
Definition: script.h:86
Definition: script_error.h:11
Definition: script.h:205
Definition: script.h:128
Definition: script.h:110
Definition: script_error.h:28
bool CheckSignatureEncoding(const std::vector< unsigned char > &vchSig, unsigned int flags, ScriptError *serror)
Definition: interpreter.cpp:188
bool IsPushOnly(const_iterator pc) const
Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
Definition: script.cpp:236
Definition: script.h:152
Definition: script.h:180
Definition: script.h:89
PrecomputedTransactionData(const CTransaction &tx)
Definition: interpreter.cpp:1149
Definition: script.h:65
Definition: script.h:58
Definition: script.h:77
Definition: script.h:103
Definition: script.h:102
Definition: script_error.h:22
#define stacktop(i)
Script is a stack machine (like Forth) that evaluates a predicate returning a bool indicating valid o...
Definition: interpreter.cpp:54
Definition: script_error.h:13
Definition: script_error.h:49
Definition: script_error.h:32
Definition: script_error.h:45
Definition: script.h:107
bool CheckLockTime(const CScriptNum &nLockTime) const override
Definition: interpreter.cpp:1205
static bool IsValidSignatureEncoding(const std::vector< unsigned char > &sig)
A canonical signature exists of: <30> <total len>=""> <02> <len r>=""> <R> <02> <len s>=""> <S> <hash...
Definition: interpreter.cpp:95
Definition: script_error.h:26
Definition: script.h:137
Definition: script.h:84
Definition: script.h:179
Definition: script_error.h:14
Definition: script.h:85
Definition: script.h:97
Definition: script.h:105
static const uint32_t SEQUENCE_LOCKTIME_TYPE_FLAG
Definition: transaction.h:89
Definition: script.h:176
Definition: script.h:117
Definition: interpreter.h:83
Definition: script.h:177
Definition: script.h:138
bool EvalScript(std::vector< std::vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptError *serror)
Definition: interpreter.cpp:235
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
Definition: interpreter.cpp:1287
Definition: script.h:98
Definition: script.h:83
Definition: script.h:142
CRIPEMD160 & Write(const unsigned char *data, size_t len)
Definition: ripemd160.cpp:247
Definition: script_error.h:39
Definition: script.h:67
Definition: script.h:96
Definition: script.h:99
Definition: script.h:92
Definition: interpreter.h:64
Definition: script_error.h:27
Definition: script.h:111
Definition: script_error.h:44
Definition: script.h:163
static const uint32_t SEQUENCE_LOCKTIME_MASK
Definition: transaction.h:93
bool Verify(const uint256 &hash, const std::vector< unsigned char > &vchSig) const
Verify a DER signature (~72 bytes).
Definition: pubkey.cpp:169
static bool IsCompressedOrUncompressedPubKey(const valtype &vchPubKey)
Definition: interpreter.cpp:63
Definition: script.h:145
Definition: script_error.h:18
Definition: interpreter.h:48
Definition: script.h:159
Definition: script.h:90
Definition: interpreter.h:97
Definition: script.h:55
Definition: script.h:131
Definition: script.h:64
Definition: script.h:130
virtual bool CheckSig(const std::vector< unsigned char > &scriptSig, const std::vector< unsigned char > &vchPubKey, const CScript &scriptCode, SigVersion sigversion) const
Definition: interpreter.h:119
virtual bool CheckSequence(const CScriptNum &nSequence) const
Definition: interpreter.h:129
Definition: script.h:121
Definition: script.h:113
Definition: script.h:164
static bool CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags, ScriptError *serror)
Definition: interpreter.cpp:205
bool GetOp(iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet)
Definition: script.h:496
static bool IsLowDERSignature(const valtype &vchSig, ScriptError *serror)
Definition: interpreter.cpp:160
Definition: script_error.h:48
Definition: script.h:71
Definition: script.h:104
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
Definition: script.h:147
Definition: script.h:166
Definition: script.h:120
Definition: script.h:69
Definition: interpreter.h:52
Definition: script.h:134
Definition: script.h:51
Definition: script.h:54
static bool IsDefinedHashtypeSignature(const valtype &vchSig)
Definition: interpreter.cpp:177
Definition: script.h:136
Definition: interpreter.h:58
Definition: serialize.h:162
Definition: script.h:73
Definition: script.h:144
Definition: script.h:171
Definition: script.h:100
Definition: script.h:53