Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikbhargavan committed Jul 1, 2024
1 parent f592ce3 commit 75178bc
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 13 deletions.
36 changes: 30 additions & 6 deletions libcrux-ml-kem/benches/ml-kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
37 changes: 30 additions & 7 deletions libcrux-ml-kem/tests/self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ macro_rules! impl_modified_ciphertext_and_implicit_rejection_value {
};
}


#[cfg(feature = "mlkem512")]
impl_consistency!(
consistency_512,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 75178bc

Please sign in to comment.