mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
scripted-diff: Rename CPubKey and CKey::*_KEY_SIZE and COMPRESSED_*_KEY_SIZE
To SIZE and COMPRESSED_SIZE -BEGIN VERIFY SCRIPT- sed -i 's/PRIVATE_KEY_SIZE/SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp sed -i 's/COMPRESSED_PRIVATE_KEY_SIZE/COMPRESSED_SIZE/g' src/*.h src/**/*.cpp src/**/*.h src/**/*.cpp sed -i 's/PUBLIC_KEY_SIZE/SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp sed -i 's/COMPRESSED_PUBLIC_KEY_SIZE/COMPRESSED_SIZE/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user