| 24 | } |
| 25 | |
| 26 | void pubkey_to_der(u8 der[PUBKEY_CMPR_LEN], const struct pubkey *key) |
| 27 | { |
| 28 | size_t outlen = PUBKEY_CMPR_LEN; |
| 29 | if (!secp256k1_ec_pubkey_serialize(secp256k1_ctx, der, &outlen, |
| 30 | &key->pubkey, |
| 31 | SECP256K1_EC_COMPRESSED)) |
| 32 | abort(); |
| 33 | assert(outlen == PUBKEY_CMPR_LEN); |
| 34 | } |
| 35 | |
| 36 | bool pubkey_from_secret(const struct secret *secret, struct pubkey *key) |
| 37 | { |
no test coverage detected