Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigencoding.cpp
Show All 36 Lines | static bool IsValidSignatureEncoding(const slicedvaltype &sig) { | ||||
// * S: arbitrary-length big-endian encoded S value. The same rules apply. | // * S: arbitrary-length big-endian encoded S value. The same rules apply. | ||||
// Minimum and maximum size constraints. | // Minimum and maximum size constraints. | ||||
if (sig.size() < 8 || sig.size() > 72) { | if (sig.size() < 8 || sig.size() > 72) { | ||||
return false; | return false; | ||||
} | } | ||||
// | // | ||||
// Check that the signature is a coumpound structure of proper size. | // Check that the signature is a compound structure of proper size. | ||||
// | // | ||||
// A signature is of type 0x30 (compound). | // A signature is of type 0x30 (compound). | ||||
if (sig[0] != 0x30) { | if (sig[0] != 0x30) { | ||||
return false; | return false; | ||||
} | } | ||||
// Make sure the length covers the entire signature. | // Make sure the length covers the entire signature. | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |