diff --git a/lightning/src/blinded_path/message.rs b/lightning/src/blinded_path/message.rs index d3b762cb1ac..bd079088c22 100644 --- a/lightning/src/blinded_path/message.rs +++ b/lightning/src/blinded_path/message.rs @@ -61,10 +61,10 @@ pub(super) fn blinded_hops( ) -> Result, secp256k1::Error> { let mut blinded_hops = Vec::with_capacity(unblinded_path.len()); - let mut prev_ss_and_blinded_node_id = None; + let mut prev_rho_and_blinded_node_id = None; utils::construct_keys_callback(secp_ctx, unblinded_path.iter(), None, session_priv, - |blinded_node_id, _, _, encrypted_payload_ss, unblinded_pk, _| { - if let Some((prev_ss, prev_blinded_node_id)) = prev_ss_and_blinded_node_id { + |blinded_node_id, _, _, encrypted_payload_rho, unblinded_pk, _| { + if let Some((prev_ss, prev_blinded_node_id)) = prev_rho_and_blinded_node_id { if let Some(pk) = unblinded_pk { let payload = ForwardTlvs { next_node_id: pk, @@ -76,14 +76,14 @@ pub(super) fn blinded_hops( }); } else { debug_assert!(false); } } - prev_ss_and_blinded_node_id = Some((encrypted_payload_ss, blinded_node_id)); + prev_rho_and_blinded_node_id = Some((encrypted_payload_rho, blinded_node_id)); })?; - if let Some((final_ss, final_blinded_node_id)) = prev_ss_and_blinded_node_id { + if let Some((final_rho, final_blinded_node_id)) = prev_rho_and_blinded_node_id { let final_payload = ReceiveTlvs { path_id: None }; blinded_hops.push(BlindedHop { blinded_node_id: final_blinded_node_id, - encrypted_payload: utils::encrypt_payload(final_payload, final_ss), + encrypted_payload: utils::encrypt_payload(final_payload, final_rho), }); } else { debug_assert!(false) } diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index 446841817e5..5d5a4c94e3d 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -169,10 +169,10 @@ pub(super) fn blinded_hops( let mut curr_hop_idx = 0; utils::construct_keys_callback( secp_ctx, unblinded_path.iter().map(|(pk, _)| pk), None, session_priv, - |blinded_node_id, _, _, encrypted_payload_ss, _, _| { + |blinded_node_id, _, _, encrypted_payload_rho, _, _| { blinded_hops.push(BlindedHop { blinded_node_id, - encrypted_payload: utils::encrypt_payload(&unblinded_path[curr_hop_idx].1, encrypted_payload_ss), + encrypted_payload: utils::encrypt_payload(&unblinded_path[curr_hop_idx].1, encrypted_payload_rho), }); curr_hop_idx += 1; })?; diff --git a/lightning/src/blinded_path/utils.rs b/lightning/src/blinded_path/utils.rs index 1f12d406a9b..f4f156ccab6 100644 --- a/lightning/src/blinded_path/utils.rs +++ b/lightning/src/blinded_path/utils.rs @@ -106,9 +106,9 @@ where } /// Encrypt TLV payload to be used as a [`crate::blinded_path::BlindedHop::encrypted_payload`]. -pub(super) fn encrypt_payload(payload: P, encrypted_tlvs_ss: [u8; 32]) -> Vec { +pub(super) fn encrypt_payload(payload: P, encrypted_tlvs_rho: [u8; 32]) -> Vec { let mut writer = VecWriter(Vec::new()); - let write_adapter = ChaChaPolyWriteAdapter::new(encrypted_tlvs_ss, &payload); + let write_adapter = ChaChaPolyWriteAdapter::new(encrypted_tlvs_rho, &payload); write_adapter.write(&mut writer).expect("In-memory writes cannot fail"); writer.0 }