mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge #12461: scripted-diff: Rename key size consts to be relative to their class
0580f86bb4Fixup whitespace (Ben Woosley)47101bbb27scripted-diff: Rename CPubKey and CKey::*_KEY_SIZE and COMPRESSED_*_KEY_SIZE (Ben Woosley) Pull request description: ~~And introduce CPubKeySig to host code relative to key sigs.~~ ACKs for top commit: meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/12461/commits/0580f86bb48004b797d4cb6273e7ffee0b0a0584 Tree-SHA512: 29aa0be54912358b138e391b9db78639786f56580493e590ec9f773c0e1b421740133d05a79be247c7ee57e71c9c9e41b9cb54088cb3c0e3f813f74f0895287b
This commit is contained in:
commit
36191a8bb5
8 changed files with 45 additions and 45 deletions
|
|
@ -61,17 +61,17 @@ static inline void popstack(std::vector<valtype>& stack)
|
|||
}
|
||||
|
||||
bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) {
|
||||
if (vchPubKey.size() < CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) {
|
||||
if (vchPubKey.size() < CPubKey::COMPRESSED_SIZE) {
|
||||
// Non-canonical public key: too short
|
||||
return false;
|
||||
}
|
||||
if (vchPubKey[0] == 0x04) {
|
||||
if (vchPubKey.size() != CPubKey::PUBLIC_KEY_SIZE) {
|
||||
if (vchPubKey.size() != CPubKey::SIZE) {
|
||||
// Non-canonical public key: invalid length for uncompressed key
|
||||
return false;
|
||||
}
|
||||
} else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) {
|
||||
if (vchPubKey.size() != CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) {
|
||||
if (vchPubKey.size() != CPubKey::COMPRESSED_SIZE) {
|
||||
// Non-canonical public key: invalid length for compressed key
|
||||
return false;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) {
|
|||
}
|
||||
|
||||
bool static IsCompressedPubKey(const valtype &vchPubKey) {
|
||||
if (vchPubKey.size() != CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) {
|
||||
if (vchPubKey.size() != CPubKey::COMPRESSED_SIZE) {
|
||||
// Non-canonical public key: invalid length for compressed key
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue