Skip to content

Commit 2745382

Browse files
committed
f: blinded tweak calculation
1 parent 2ca5ee9 commit 2745382

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,11 +1595,17 @@ where
15951595
#[cfg(trampoline)]
15961596
msgs::InboundOnionPayload::TrampolineEntrypoint(hop_data) => {
15971597
let incoming_trampoline_public_key = hop_data.trampoline_packet.public_key;
1598+
let trampoline_blinded_node_id_tweak = hop_data.current_path_key.map(|bp| {
1599+
let blinded_tlvs_ss = node_signer.ecdh(recipient, &bp, None).unwrap().secret_bytes();
1600+
let mut hmac = HmacEngine::<Sha256>::new(b"blinded_node_id");
1601+
hmac.input(blinded_tlvs_ss.as_ref());
1602+
Scalar::from_be_bytes(Hmac::from_engine(hmac).to_byte_array()).unwrap()
1603+
});
15981604
let trampoline_shared_secret = node_signer
15991605
.ecdh(
16001606
recipient,
16011607
&incoming_trampoline_public_key,
1602-
blinded_node_id_tweak.as_ref(),
1608+
trampoline_blinded_node_id_tweak.as_ref(),
16031609
)
16041610
.unwrap()
16051611
.secret_bytes();

0 commit comments

Comments
 (0)