Skip to content

Commit

Permalink
Merge pull request #739 from cryspen/jonas/kyber-redundancy
Browse files Browse the repository at this point in the history
Remove redundant match arms
  • Loading branch information
franziskuskiefer authored Jan 14, 2025
2 parents 88fe3ab + 146086a commit 506666a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions libcrux-kem/src/kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,26 +850,6 @@ impl Ct {
ct_x.try_into().map_err(|_| Error::InvalidCiphertext)?,
))
}
#[cfg(feature = "kyber")]
Algorithm::X25519Kyber768Draft00 => {
let key: [u8; MlKem768Ciphertext::len() + 32] =
bytes.try_into().map_err(|_| Error::InvalidCiphertext)?;
let (xct, kct) = key.split_at(32);
Ok(Self::X25519Kyber768Draft00(
kct.try_into().map_err(|_| Error::InvalidCiphertext)?,
xct.try_into().map_err(|_| Error::InvalidCiphertext)?,
))
}
#[cfg(feature = "kyber")]
Algorithm::XWingKyberDraft02 => {
let key: [u8; MlKem768Ciphertext::len() + 32] =
bytes.try_into().map_err(|_| Error::InvalidCiphertext)?;
let (ct_m, ct_x) = key.split_at(MlKem768Ciphertext::len());
Ok(Self::XWingKyberDraft02(
ct_m.try_into().map_err(|_| Error::InvalidCiphertext)?,
ct_x.try_into().map_err(|_| Error::InvalidCiphertext)?,
))
}
Algorithm::MlKem1024 => bytes
.try_into()
.map_err(|_| Error::InvalidCiphertext)
Expand Down

0 comments on commit 506666a

Please sign in to comment.