Skip to content

Commit

Permalink
More things I missed
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Oct 17, 2024
1 parent e86fe7c commit 905a91e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion libcrux-ml-kem/src/ind_cca/instantiations/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub(crate) fn kyber_generate_keypair<
randomness: [u8; KEY_GENERATION_SEED_SIZE],
) -> MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE> {
unsafe {
kyber_generate_keypair::<
kyber_generate_keypair_avx2::<
K,
CPA_PRIVATE_KEY_SIZE,
PRIVATE_KEY_SIZE,
Expand Down
13 changes: 0 additions & 13 deletions libcrux-ml-kem/src/mlkem512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ macro_rules! instantiate {
pub fn kyber_generate_key_pair(
randomness: [u8; KEY_GENERATION_SEED_SIZE],
) -> MlKem512KeyPair {
#[allow(unused_unsafe)]
unsafe {
p::kyber_generate_keypair::<
RANK_512,
CPA_PKE_SECRET_KEY_SIZE_512,
Expand All @@ -110,7 +108,6 @@ macro_rules! instantiate {
ETA1,
ETA1_RANDOMNESS_SIZE,
>(randomness)
}
}
/// Encapsulate ML-KEM 512
///
Expand Down Expand Up @@ -152,8 +149,6 @@ macro_rules! instantiate {
public_key: &MlKem512PublicKey,
randomness: [u8; SHARED_SECRET_SIZE],
) -> (MlKem512Ciphertext, MlKemSharedSecret) {
#[allow(unused_unsafe)]
unsafe {
p::kyber_encapsulate::<
RANK_512,
CPA_PKE_CIPHERTEXT_SIZE_512,
Expand All @@ -169,7 +164,6 @@ macro_rules! instantiate {
ETA2,
ETA2_RANDOMNESS_SIZE,
>(public_key, randomness)
}
}

/// Decapsulate ML-KEM 512
Expand All @@ -180,8 +174,6 @@ macro_rules! instantiate {
private_key: &MlKem512PrivateKey,
ciphertext: &MlKem512Ciphertext,
) -> MlKemSharedSecret {
#[allow(unused_unsafe)]

p::decapsulate::<
RANK_512,
SECRET_KEY_SIZE_512,
Expand Down Expand Up @@ -269,24 +261,19 @@ macro_rules! instantiate {
public_key: &MlKem512PublicKey,
unpacked_public_key: &mut MlKem512PublicKeyUnpacked,
) {
#[allow(unused_unsafe)]

p::unpacked::unpack_public_key::<
RANK_512,
T_AS_NTT_ENCODED_SIZE_512,
RANKED_BYTES_PER_RING_ELEMENT_512,
CPA_PKE_PUBLIC_KEY_SIZE_512,
>(public_key, unpacked_public_key)

}

/// Generate ML-KEM 512 Key Pair in "unpacked" form
pub fn generate_key_pair(
randomness: [u8; KEY_GENERATION_SEED_SIZE],
key_pair: &mut MlKem512KeyPairUnpacked,
) {
#[allow(unused_unsafe)]

p::unpacked::generate_keypair::<
RANK_512,
CPA_PKE_SECRET_KEY_SIZE_512,
Expand Down

0 comments on commit 905a91e

Please sign in to comment.