| 83 | } |
| 84 | |
| 85 | bool 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> |
no test coverage detected