Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Jun 27, 2024
1 parent 4b1d95a commit bd14f8d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions libcrux-ml-kem/tests/self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ pub mod default {
random_u32 >>= 8;

let position = if modify_implicit_rejection_value {
(MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE)
+ (random_u32 % SHARED_SECRET_SIZE)
(MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE) + (random_u32 % SHARED_SECRET_SIZE)
} else {
random_u32 % (MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE)
};
Expand All @@ -115,8 +114,7 @@ pub mod default {
ciphertext: MlKemCiphertext<CLEN>,
secret_key: MlKemPrivateKey<LEN>,
) -> [u8; SHARED_SECRET_SIZE] {
let mut to_hash =
secret_key[MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE..].to_vec();
let mut to_hash = secret_key[MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE..].to_vec();
to_hash.extend_from_slice(ciphertext.as_ref());

shake256(&to_hash)
Expand Down Expand Up @@ -345,8 +343,7 @@ pub mod pre_verification {
random_u32 >>= 8;

let position = if modify_implicit_rejection_value {
(MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE)
+ (random_u32 % SHARED_SECRET_SIZE)
(MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE) + (random_u32 % SHARED_SECRET_SIZE)
} else {
random_u32 % (MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE)
};
Expand All @@ -360,8 +357,7 @@ pub mod pre_verification {
ciphertext: MlKemCiphertext<CLEN>,
secret_key: MlKemPrivateKey<LEN>,
) -> [u8; SHARED_SECRET_SIZE] {
let mut to_hash =
secret_key[MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE..].to_vec();
let mut to_hash = secret_key[MlKemPrivateKey::<LEN>::len() - SHARED_SECRET_SIZE..].to_vec();
to_hash.extend_from_slice(ciphertext.as_ref());

shake256(&to_hash)
Expand Down

0 comments on commit bd14f8d

Please sign in to comment.