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 | * Signatures passed to OP_CHECKDATASIG and its verify variant must be checked | ||||
* using this function. | * using this function. | ||||
*/ | */ | ||||
bool CheckDataSignatureEncoding(const valtype &vchSig, uint32_t flags, | bool CheckDataECDSASignatureEncoding(const valtype &vchSig, uint32_t flags, | ||||
deadalnix: This shouldn't change. | |||||
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. Signatures passed to OP_CHECKSIG, OP_CHECKMULTISIG and | ||||
* variants must be checked using this function. | * their verify variants must be checked using this function. | ||||
*/ | */ | ||||
bool CheckTransactionSignatureEncoding(const valtype &vchSig, uint32_t flags, | bool CheckTransactionECDSASignatureEncoding(const valtype &vchSig, | ||||
deadalnixUnsubmitted Not Done Inline ActionsKeep the original, but move the implementation in CheckTransactionECDSASignatureEncoding and get CheckTransactionSignatureEncoding to forward to it. That'll give you a natural point to insert check for ECDSA and schnorr that doesn't clutter all the callsite and is consistent with each piece of code's responsibility. deadalnix: Keep the original, but move the implementation in `CheckTransactionECDSASignatureEncoding` and… | |||||
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 |
This shouldn't change.