diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-03-25 12:19:35 +0100 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-03-26 18:33:21 +0100 |
commit | 70a96487b25557c3b1ffcba4b61cc1140e76935a (patch) | |
tree | 3846c7680a75047b81fe3b8307da47d4a4b0c080 /openpgp/src/crypto | |
parent | 89337646884b59c894329432eea960be4b3e335e (diff) |
Remove redundant field names.
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r-- | openpgp/src/crypto/aead.rs | 16 | ||||
-rw-r--r-- | openpgp/src/crypto/asymmetric.rs | 4 | ||||
-rw-r--r-- | openpgp/src/crypto/hash.rs | 6 | ||||
-rw-r--r-- | openpgp/src/crypto/mpis.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/s2k.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/symmetric.rs | 12 |
6 files changed, 21 insertions, 21 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs index 03d5c995..a79c7767 100644 --- a/openpgp/src/crypto/aead.rs +++ b/openpgp/src/crypto/aead.rs @@ -133,9 +133,9 @@ impl<'a> Decryptor<'a> { -> Result<Self> { Ok(Decryptor { - source: source, - sym_algo: sym_algo, - aead: aead, + source, + sym_algo, + aead, key: key.clone(), iv: Vec::from(iv).into_boxed_slice(), ad: [ @@ -148,7 +148,7 @@ impl<'a> Decryptor<'a> { 0, 0, 0, 0, 0, 0, 0, 0, ], digest_size: aead.digest_size()?, - chunk_size: chunk_size, + chunk_size, chunk_index: 0, bytes_decrypted: 0, buffer: Vec::with_capacity(chunk_size), @@ -551,8 +551,8 @@ impl<W: io::Write> Encryptor<W> { Ok(Encryptor { inner: Some(sink), - sym_algo: sym_algo, - aead: aead, + sym_algo, + aead, key: key.clone(), iv: Vec::from(iv).into_boxed_slice(), ad: [ @@ -565,11 +565,11 @@ impl<W: io::Write> Encryptor<W> { 0, 0, 0, 0, 0, 0, 0, 0, ], digest_size: aead.digest_size()?, - chunk_size: chunk_size, + chunk_size, chunk_index: 0, bytes_encrypted: 0, buffer: Vec::with_capacity(chunk_size), - scratch: scratch, + scratch, }) } diff --git a/openpgp/src/crypto/asymmetric.rs b/openpgp/src/crypto/asymmetric.rs index b39100e2..46e77f8d 100644 --- a/openpgp/src/crypto/asymmetric.rs +++ b/openpgp/src/crypto/asymmetric.rs @@ -73,8 +73,8 @@ impl KeyPair { -> Result<Self> { Ok(Self { - public: public, - secret: secret, + public, + secret, }) } diff --git a/openpgp/src/crypto/hash.rs b/openpgp/src/crypto/hash.rs index 87d89b34..fa15c462 100644 --- a/openpgp/src/crypto/hash.rs +++ b/openpgp/src/crypto/hash.rs @@ -167,9 +167,9 @@ impl HashDumper { }; eprintln!("HashDumper: Writing to {}...", &filename); HashDumper { - h: h, - sink: sink, - filename: filename, + h, + sink, + filename, written: 0, } } diff --git a/openpgp/src/crypto/mpis.rs b/openpgp/src/crypto/mpis.rs index 51374016..a23cc64f 100644 --- a/openpgp/src/crypto/mpis.rs +++ b/openpgp/src/crypto/mpis.rs @@ -49,7 +49,7 @@ impl MPI { let value = Vec::from(&value[offset..]).into_boxed_slice(); MPI { - value: value, + value, } } diff --git a/openpgp/src/crypto/s2k.rs b/openpgp/src/crypto/s2k.rs index d738a37d..8dff4693 100644 --- a/openpgp/src/crypto/s2k.rs +++ b/openpgp/src/crypto/s2k.rs @@ -64,7 +64,7 @@ impl Default for S2K { // SHA2-512. Furthermore, the digest size is large enough // for every cipher algorithm currently in use. hash: HashAlgorithm::SHA256, - salt: salt, + salt, // This is the largest count that OpenPGP can represent. // On moderate machines, like my Intel(R) Core(TM) i5-2400 // CPU @ 3.10GHz, it takes ~354ms to derive a key. diff --git a/openpgp/src/crypto/symmetric.rs b/openpgp/src/crypto/symmetric.rs index 2499aa60..1b0f997b 100644 --- a/openpgp/src/crypto/symmetric.rs +++ b/openpgp/src/crypto/symmetric.rs @@ -147,9 +147,9 @@ impl<R: io::Read> Decryptor<R> { let block_size = algo.block_size()?; Ok(Decryptor { - source: source, - dec: dec, - block_size: block_size, + source, + dec, + block_size, iv: vec![0u8; block_size], buffer: Vec::with_capacity(block_size), }) @@ -415,11 +415,11 @@ impl<W: io::Write> Encryptor<W> { Ok(Encryptor { inner: Some(sink), - cipher: cipher, - block_size: block_size, + cipher, + block_size, iv: vec![0u8; block_size], buffer: Vec::with_capacity(block_size), - scratch: scratch, + scratch, }) } |