cargo fmt

This commit is contained in:
Monica Moniot
2024-01-19 10:26:33 -05:00
parent c218cc3409
commit d20fec3194
4 changed files with 8 additions and 7 deletions
+7 -4
View File
@@ -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`.
-1
View File
@@ -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<const ENCRYPT: bool>(&self) -> bool {
+1 -1
View File
@@ -490,7 +490,7 @@ pub(crate) fn received_x1_trans<C: CryptoLayer, App: ApplicationLayer<C>>(
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));
}
}
-1
View File
@@ -395,7 +395,6 @@ fn main() {
core(60 * 60, packet_success_rate)
}
#[test]
fn test_50() {
core(10, u32::MAX / 2)