From d20fec3194fac9bcaa6d17a830bb899d854da68e Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Fri, 19 Jan 2024 10:26:33 -0500 Subject: [PATCH] cargo fmt --- performance/src/crypto/aes.rs | 11 +++++++---- performance/src/crypto_impl/openssl.rs | 1 - performance/src/zeta.rs | 2 +- reference/examples/extensive_test.rs | 1 - 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/performance/src/crypto/aes.rs b/performance/src/crypto/aes.rs index 96a06cc..7fc91fe 100644 --- a/performance/src/crypto/aes.rs +++ b/performance/src/crypto/aes.rs @@ -47,7 +47,6 @@ pub trait Aes256Dec: Sized + Send + Sync { fn decrypt_in_place(&self, block: &mut [u8; AES_256_BLOCK_SIZE]); } - /// A trait for implementing AES-GCM-256 in a way that allows for extremely high throughput. /// One instance of this trait is created whenever a new pair of noise keys are created, /// and it handles all data encryption and decryption that passes through that session. @@ -62,12 +61,16 @@ pub trait HighThroughputAesGcmPool: Send + Sync { /// AES-GCM Authenticated Encryption. /// It should be set to whatever object, struct, handle or pointer your chosen library /// uses for its stream encryption API. - type EncContext<'a> where Self: 'a; + type EncContext<'a> + where + Self: 'a; /// This type represents the state needed to stream a single ciphertext for /// AES-GCM Authenticated Decryption. /// It should be set to whatever object, struct, handle or pointer your chosen library /// uses for its stream decryption API. - type DecContext<'a> where Self: 'a; + type DecContext<'a> + where + Self: 'a; /// Create a new instance of this trait. /// `encrypt_key` must be used as the encryption key. @@ -90,7 +93,7 @@ pub trait HighThroughputAesGcmPool: Send + Sync { /// /// Be sure to update the internal state of `enc` so the authentication tag can be correctly /// computed. - fn encrypt<'a>(&'a self, enc: &mut Self::EncContext<'a> , input: &[u8], output: &mut [u8]); + fn encrypt<'a>(&'a self, enc: &mut Self::EncContext<'a>, input: &[u8], output: &mut [u8]); /// Stream-decrypt `data` using the specified encryption context `dec`. /// The resulting plaintext should be written back into `data`. diff --git a/performance/src/crypto_impl/openssl.rs b/performance/src/crypto_impl/openssl.rs index 546bc54..37ef12c 100644 --- a/performance/src/crypto_impl/openssl.rs +++ b/performance/src/crypto_impl/openssl.rs @@ -69,7 +69,6 @@ impl OpenSSLCtx { ) > 0 } - /// Finish encryption or decryption. /// If performing decryption this will return whether the set tag is correct. pub unsafe fn finalize(&self) -> bool { diff --git a/performance/src/zeta.rs b/performance/src/zeta.rs index 2cf58da..bd8f7d2 100644 --- a/performance/src/zeta.rs +++ b/performance/src/zeta.rs @@ -490,7 +490,7 @@ pub(crate) fn received_x1_trans>( Err(e) => return Err(ReceiveError::StorageError(e)), } } - if ratchet_state.is_none() && app.hello_requires_recognized_ratchet() { + if ratchet_state.is_none() && app.hello_requires_recognized_ratchet() { return Err(fault!(FailedAuth, true)); } } diff --git a/reference/examples/extensive_test.rs b/reference/examples/extensive_test.rs index 45abac5..4d66619 100644 --- a/reference/examples/extensive_test.rs +++ b/reference/examples/extensive_test.rs @@ -395,7 +395,6 @@ fn main() { core(60 * 60, packet_success_rate) } - #[test] fn test_50() { core(10, u32::MAX / 2)