#[non_exhaustive]pub enum KyberLibError {
InvalidInput,
InvalidKey,
InvalidLength,
Decapsulation,
RandomBytesGeneration,
FipsModeUnavailable,
}Expand description
Error types for the failure modes in kyberlib.
Marked #[non_exhaustive] (since v0.0.7, #130) so future variants
— e.g. backend-specific errors from the planned fips (#170) and
verified (#171) features — can be added without a major-version
bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidInput
One or more inputs to a function are incorrectly sized. A likely cause of this is two parties using different security levels while trying to negotiate a key exchange.
InvalidKey
Error when generating keys
InvalidLength
The length of the input buffer is invalid.
Decapsulation
The ciphertext was unable to be authenticated. The shared secret was not decapsulated.
RandomBytesGeneration
Error trying to fill random bytes (i.e., external (hardware) RNG modules can fail).
The fips feature is on but the AWS-LC module is not running in
FIPS mode (see kyberlib::fips::fips_mode).
Trait Implementations§
Source§impl Clone for KyberLibError
impl Clone for KyberLibError
Source§fn clone(&self) -> KyberLibError
fn clone(&self) -> KyberLibError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for KyberLibError
Source§impl Debug for KyberLibError
impl Debug for KyberLibError
Source§impl Display for KyberLibError
impl Display for KyberLibError
impl Eq for KyberLibError
Source§impl Error for KyberLibError
Available on crate feature std only.
impl Error for KyberLibError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()