File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ impl<const LEN_SIZE: usize> NoiseEncryptor<LEN_SIZE> {
111
111
let mut ciphertext = vec ! [
112
112
0u8 ;
113
113
Self :: TAGGED_MESSAGE_LENGTH_HEADER_SIZE
114
- + length as usize
114
+ + length
115
115
+ chacha:: TAG_SIZE
116
116
] ;
117
117
@@ -373,7 +373,7 @@ impl<const LEN_SIZE: usize> NoiseTranscoder<LEN_SIZE> {
373
373
let ( act, h) = handshake. next ( & data) ?;
374
374
handshake = h;
375
375
if let Some ( ref act) = act {
376
- connection. as_sender ( ) . send_raw ( & * act) ?;
376
+ connection. as_sender ( ) . send_raw ( act) ?;
377
377
if let HandshakeState :: Complete ( transcoder) = handshake {
378
378
break Ok ( transcoder) ;
379
379
}
@@ -404,7 +404,7 @@ impl<const LEN_SIZE: usize> NoiseTranscoder<LEN_SIZE> {
404
404
break Ok ( transcoder) ;
405
405
}
406
406
if let Some ( act) = act {
407
- connection. as_sender ( ) . send_raw ( & * act) ?;
407
+ connection. as_sender ( ) . send_raw ( & act) ?;
408
408
data =
409
409
connection. as_receiver ( ) . recv_raw ( handshake. data_len ( ) ) ?;
410
410
}
Original file line number Diff line number Diff line change @@ -208,8 +208,7 @@ fn recv_noise_message<const LEN_SIZE: usize>(
208
208
decrypt. decrypt ( encrypted_len) ?;
209
209
let len = decrypt. pending_message_len ( ) . ok_or ( Error :: NoNoiseHeader ) ?;
210
210
// Reading & decrypting payload
211
- let encrypted_payload =
212
- reader. recv_raw ( len as usize + noise:: chacha:: TAG_SIZE ) ?;
211
+ let encrypted_payload = reader. recv_raw ( len + noise:: chacha:: TAG_SIZE ) ?;
213
212
let payload = decrypt. decrypt ( encrypted_payload) ?;
214
213
Ok ( payload)
215
214
}
You can’t perform that action at this time.
0 commit comments