Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigencoding.cpp
Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | return CheckTransactionSignatureEncodingImpl( | ||||
ScriptError *templateSerror) { | ScriptError *templateSerror) { | ||||
return CheckRawSchnorrSignatureEncoding(templateSig, templateFlags, | return CheckRawSchnorrSignatureEncoding(templateSig, templateFlags, | ||||
templateSerror); | templateSerror); | ||||
}); | }); | ||||
} | } | ||||
static bool IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { | static bool IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) { | ||||
switch (vchPubKey.size()) { | switch (vchPubKey.size()) { | ||||
case CPubKey::COMPRESSED_PUBLIC_KEY_SIZE: | case CPubKey::COMPRESSED_SIZE: | ||||
// Compressed public key: must start with 0x02 or 0x03. | // Compressed public key: must start with 0x02 or 0x03. | ||||
return vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03; | return vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03; | ||||
case CPubKey::PUBLIC_KEY_SIZE: | case CPubKey::SIZE: | ||||
// Non-compressed public key: must start with 0x04. | // Non-compressed public key: must start with 0x04. | ||||
return vchPubKey[0] == 0x04; | return vchPubKey[0] == 0x04; | ||||
default: | default: | ||||
// Non-canonical public key: invalid size. | // Non-canonical public key: invalid size. | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
Show All 9 Lines |