![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include "interpreter.h"
#include "primitives/transaction.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "pubkey.h"
#include "script/script.h"
#include "uint256.h"
Go to the source code of this file.
Macros | |
#define | stacktop(i) (stack.at(stack.size()+(i))) |
#define | altstacktop(i) (altstack.at(altstack.size()+(i))) |
Typedefs | |
typedef vector< unsigned char > | valtype |
Functions | |
bool | CastToBool (const valtype &vch) |
static void | popstack (vector< valtype > &stack) |
static bool | IsCompressedOrUncompressedPubKey (const valtype &vchPubKey) |
static bool | IsValidSignatureEncoding (const std::vector< unsigned char > &sig) |
static bool | IsLowDERSignature (const valtype &vchSig, ScriptError *serror) |
static bool | IsDefinedHashtypeSignature (const valtype &vchSig) |
bool | CheckSignatureEncoding (const vector< unsigned char > &vchSig, unsigned int flags, ScriptError *serror) |
static bool | CheckPubKeyEncoding (const valtype &vchSig, unsigned int flags, ScriptError *serror) |
static bool | CheckMinimalPush (const valtype &data, opcodetype opcode) |
bool | EvalScript (vector< vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror) |
uint256 | SignatureHash (const CScript &scriptCode, const CTransaction &txTo, unsigned int nIn, int nHashType) |
bool | VerifyScript (const CScript &scriptSig, const CScript &scriptPubKey, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror) |
#define altstacktop | ( | i | ) | (altstack.at(altstack.size()+(i))) |
Definition at line 58 of file interpreter.cpp.
Referenced by EvalScript().
#define stacktop | ( | i | ) | (stack.at(stack.size()+(i))) |
Script is a stack machine (like Forth) that evaluates a predicate returning a bool indicating valid or not. There are no loops.
Definition at line 57 of file interpreter.cpp.
Referenced by EvalScript().
typedef vector<unsigned char> valtype |
Definition at line 18 of file interpreter.cpp.
bool CastToBool | ( | const valtype & | vch | ) |
Definition at line 38 of file interpreter.cpp.
Referenced by EvalScript(), and VerifyScript().
|
static |
Definition at line 209 of file interpreter.cpp.
Referenced by EvalScript().
|
static |
Definition at line 202 of file interpreter.cpp.
Referenced by EvalScript().
bool CheckSignatureEncoding | ( | const vector< unsigned char > & | vchSig, |
unsigned int | flags, | ||
ScriptError * | serror | ||
) |
Definition at line 185 of file interpreter.cpp.
Referenced by EvalScript(), and ScriptToAsmStr().
bool EvalScript | ( | vector< vector< unsigned char > > & | stack, |
const CScript & | script, | ||
unsigned int | flags, | ||
const BaseSignatureChecker & | checker, | ||
ScriptError * | serror | ||
) |
Definition at line 232 of file interpreter.cpp.
Referenced by AreInputsStandard(), CombineSignatures(), and VerifyScript().
|
static |
Definition at line 66 of file interpreter.cpp.
Referenced by CheckPubKeyEncoding().
|
static |
Definition at line 174 of file interpreter.cpp.
Referenced by CheckSignatureEncoding().
|
static |
Definition at line 163 of file interpreter.cpp.
Referenced by CheckSignatureEncoding().
|
static |
A canonical signature exists of: <30> <total len>=""> <02> <len r>=""> <R> <02> <len s>=""> <S> <hashtype> Where R and S are not negative (their first byte has its highest bit not set), and not excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, in which case a single 0 byte is necessary and even required).
See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623
This function is consensus-critical since BIP66.
Definition at line 98 of file interpreter.cpp.
Referenced by CheckSignatureEncoding(), and IsLowDERSignature().
|
inlinestatic |
Definition at line 59 of file interpreter.cpp.
Referenced by EvalScript(), and VerifyScript().
uint256 SignatureHash | ( | const CScript & | scriptCode, |
const CTransaction & | txTo, | ||
unsigned int | nIn, | ||
int | nHashType | ||
) |
Definition at line 1109 of file interpreter.cpp.
Referenced by TransactionSignatureChecker::CheckSig().
bool VerifyScript | ( | const CScript & | scriptSig, |
const CScript & | scriptPubKey, | ||
unsigned int | flags, | ||
const BaseSignatureChecker & | checker, | ||
ScriptError * | serror | ||
) |
Definition at line 1242 of file interpreter.cpp.
Referenced by dashconsensus_verify_script(), CPrivateSendServer::IsInputScriptSigValid(), MutateTxSign(), CScriptCheck::operator()(), ProduceSignature(), and signrawtransaction().