Skip to content

Commit

Permalink
kem: Made Saber decap infallible too
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Jun 24, 2024
1 parent 95fba5a commit 16cbfc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kem/tests/saber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ impl Encapsulate<SaberEncappedKey, SaberSharedSecret> for SaberPublicKey {
}

impl Decapsulate<SaberEncappedKey, SaberSharedSecret> for SaberPrivateKey {
// TODO: Decapsulation is infallible. Make this the never type once it's available
type Error = ();
type Error = Infallible;

fn decapsulate(&self, ek: &SaberEncappedKey) -> Result<SaberSharedSecret, ()> {
fn decapsulate(&self, ek: &SaberEncappedKey) -> Result<SaberSharedSecret, Infallible> {
Ok(decapsulate(ek, &self.0))
}
}
Expand Down

0 comments on commit 16cbfc1

Please sign in to comment.