| 165 | } |
| 166 | |
| 167 | bool static IsCompressedPubKey(const valtype &vchPubKey) { |
| 168 | if (vchPubKey.size() != CPubKey::COMPRESSED_SIZE) { |
| 169 | // Non-canonical public key: invalid length for compressed key |
| 170 | return false; |
| 171 | } |
| 172 | if (vchPubKey[0] != 0x02 && vchPubKey[0] != 0x03) { |
| 173 | // Non-canonical public key: invalid prefix for compressed key |
| 174 | return false; |
| 175 | } |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * A canonical signature exists of: <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype> |
no test coverage detected