| 819 | } |
| 820 | |
| 821 | static void payer_key_tweak(const struct pubkey *bolt12, |
| 822 | const u8 *publictweak, size_t publictweaklen, |
| 823 | struct sha256 *tweak) |
| 824 | { |
| 825 | u8 rawkey[PUBKEY_CMPR_LEN]; |
| 826 | struct sha256_ctx sha; |
| 827 | |
| 828 | pubkey_to_der(rawkey, bolt12); |
| 829 | |
| 830 | sha256_init(&sha); |
| 831 | sha256_update(&sha, rawkey, sizeof(rawkey)); |
| 832 | sha256_update(&sha, publictweak, publictweaklen); |
| 833 | sha256_done(&sha, tweak); |
| 834 | } |
| 835 | |
| 836 | /*~ lightningd asks us to sign a bolt12 (e.g. offer). */ |
| 837 | static u8 *handle_sign_bolt12(struct hsmd_client *c, const u8 *msg_in) |
no test coverage detected