File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -189,16 +189,14 @@ mod inbound_payment {
189
189
Ok ( metadata_bytes)
190
190
}
191
191
192
- fn construct_payment_secret ( iv_bytes : & [ u8 ; IV_LEN ] , metadata_bytes : & [ u8 ] , metadata_key : & [ u8 ; METADATA_KEY_LEN ] ) -> PaymentSecret {
192
+ fn construct_payment_secret ( iv_bytes : & [ u8 ; IV_LEN ] , metadata_bytes : & [ u8 ; METADATA_LEN ] , metadata_key : & [ u8 ; METADATA_KEY_LEN ] ) -> PaymentSecret {
193
193
let mut payment_secret_bytes: [ u8 ; 32 ] = [ 0 ; 32 ] ;
194
- {
195
- let ( iv_slice, encrypted_metadata_slice) = payment_secret_bytes. split_at_mut ( IV_LEN ) ;
196
- iv_slice. copy_from_slice ( iv_bytes) ;
194
+ let ( iv_slice, encrypted_metadata_slice) = payment_secret_bytes. split_at_mut ( IV_LEN ) ;
195
+ iv_slice. copy_from_slice ( iv_bytes) ;
197
196
198
- let chacha_block = ChaCha20 :: get_single_block ( metadata_key, iv_bytes) ;
199
- for i in 0 ..METADATA_LEN {
200
- encrypted_metadata_slice[ i] = chacha_block[ i] ^ metadata_bytes[ i] ;
201
- }
197
+ let chacha_block = ChaCha20 :: get_single_block ( metadata_key, iv_bytes) ;
198
+ for i in 0 ..METADATA_LEN {
199
+ encrypted_metadata_slice[ i] = chacha_block[ i] ^ metadata_bytes[ i] ;
202
200
}
203
201
PaymentSecret ( payment_secret_bytes)
204
202
}
You can’t perform that action at this time.
0 commit comments