pub enum MlKemError {
RngFailure,
InvalidEncapsulationKey,
InvalidDecapsulationKey,
InvalidCiphertext,
}Expand description
Errors returned by ML-KEM operations.
All error variants are designed to avoid leaking secret information; timing is independent of the specific failure path.
Variants§
RngFailure
The cryptographic random number generator failed to produce bytes.
This typically indicates a system-level failure (e.g., /dev/urandom
is unavailable).
InvalidEncapsulationKey
The provided encapsulation (public) key has an invalid length or fails the modulus check required by FIPS 203 Section 7.2.
InvalidDecapsulationKey
The provided decapsulation (private) key has an invalid length or
fails the H(ek) integrity check embedded in the key.
This may indicate storage corruption or fault injection.
InvalidCiphertext
The provided ciphertext has an invalid length for the parameter set.
Trait Implementations§
Source§impl Clone for MlKemError
impl Clone for MlKemError
Source§fn clone(&self) -> MlKemError
fn clone(&self) -> MlKemError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MlKemError
impl Debug for MlKemError
Source§impl Display for MlKemError
impl Display for MlKemError
Source§impl Error for MlKemError
Available on crate feature std only.
impl Error for MlKemError
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for MlKemError
impl PartialEq for MlKemError
impl Copy for MlKemError
impl Eq for MlKemError
impl StructuralPartialEq for MlKemError
Auto Trait Implementations§
impl Freeze for MlKemError
impl RefUnwindSafe for MlKemError
impl Send for MlKemError
impl Sync for MlKemError
impl Unpin for MlKemError
impl UnsafeUnpin for MlKemError
impl UnwindSafe for MlKemError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more