Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigencoding.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | static bool CheckRawSignatureEncoding(const slicedvaltype &sig, uint32_t flags, | ||||
if ((flags & SCRIPT_VERIFY_LOW_S) && !CPubKey::CheckLowS(sig)) { | if ((flags & SCRIPT_VERIFY_LOW_S) && !CPubKey::CheckLowS(sig)) { | ||||
return set_error(serror, SCRIPT_ERR_SIG_HIGH_S); | return set_error(serror, SCRIPT_ERR_SIG_HIGH_S); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool CheckDataSignatureEncoding(const valtype &vchSig, uint32_t flags, | |||||
ScriptError *serror) { | |||||
// Empty signature. Not strictly DER encoded, but allowed to provide a | |||||
// compact way to provide an invalid signature for use with CHECK(MULTI)SIG | |||||
if (vchSig.size() == 0) { | |||||
return true; | |||||
} | |||||
return CheckRawSignatureEncoding( | |||||
vchSig | boost::adaptors::sliced(0, vchSig.size()), flags, serror); | |||||
} | |||||
bool CheckTransactionSignatureEncoding(const valtype &vchSig, uint32_t flags, | bool CheckTransactionSignatureEncoding(const valtype &vchSig, uint32_t flags, | ||||
ScriptError *serror) { | ScriptError *serror) { | ||||
// Empty signature. Not strictly DER encoded, but allowed to provide a | // Empty signature. Not strictly DER encoded, but allowed to provide a | ||||
// compact way to provide an invalid signature for use with CHECK(MULTI)SIG | // compact way to provide an invalid signature for use with CHECK(MULTI)SIG | ||||
if (vchSig.size() == 0) { | if (vchSig.size() == 0) { | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |