From 75178bccde83851715d394fce24119adbe67587e Mon Sep 17 00:00:00 2001 From: karthikbhargavan Date: Mon, 1 Jul 2024 19:46:35 +0200 Subject: [PATCH] fmt --- libcrux-ml-kem/benches/ml-kem.rs | 36 +++++++++++++++++++++++++------ libcrux-ml-kem/tests/self.rs | 37 ++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/libcrux-ml-kem/benches/ml-kem.rs b/libcrux-ml-kem/benches/ml-kem.rs index 5eace9335..75ec7f6d3 100644 --- a/libcrux-ml-kem/benches/ml-kem.rs +++ b/libcrux-ml-kem/benches/ml-kem.rs @@ -20,7 +20,11 @@ pub fn comparisons_key_generation(c: &mut Criterion) { }) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd256"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd256" + ))] group.bench_function("libcrux avx2 unpacked (external random)", |b| { let mut seed = [0; 64]; rng.fill_bytes(&mut seed); @@ -29,7 +33,11 @@ pub fn comparisons_key_generation(c: &mut Criterion) { }) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd128"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd128" + ))] group.bench_function("libcrux neon unpacked (external random)", |b| { let mut seed = [0; 64]; rng.fill_bytes(&mut seed); @@ -107,7 +115,11 @@ pub fn comparisons_encapsulation(c: &mut Criterion) { ) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd128"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd128" + ))] group.bench_function("libcrux unpacked neon (external random)", |b| { let mut seed1 = [0; 64]; OsRng.fill_bytes(&mut seed1); @@ -126,7 +138,11 @@ pub fn comparisons_encapsulation(c: &mut Criterion) { ) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd256"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd256" + ))] group.bench_function("libcrux unpacked avx2 (external random)", |b| { let mut seed1 = [0; 64]; OsRng.fill_bytes(&mut seed1); @@ -193,7 +209,11 @@ pub fn comparisons_decapsulation(c: &mut Criterion) { ) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd128"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd128" + ))] group.bench_function("libcrux unpacked neon", |b| { let mut seed1 = [0; 64]; OsRng.fill_bytes(&mut seed1); @@ -216,7 +236,11 @@ pub fn comparisons_decapsulation(c: &mut Criterion) { ) }); - #[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd256"))] + #[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd256" + ))] group.bench_function("libcrux unpacked avx2", |b| { let mut seed1 = [0; 64]; OsRng.fill_bytes(&mut seed1); diff --git a/libcrux-ml-kem/tests/self.rs b/libcrux-ml-kem/tests/self.rs index 37d16d09a..baf1e410b 100644 --- a/libcrux-ml-kem/tests/self.rs +++ b/libcrux-ml-kem/tests/self.rs @@ -209,7 +209,6 @@ macro_rules! impl_modified_ciphertext_and_implicit_rejection_value { }; } - #[cfg(feature = "mlkem512")] impl_consistency!( consistency_512, @@ -242,7 +241,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem512::portable::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem512", feature = "pre-verification", feature = "simd128"))] +#[cfg(all( + feature = "mlkem512", + feature = "pre-verification", + feature = "simd128" +))] impl_consistency_unpacked!( consistency_unpacked_512_neon, libcrux_ml_kem::mlkem512::neon::generate_key_pair, @@ -252,7 +255,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem512::neon::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem512", feature = "pre-verification", feature = "simd256"))] +#[cfg(all( + feature = "mlkem512", + feature = "pre-verification", + feature = "simd256" +))] impl_consistency_unpacked!( consistency_unpacked_512_avx2, libcrux_ml_kem::mlkem512::avx2::generate_key_pair, @@ -272,7 +279,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem1024::portable::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem1024", feature = "pre-verification", feature = "simd128"))] +#[cfg(all( + feature = "mlkem1024", + feature = "pre-verification", + feature = "simd128" +))] impl_consistency_unpacked!( consistency_unpacked_1024_neon, libcrux_ml_kem::mlkem1024::neon::generate_key_pair, @@ -282,7 +293,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem1024::neon::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem1024", feature = "pre-verification", feature = "simd256"))] +#[cfg(all( + feature = "mlkem1024", + feature = "pre-verification", + feature = "simd256" +))] impl_consistency_unpacked!( consistency_unpacked_1024_avx2, libcrux_ml_kem::mlkem1024::avx2::generate_key_pair, @@ -302,7 +317,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem768::portable::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd128"))] +#[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd128" +))] impl_consistency_unpacked!( consistency_unpacked_768_neon, libcrux_ml_kem::mlkem768::neon::generate_key_pair, @@ -312,7 +331,11 @@ impl_consistency_unpacked!( libcrux_ml_kem::mlkem768::neon::decapsulate_unpacked ); -#[cfg(all(feature = "mlkem768", feature = "pre-verification", feature = "simd256"))] +#[cfg(all( + feature = "mlkem768", + feature = "pre-verification", + feature = "simd256" +))] impl_consistency_unpacked!( consistency_unpacked_768_avx2, libcrux_ml_kem::mlkem768::avx2::generate_key_pair,