@@ -13,7 +13,7 @@ use bitcoin::hashes::hmac::Hmac;
13
13
use bitcoin:: hashes:: sha256:: Hash as Sha256 ;
14
14
use bitcoin:: secp256k1:: { self , PublicKey , Secp256k1 , SecretKey } ;
15
15
16
- use crate :: blinded_path:: utils;
16
+ use crate :: blinded_path:: utils:: { self , BlindedPathWithPadding } ;
17
17
use crate :: blinded_path:: { BlindedHop , BlindedPath , IntroductionNode , NodeIdLookUp } ;
18
18
use crate :: crypto:: streams:: ChaChaPolyReadAdapter ;
19
19
use crate :: io;
@@ -546,6 +546,10 @@ impl Readable for BlindedPaymentTlvs {
546
546
}
547
547
}
548
548
549
+ /// Represents the padding round off size (in bytes) that
550
+ /// is used to pad payment bilnded path's [`BlindedHop`]
551
+ pub ( crate ) const PAYMENT_PADDING_ROUND_OFF : usize = 30 ;
552
+
549
553
/// Construct blinded payment hops for the given `intermediate_nodes` and payee info.
550
554
pub ( super ) fn blinded_hops < T : secp256k1:: Signing + secp256k1:: Verification > (
551
555
secp_ctx : & Secp256k1 < T > , intermediate_nodes : & [ PaymentForwardNode ] , payee_node_id : PublicKey ,
@@ -558,7 +562,9 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
558
562
. map ( |node| BlindedPaymentTlvsRef :: Forward ( & node. tlvs ) )
559
563
. chain ( core:: iter:: once ( BlindedPaymentTlvsRef :: Receive ( & payee_tlvs) ) ) ;
560
564
561
- let path = pks. zip ( tlvs) ;
565
+ let path = pks. zip (
566
+ tlvs. map ( |tlv| BlindedPathWithPadding { tlvs : tlv, round_off : PAYMENT_PADDING_ROUND_OFF } ) ,
567
+ ) ;
562
568
563
569
utils:: construct_blinded_hops ( secp_ctx, path, session_priv)
564
570
}
0 commit comments