mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 14:28:37 +00:00
Rust 1.54.0 lints (#2483)
## Issue Addressed N/A ## Proposed Changes - Removing a bunch of unnecessary references - Updated `Error::VariantError` to `Error::Variant` - There were additional enum variant lints that I ignored, because I thought our variant names were fine - removed `MonitoredValidator`'s `pubkey` field, because I couldn't find it used anywhere. It looks like we just use the string version of the pubkey (the `id` field) if there is no index ## Additional Info Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -377,7 +377,7 @@ pub fn encrypt(
|
||||
|
||||
password.retain(|c| !is_control_character(c));
|
||||
|
||||
let derived_key = derive_key(&password.as_ref(), &kdf)?;
|
||||
let derived_key = derive_key(password.as_ref(), kdf)?;
|
||||
|
||||
// Encrypt secret.
|
||||
let mut cipher_text = plain_text.to_vec();
|
||||
@@ -389,7 +389,7 @@ pub fn encrypt(
|
||||
// AES Encrypt
|
||||
let key = GenericArray::from_slice(&derived_key.as_bytes()[0..16]);
|
||||
let nonce = GenericArray::from_slice(params.iv.as_bytes());
|
||||
let mut cipher = AesCtr::new(&key, &nonce);
|
||||
let mut cipher = AesCtr::new(key, nonce);
|
||||
cipher.apply_keystream(&mut cipher_text);
|
||||
}
|
||||
};
|
||||
@@ -435,7 +435,7 @@ pub fn decrypt(password: &[u8], crypto: &Crypto) -> Result<PlainText, Error> {
|
||||
// AES Decrypt
|
||||
let key = GenericArray::from_slice(&derived_key.as_bytes()[0..16]);
|
||||
let nonce = GenericArray::from_slice(params.iv.as_bytes());
|
||||
let mut cipher = AesCtr::new(&key, &nonce);
|
||||
let mut cipher = AesCtr::new(key, nonce);
|
||||
cipher.apply_keystream(plain_text.as_mut_bytes());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user