Skip to content

Commit

Permalink
avx2 and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Jan 29, 2025
1 parent 541cb90 commit f1b003b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 761 deletions.
11 changes: 9 additions & 2 deletions libcrux-ml-kem/src/ind_cca/incremental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
ind_cpa::{self, unpacked::IndCpaPrivateKeyUnpacked},
matrix::sample_matrix_A,
mlkem::impl_incr_platform,
polynomial::{vec_len_bytes, PolynomialRingElement, VECTORS_IN_RING_ELEMENT},
polynomial::{vec_len_bytes, PolynomialRingElement},
utils::into_padded_array,
variant, SHARED_SECRET_SIZE,
};
Expand All @@ -28,7 +28,14 @@ pub(crate) use types::*;
// Platform instantiations

#[cfg(feature = "simd256")]
pub(crate) mod avx2;
pub(crate) mod avx2 {
use super::*;

impl_incr_platform!(
crate::vector::SIMD256Vector,
crate::hash_functions::avx2::Simd256Hash
);
}
#[cfg(feature = "simd128")]
pub(crate) mod neon {
use super::*;
Expand Down
241 changes: 0 additions & 241 deletions libcrux-ml-kem/src/ind_cca/incremental/avx2.rs

This file was deleted.

4 changes: 3 additions & 1 deletion libcrux-ml-kem/src/ind_cca/incremental/multiplexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ use super::*;

#[cfg(feature = "simd256")]
use avx2::{
as_avx2_keypair, as_avx2_state, decapsulate as decapsulate_avx2,
as_keypair as as_avx2_keypair, as_state as as_avx2_state, decapsulate as decapsulate_avx2,
decapsulate_incremental_key as decapsulate_incremental_key_avx2,
encapsulate1 as encapsulate1_avx2, encapsulate1_serialized as encapsulate1_serialized_avx2,
encapsulate2 as encapsulate2_avx2, encapsulate2_serialized as encapsulate2_serialized_avx2,
generate_keypair as generate_keypair_avx2,
generate_keypair_serialized as generate_keypair_serialized_avx2,
validate_pk as validate_pk_avx2,
};

#[cfg(feature = "simd128")]
Expand Down Expand Up @@ -40,6 +41,7 @@ use portable::{
encapsulate2 as encapsulate2_neon, encapsulate2_serialized as encapsulate2_serialized_neon,
generate_keypair as generate_keypair_neon,
generate_keypair_serialized as generate_keypair_serialized_neon,
validate_pk as validate_pk_neon,
};

/// Functions in this module require an allocator to use [`Box`].
Expand Down
Loading

0 comments on commit f1b003b

Please sign in to comment.