Convert from pubkey to compressed pubkey. */
| 10 | |
| 11 | /* Convert from pubkey to compressed pubkey. */ |
| 12 | void node_id_from_pubkey(struct node_id *id, const struct pubkey *key) |
| 13 | { |
| 14 | size_t outlen = ARRAY_SIZE(id->k); |
| 15 | if (!secp256k1_ec_pubkey_serialize(secp256k1_ctx, id->k, &outlen, |
| 16 | &key->pubkey, |
| 17 | SECP256K1_EC_COMPRESSED)) |
| 18 | abort(); |
| 19 | } |
| 20 | |
| 21 | WARN_UNUSED_RESULT |
| 22 | bool pubkey_from_node_id(struct pubkey *key, const struct node_id *id) |