| 218 | } |
| 219 | |
| 220 | bool blindedpath_get_alias(const struct secret *ss, |
| 221 | const struct pubkey *my_id, |
| 222 | struct pubkey *alias) |
| 223 | { |
| 224 | struct secret node_id_blinding; |
| 225 | |
| 226 | /* BOLT #4: |
| 227 | * - $`B_i = HMAC256(\text{"blinded\_node\_id"}, ss_i) * N_i`$ |
| 228 | * (blinded `node_id` for $`N_i`$, private key known only by $`N_i`$) |
| 229 | */ |
| 230 | subkey_from_hmac("blinded_node_id", ss, &node_id_blinding); |
| 231 | SUPERVERBOSE("\t\"HMAC256('blinded_node_id', ss)\": \"%s\",\n", |
| 232 | fmt_secret(tmpctx, &node_id_blinding)); |
| 233 | |
| 234 | *alias = *my_id; |
| 235 | return secp256k1_ec_pubkey_tweak_mul(secp256k1_ctx, |
| 236 | &alias->pubkey, |
| 237 | node_id_blinding.data) == 1; |
| 238 | } |
| 239 | |
| 240 | void blindedpath_next_path_key(const struct tlv_encrypted_data_tlv *enc, |
| 241 | const struct pubkey *path_key, |