| 393 | } |
| 394 | |
| 395 | static bool payer_key(struct lightningd *ld, |
| 396 | const u8 *public_tweak, size_t public_tweak_len, |
| 397 | struct point32 *key) |
| 398 | { |
| 399 | struct sha256 tweakhash; |
| 400 | secp256k1_pubkey tweaked; |
| 401 | |
| 402 | payer_key_tweak(&ld->bolt12_base, public_tweak, public_tweak_len, |
| 403 | &tweakhash); |
| 404 | |
| 405 | /* Tweaking gives a not-x-only pubkey, must then convert. */ |
| 406 | if (secp256k1_xonly_pubkey_tweak_add(secp256k1_ctx, |
| 407 | &tweaked, |
| 408 | &ld->bolt12_base.pubkey, |
| 409 | tweakhash.u.u8) != 1) |
| 410 | return false; |
| 411 | |
| 412 | return secp256k1_xonly_pubkey_from_pubkey(secp256k1_ctx, |
| 413 | &key->pubkey, |
| 414 | NULL, &tweaked) == 1; |
| 415 | } |
| 416 | |
| 417 | static struct command_result *json_createinvoicerequest(struct command *cmd, |
| 418 | const char *buffer, |
no test coverage detected