| 186 | } |
| 187 | |
| 188 | CPubKey CKey::GetPubKey() const { |
| 189 | assert(fValid); |
| 190 | secp256k1_pubkey pubkey; |
| 191 | size_t clen = CPubKey::SIZE; |
| 192 | CPubKey result; |
| 193 | int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, begin()); |
| 194 | assert(ret); |
| 195 | secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED); |
| 196 | assert(result.size() == clen); |
| 197 | assert(result.IsValid()); |
| 198 | return result; |
| 199 | } |
| 200 | |
| 201 | // Check that the sig has a low R value and will be less than 71 bytes |
| 202 | bool SigHasLowR(const secp256k1_ecdsa_signature* sig) |
no test coverage detected