@@ -88,12 +88,13 @@ pub fn blinded_payment_path(
88
88
89
89
let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
90
90
let expanded_key = keys_manager. get_expanded_key ( ) ;
91
+ let receive_auth_key = keys_manager. get_receive_auth_key ( ) ;
91
92
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
92
93
93
94
let mut secp_ctx = Secp256k1 :: new ( ) ;
94
95
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 ) ,
97
98
TEST_FINAL_CLTV as u16 , keys_manager, & secp_ctx
98
99
) . unwrap ( )
99
100
}
@@ -173,11 +174,13 @@ fn do_one_hop_blinded_path(success: bool) {
173
174
} ;
174
175
let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
175
176
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 ( ) ;
176
178
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
177
179
178
180
let mut secp_ctx = Secp256k1 :: new ( ) ;
179
181
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 ,
181
184
& chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
182
185
) . unwrap ( ) ;
183
186
@@ -227,9 +230,11 @@ fn mpp_to_one_hop_blinded_path() {
227
230
} ;
228
231
let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
229
232
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 ( ) ;
230
234
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
231
235
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 ,
233
238
& chanmon_cfgs[ 3 ] . keys_manager , & secp_ctx
234
239
) . unwrap ( ) ;
235
240
@@ -1337,10 +1342,12 @@ fn custom_tlvs_to_blinded_path() {
1337
1342
} ;
1338
1343
let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
1339
1344
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 ( ) ;
1340
1346
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
1341
1347
let mut secp_ctx = Secp256k1 :: new ( ) ;
1342
1348
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 ,
1344
1351
& chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
1345
1352
) . unwrap ( ) ;
1346
1353
@@ -1391,11 +1398,13 @@ fn fails_receive_tlvs_authentication() {
1391
1398
} ;
1392
1399
let nonce = Nonce ( [ 42u8 ; 16 ] ) ;
1393
1400
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 ( ) ;
1394
1402
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
1395
1403
1396
1404
let mut secp_ctx = Secp256k1 :: new ( ) ;
1397
1405
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 ,
1399
1408
& chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
1400
1409
) . unwrap ( ) ;
1401
1410
@@ -1426,7 +1435,8 @@ fn fails_receive_tlvs_authentication() {
1426
1435
1427
1436
let mut secp_ctx = Secp256k1 :: new ( ) ;
1428
1437
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 ,
1430
1440
& chanmon_cfgs[ 1 ] . keys_manager , & secp_ctx
1431
1441
) . unwrap ( ) ;
1432
1442
@@ -1629,7 +1639,7 @@ fn route_blinding_spec_test_vector() {
1629
1639
& self , _invoice : & RawBolt11Invoice , _recipient : Recipient ,
1630
1640
) -> Result < RecoverableSignature , ( ) > { unreachable ! ( ) }
1631
1641
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 ] ) }
1633
1643
fn sign_bolt12_invoice (
1634
1644
& self , _invoice : & UnsignedBolt12Invoice ,
1635
1645
) -> Result < schnorr:: Signature , ( ) > { unreachable ! ( ) }
@@ -1942,7 +1952,7 @@ fn test_trampoline_inbound_payment_decoding() {
1942
1952
& self , _invoice : & RawBolt11Invoice , _recipient : Recipient ,
1943
1953
) -> Result < RecoverableSignature , ( ) > { unreachable ! ( ) }
1944
1954
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 ] ) }
1946
1956
fn sign_bolt12_invoice (
1947
1957
& self , _invoice : & UnsignedBolt12Invoice ,
1948
1958
) -> Result < schnorr:: Signature , ( ) > { unreachable ! ( ) }
@@ -2027,8 +2037,9 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
2027
2037
let expanded_key = nodes[ 2 ] . keys_manager . get_expanded_key ( ) ;
2028
2038
let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
2029
2039
let carol_unblinded_tlvs = payee_tlvs. encode ( ) ;
2040
+ let receive_auth_key = nodes[ 2 ] . keys_manager . get_receive_auth_key ( ) ;
2030
2041
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) ) ] ;
2032
2043
blinded_path:: utils:: construct_blinded_hops (
2033
2044
& secp_ctx, path. into_iter ( ) , & carol_alice_trampoline_session_priv,
2034
2045
)
0 commit comments