Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigencoding.h
Show All 22 Lines | inline SigHashType GetHashType(const valtype &vchSig) { | ||||
} | } | ||||
return SigHashType(vchSig[vchSig.size() - 1]); | return SigHashType(vchSig[vchSig.size() - 1]); | ||||
} | } | ||||
} // namespace | } // namespace | ||||
/** | /** | ||||
* Check that the signature provided on some data is properly encoded. | * Check that the ECDSA signature provided on some data is properly encoded. | ||||
* Signatures passed to OP_CHECKDATASIG and its verify variant must be checked | * ECDSA signatures passed to OP_CHECKDATASIG and its verify variant must be | ||||
* using this function. | * checked using this function. | ||||
*/ | */ | ||||
bool CheckDataSignatureEncoding(const valtype &vchSig, uint32_t flags, | bool CheckDataECDSASignatureEncoding(const valtype &vchSig, uint32_t flags, | ||||
deadalnix: You are passed the flags down, so it is probably the respectability of that function to check… | |||||
markblundebergAuthorUnsubmitted Done Inline Actionsditto to previous comment markblundeberg: ditto to previous comment | |||||
ScriptError *serror); | ScriptError *serror); | ||||
/** | /** | ||||
* Check that the signature provided to authentify a transaction is properly | * Check that the ECDSA signature provided to authentify a transaction is | ||||
* encoded. Signatures passed to OP_CHECKSIG, OP_CHECKMULTISIG and their verify | * properly encoded. ECDSA signatures passed to OP_CHECKSIG, OP_CHECKMULTISIG | ||||
* variants must be checked using this function. | * and their verify variants must be checked using this function. | ||||
*/ | */ | ||||
bool CheckTransactionSignatureEncoding(const valtype &vchSig, uint32_t flags, | bool CheckTransactionECDSASignatureEncoding(const valtype &vchSig, | ||||
uint32_t flags, | |||||
ScriptError *serror); | |||||
/** | |||||
* Check that the ECDSA signature provided to authentify a transaction is | |||||
* properly encoded. ECDSA signatures passed to OP_CHECKSIG, OP_CHECKMULTISIG | |||||
* and their verify variants must be checked using this function. | |||||
*/ | |||||
bool CheckTransactionSchnorrSignatureEncoding(const valtype &vchSig, | |||||
uint32_t flags, | |||||
ScriptError *serror); | ScriptError *serror); | ||||
/** | /** | ||||
* Check that a public key is encoded properly. | * Check that a public key is encoded properly. | ||||
*/ | */ | ||||
bool CheckPubKeyEncoding(const valtype &vchPubKey, uint32_t flags, | bool CheckPubKeyEncoding(const valtype &vchPubKey, uint32_t flags, | ||||
ScriptError *serror); | ScriptError *serror); | ||||
#endif // BITCOIN_SCRIPT_SIGENCODING_H | #endif // BITCOIN_SCRIPT_SIGENCODING_H |
You are passed the flags down, so it is probably the respectability of that function to check if the encoding correspond to schnorr and is enabled or not rather than the caller.