mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 22:01:34 +00:00
Fix some rustc/clippy warnings. (#895)
This commit is contained in:
@ -102,7 +102,7 @@ where
|
||||
|
||||
if !self.nonce.is_empty() {
|
||||
let n = min(data_buf.len(), self.nonce.len());
|
||||
if &data_buf[.. n] != &self.nonce[.. n] {
|
||||
if data_buf[.. n] != self.nonce[.. n] {
|
||||
return Err(SecioError::NonceVerificationFailed)
|
||||
}
|
||||
self.nonce.drain(.. n);
|
||||
|
@ -549,7 +549,7 @@ where
|
||||
let (encoding_cipher, encoding_hmac) = {
|
||||
let (iv, rest) = local_infos.split_at(iv_size);
|
||||
let (cipher_key, mac_key) = rest.split_at(cipher_key_size);
|
||||
let hmac = Hmac::from_key(context.state.remote.chosen_hash.into(), mac_key);
|
||||
let hmac = Hmac::from_key(context.state.remote.chosen_hash, mac_key);
|
||||
let cipher = ctr(chosen_cipher, cipher_key, iv);
|
||||
(cipher, hmac)
|
||||
};
|
||||
@ -557,7 +557,7 @@ where
|
||||
let (decoding_cipher, decoding_hmac) = {
|
||||
let (iv, rest) = remote_infos.split_at(iv_size);
|
||||
let (cipher_key, mac_key) = rest.split_at(cipher_key_size);
|
||||
let hmac = Hmac::from_key(context.state.remote.chosen_hash.into(), mac_key);
|
||||
let hmac = Hmac::from_key(context.state.remote.chosen_hash, mac_key);
|
||||
let cipher = ctr(chosen_cipher, cipher_key, iv);
|
||||
(cipher, hmac)
|
||||
};
|
||||
|
Reference in New Issue
Block a user