Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
sigencoding.h
Go to the documentation of this file.
1// Copyright (c) 2009-2010 Satoshi Nakamoto
2// Copyright (c) 2009-2016 The Bitcoin Core developers
3// Copyright (c) 2017-2019 The Bitcoin developers
4// Distributed under the MIT software license, see the accompanying
5// file COPYING or http://www.opensource.org/licenses/mit-license.php.
6
7#ifndef BITCOIN_SCRIPT_SIGENCODING_H
8#define BITCOIN_SCRIPT_SIGENCODING_H
9
10#include <script/script_error.h>
11#include <script/sighashtype.h>
12
13#include <cstdint>
14#include <vector>
15
16typedef std::vector<uint8_t> valtype;
17
18namespace {
19
21 if (vchSig.size() == 0) {
22 return SigHashType(0);
23 }
24
25 return SigHashType(vchSig[vchSig.size() - 1]);
26}
27
28} // namespace
29
37
45
54
63
67bool CheckPubKeyEncoding(const valtype &vchPubKey, uint32_t flags,
69
70#endif // BITCOIN_SCRIPT_SIGENCODING_H
int flags
Signature hash type wrapper class.
Definition sighashtype.h:37
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
ScriptError
bool CheckTransactionSchnorrSignatureEncoding(const valtype &vchSig, uint32_t flags, ScriptError *serror)
Check that the signature provided to authentify a transaction is properly encoded Schnorr signature (...
std::vector< uint8_t > valtype
Definition sigencoding.h:16
bool CheckDataSignatureEncoding(const valtype &vchSig, uint32_t flags, ScriptError *serror)
Check that the signature provided on some data is properly encoded.
bool CheckTransactionECDSASignatureEncoding(const valtype &vchSig, uint32_t flags, ScriptError *serror)
Check that the signature provided to authentify a transaction is properly encoded ECDSA signature.
bool CheckTransactionSignatureEncoding(const valtype &vchSig, uint32_t flags, ScriptError *serror)
Check that the signature provided to authentify a transaction is properly encoded.
bool CheckPubKeyEncoding(const valtype &vchPubKey, uint32_t flags, ScriptError *serror)
Check that a public key is encoded properly.