MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / IsCompressedPubKey

Function IsCompressedPubKey

src/script/interpreter.cpp:85–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85bool static IsCompressedPubKey(const valtype &vchPubKey) {
86 if (vchPubKey.size() != CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) {
87 // Non-canonical public key: invalid length for compressed key
88 return false;
89 }
90 if (vchPubKey[0] != 0x02 && vchPubKey[0] != 0x03) {
91 // Non-canonical public key: invalid prefix for compressed key
92 return false;
93 }
94 return true;
95}
96
97/**
98 * A canonical signature exists of: <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype>

Callers 1

CheckPubKeyEncodingFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected