@@ -86,12 +86,13 @@ pub fn blinded_payment_path(
8686
8787 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
8888 let expanded_key = keys_manager. get_expanded_key ( ) ;
89+ let receive_auth_key = keys_manager. get_receive_auth_key ( ) ;
8990 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
9091
9192 let mut secp_ctx = Secp256k1 :: new ( ) ;
9293 BlindedPaymentPath :: new (
93- & intermediate_nodes[ ..] , * node_ids. last ( ) . unwrap ( ) , payee_tlvs ,
94- intro_node_max_htlc_opt. unwrap_or_else ( || channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat ) ,
94+ & intermediate_nodes[ ..] , * node_ids. last ( ) . unwrap ( ) , receive_auth_key ,
95+ payee_tlvs , intro_node_max_htlc_opt. unwrap_or_else ( || channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat ) ,
9596 TEST_FINAL_CLTV as u16 , keys_manager, & secp_ctx
9697 ) . unwrap ( )
9798}
@@ -171,11 +172,13 @@ fn do_one_hop_blinded_path(success: bool) {
171172 } ;
172173 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
173174 let expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ;
175+ let receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ;
174176 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
175177
176178 let mut secp_ctx = Secp256k1 :: new ( ) ;
177179 let blinded_path = BlindedPaymentPath :: new (
178- & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
180+ & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , receive_auth_key,
181+ payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
179182 & chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
180183 ) . unwrap ( ) ;
181184
@@ -225,9 +228,11 @@ fn mpp_to_one_hop_blinded_path() {
225228 } ;
226229 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
227230 let expanded_key = chanmon_cfgs[ 3 ] . keys_manager . get_expanded_key ( ) ;
231+ let receive_auth_key = chanmon_cfgs[ 3 ] . keys_manager . get_receive_auth_key ( ) ;
228232 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
229233 let blinded_path = BlindedPaymentPath :: new (
230- & [ ] , nodes[ 3 ] . node . get_our_node_id ( ) , payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
234+ & [ ] , nodes[ 3 ] . node . get_our_node_id ( ) , receive_auth_key,
235+ payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
231236 & chanmon_cfgs[ 3 ] . keys_manager , & secp_ctx
232237 ) . unwrap ( ) ;
233238
@@ -1335,10 +1340,12 @@ fn custom_tlvs_to_blinded_path() {
13351340 } ;
13361341 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
13371342 let expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ;
1343+ let receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ;
13381344 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
13391345 let mut secp_ctx = Secp256k1 :: new ( ) ;
13401346 let blinded_path = BlindedPaymentPath :: new (
1341- & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
1347+ & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , receive_auth_key,
1348+ payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
13421349 & chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
13431350 ) . unwrap ( ) ;
13441351
@@ -1389,11 +1396,13 @@ fn fails_receive_tlvs_authentication() {
13891396 } ;
13901397 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
13911398 let expanded_key = chanmon_cfgs[ 1 ] . keys_manager . get_expanded_key ( ) ;
1399+ let receive_auth_key = chanmon_cfgs[ 1 ] . keys_manager . get_receive_auth_key ( ) ;
13921400 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
13931401
13941402 let mut secp_ctx = Secp256k1 :: new ( ) ;
13951403 let blinded_path = BlindedPaymentPath :: new (
1396- & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
1404+ & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , receive_auth_key,
1405+ payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
13971406 & chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
13981407 ) . unwrap ( ) ;
13991408
@@ -1424,7 +1433,8 @@ fn fails_receive_tlvs_authentication() {
14241433
14251434 let mut secp_ctx = Secp256k1 :: new ( ) ;
14261435 let blinded_path = BlindedPaymentPath :: new (
1427- & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
1436+ & [ ] , nodes[ 1 ] . node . get_our_node_id ( ) , receive_auth_key,
1437+ payee_tlvs, u64:: MAX , TEST_FINAL_CLTV as u16 ,
14281438 & chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
14291439 ) . unwrap ( ) ;
14301440
@@ -1627,7 +1637,7 @@ fn route_blinding_spec_test_vector() {
16271637 & self , _invoice : & RawBolt11Invoice , _recipient : Recipient ,
16281638 ) -> Result < RecoverableSignature , ( ) > { unreachable ! ( ) }
16291639 fn get_peer_storage_key ( & self ) -> PeerStorageKey { unreachable ! ( ) }
1630- fn get_receive_auth_key ( & self ) -> ReceiveAuthKey { unreachable ! ( ) }
1640+ fn get_receive_auth_key ( & self ) -> ReceiveAuthKey { ReceiveAuthKey ( [ 41 ; 32 ] ) }
16311641 fn sign_bolt12_invoice (
16321642 & self , _invoice : & UnsignedBolt12Invoice ,
16331643 ) -> Result < schnorr:: Signature , ( ) > { unreachable ! ( ) }
@@ -1940,7 +1950,7 @@ fn test_trampoline_inbound_payment_decoding() {
19401950 & self , _invoice : & RawBolt11Invoice , _recipient : Recipient ,
19411951 ) -> Result < RecoverableSignature , ( ) > { unreachable ! ( ) }
19421952 fn get_peer_storage_key ( & self ) -> PeerStorageKey { unreachable ! ( ) }
1943- fn get_receive_auth_key ( & self ) -> ReceiveAuthKey { unreachable ! ( ) }
1953+ fn get_receive_auth_key ( & self ) -> ReceiveAuthKey { ReceiveAuthKey ( [ 41 ; 32 ] ) }
19441954 fn sign_bolt12_invoice (
19451955 & self , _invoice : & UnsignedBolt12Invoice ,
19461956 ) -> Result < schnorr:: Signature , ( ) > { unreachable ! ( ) }
@@ -2207,8 +2217,9 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
22072217 } ;
22082218 let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
22092219 let expanded_key = nodes[ 2 ] . keys_manager . get_expanded_key ( ) ;
2220+ let receive_auth_key = nodes[ 2 ] . keys_manager . get_receive_auth_key ( ) ;
22102221 let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
2211- let blinded_path = BlindedPaymentPath :: new ( & [ ] , carol_node_id, payee_tlvs, u64:: MAX , 0 , nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
2222+ let blinded_path = BlindedPaymentPath :: new ( & [ ] , carol_node_id, receive_auth_key , payee_tlvs, u64:: MAX , 0 , nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
22122223
22132224 let route = Route {
22142225 paths : vec ! [ Path {
0 commit comments