@@ -88,12 +88,13 @@ pub fn blinded_payment_path(
8888
8989	let  nonce = Nonce ( [ 42u8 ;  16 ] ) ; 
9090	let  expanded_key = keys_manager. get_expanded_key ( ) ; 
91+ 	let  receive_auth_key = keys_manager. get_receive_auth_key ( ) ; 
9192	let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
9293
9394	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
9495	BlindedPaymentPath :: new ( 
95- 		& intermediate_nodes[ ..] ,  * node_ids. last ( ) . unwrap ( ) ,  payee_tlvs , 
96- 		intro_node_max_htlc_opt. unwrap_or_else ( || channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat ) , 
96+ 		& intermediate_nodes[ ..] ,  * node_ids. last ( ) . unwrap ( ) ,  receive_auth_key , 
97+ 		payee_tlvs ,   intro_node_max_htlc_opt. unwrap_or_else ( || channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat ) , 
9798		TEST_FINAL_CLTV  as  u16 ,  keys_manager,  & secp_ctx
9899	) . unwrap ( ) 
99100} 
@@ -173,11 +174,13 @@ fn do_one_hop_blinded_path(success: bool) {
173174	} ; 
174175	let  nonce = Nonce ( [ 42u8 ;  16 ] ) ; 
175176	let  expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ; 
177+ 	let  receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ; 
176178	let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
177179
178180	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
179181	let  blinded_path = BlindedPaymentPath :: new ( 
180- 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
182+ 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  receive_auth_key, 
183+ 		payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
181184		& chanmon_cfgs[ 1 ] . keys_manager ,  & secp_ctx
182185	) . unwrap ( ) ; 
183186
@@ -227,9 +230,11 @@ fn mpp_to_one_hop_blinded_path() {
227230	} ; 
228231	let  nonce = Nonce ( [ 42u8 ;  16 ] ) ; 
229232	let  expanded_key = chanmon_cfgs[ 3 ] . keys_manager . get_expanded_key ( ) ; 
233+ 	let  receive_auth_key = chanmon_cfgs[ 3 ] . keys_manager . get_receive_auth_key ( ) ; 
230234	let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
231235	let  blinded_path = BlindedPaymentPath :: new ( 
232- 		& [ ] ,  nodes[ 3 ] . node . get_our_node_id ( ) ,  payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
236+ 		& [ ] ,  nodes[ 3 ] . node . get_our_node_id ( ) ,  receive_auth_key, 
237+ 		payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
233238		& chanmon_cfgs[ 3 ] . keys_manager ,  & secp_ctx
234239	) . unwrap ( ) ; 
235240
@@ -1337,10 +1342,12 @@ fn custom_tlvs_to_blinded_path() {
13371342	} ; 
13381343	let  nonce = Nonce ( [ 42u8 ;  16 ] ) ; 
13391344	let  expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ; 
1345+ 	let  receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ; 
13401346	let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
13411347	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
13421348	let  blinded_path = BlindedPaymentPath :: new ( 
1343- 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
1349+ 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  receive_auth_key, 
1350+ 		payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
13441351		& chanmon_cfgs[ 1 ] . keys_manager ,  & secp_ctx
13451352	) . unwrap ( ) ; 
13461353
@@ -1391,11 +1398,13 @@ fn fails_receive_tlvs_authentication() {
13911398	} ; 
13921399	let  nonce = Nonce ( [ 42u8 ;  16 ] ) ; 
13931400	let  expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ; 
1401+ 	let  receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ; 
13941402	let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
13951403
13961404	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
13971405	let  blinded_path = BlindedPaymentPath :: new ( 
1398- 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
1406+ 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  receive_auth_key, 
1407+ 		payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
13991408		& chanmon_cfgs[ 1 ] . keys_manager ,  & secp_ctx
14001409	) . unwrap ( ) ; 
14011410
@@ -1426,7 +1435,8 @@ fn fails_receive_tlvs_authentication() {
14261435
14271436	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
14281437	let  blinded_path = BlindedPaymentPath :: new ( 
1429- 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
1438+ 		& [ ] ,  nodes[ 1 ] . node . get_our_node_id ( ) ,  receive_auth_key, 
1439+ 		payee_tlvs,  u64:: MAX ,  TEST_FINAL_CLTV  as  u16 , 
14301440		& chanmon_cfgs[ 1 ] . keys_manager ,  & secp_ctx
14311441	) . unwrap ( ) ; 
14321442
@@ -1629,7 +1639,7 @@ fn route_blinding_spec_test_vector() {
16291639			& self ,  _invoice :  & RawBolt11Invoice ,  _recipient :  Recipient , 
16301640		)  -> Result < RecoverableSignature ,  ( ) >  {  unreachable ! ( )  } 
16311641		fn  get_peer_storage_key ( & self )  -> PeerStorageKey  {  unreachable ! ( )  } 
1632- 		fn  get_receive_auth_key ( & self )  -> ReceiveAuthKey  {  unreachable ! ( )  } 
1642+ 		fn  get_receive_auth_key ( & self )  -> ReceiveAuthKey  {  ReceiveAuthKey ( [ 41 ;   32 ] )  } 
16331643		fn  sign_bolt12_invoice ( 
16341644			& self ,  _invoice :  & UnsignedBolt12Invoice , 
16351645		)  -> Result < schnorr:: Signature ,  ( ) >  {  unreachable ! ( )  } 
@@ -1942,7 +1952,7 @@ fn test_trampoline_inbound_payment_decoding() {
19421952			& self ,  _invoice :  & RawBolt11Invoice ,  _recipient :  Recipient , 
19431953		)  -> Result < RecoverableSignature ,  ( ) >  {  unreachable ! ( )  } 
19441954		fn  get_peer_storage_key ( & self )  -> PeerStorageKey  {  unreachable ! ( )  } 
1945- 		fn  get_receive_auth_key ( & self )  -> ReceiveAuthKey  {  unreachable ! ( )  } 
1955+ 		fn  get_receive_auth_key ( & self )  -> ReceiveAuthKey  {  ReceiveAuthKey ( [ 41 ;   32 ] )  } 
19461956		fn  sign_bolt12_invoice ( 
19471957			& self ,  _invoice :  & UnsignedBolt12Invoice , 
19481958		)  -> Result < schnorr:: Signature ,  ( ) >  {  unreachable ! ( )  } 
@@ -2027,8 +2037,9 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
20272037		let  expanded_key = nodes[ 2 ] . keys_manager . get_expanded_key ( ) ; 
20282038		let  payee_tlvs = payee_tlvs. authenticate ( nonce,  & expanded_key) ; 
20292039		let  carol_unblinded_tlvs = payee_tlvs. encode ( ) ; 
2040+ 		let  receive_auth_key = nodes[ 2 ] . keys_manager . get_receive_auth_key ( ) ; 
20302041
2031- 		let  path = [ ( ( carol_node_id,  None ) ,  WithoutLength ( & carol_unblinded_tlvs) ) ] ; 
2042+ 		let  path = [ ( ( carol_node_id,  Some ( receive_auth_key ) ) ,  WithoutLength ( & carol_unblinded_tlvs) ) ] ; 
20322043		blinded_path:: utils:: construct_blinded_hops ( 
20332044			& secp_ctx,  path. into_iter ( ) ,  & carol_alice_trampoline_session_priv, 
20342045		) 
0 commit comments