| 109 | } |
| 110 | |
| 111 | u8 *encrypt_tlv_encrypted_data(const tal_t *ctx, |
| 112 | const struct privkey *path_privkey, |
| 113 | const struct pubkey *node, |
| 114 | const struct tlv_encrypted_data_tlv *tlv, |
| 115 | struct privkey *next_path_privkey, |
| 116 | struct pubkey *node_alias) |
| 117 | { |
| 118 | struct privkey unused; |
| 119 | u8 *tlv_wire = tal_arr(NULL, u8, 0); |
| 120 | towire_tlv_encrypted_data_tlv(&tlv_wire, tlv); |
| 121 | |
| 122 | /* last hop doesn't care about next path_key */ |
| 123 | if (!next_path_privkey) |
| 124 | next_path_privkey = &unused; |
| 125 | return enctlv_from_encmsg_raw(ctx, path_privkey, node, take(tlv_wire), |
| 126 | next_path_privkey, node_alias); |
| 127 | } |
| 128 | |
| 129 | bool unblind_onion(const struct pubkey *path_key, |
| 130 | void (*ecdh)(const struct pubkey *point, struct secret *ss), |