#[non_exhaustive]pub enum LweKeyswitchKeyGenerationError<EngineError: Error> {
NullDecompositionBaseLog,
NullDecompositionLevelCount,
DecompositionTooLarge,
Engine(EngineError),
}Expand description
An error used with the LweKeyswitchKeyGenerationEngine trait.
This type provides a
LweKeyswitchKeyGenerationError::perform_generic_checks
function that does error checking for the general cases, returning an Ok(())
if the inputs are valid, meaning that engine implementors would then only
need to check for their own specific errors.
Otherwise an Err(..) with the proper error variant is returned.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NullDecompositionBaseLog
Generic error: The key decomposition base log must be greater than zero.
NullDecompositionLevelCount
Generic error: The key decomposition level count must be greater than zero.
DecompositionTooLarge
Generic error: The decomposition precision (base log * level count) must not exceed the precision of the ciphertext.
Engine(EngineError)
Specific error to the implementing engine.
Implementations§
Source§impl<EngineError: Error> LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: Error> LweKeyswitchKeyGenerationError<EngineError>
Sourcepub fn perform_generic_checks(
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
ciphertext_modulus_log: usize,
) -> Result<(), Self>
pub fn perform_generic_checks( decomposition_level_count: DecompositionLevelCount, decomposition_base_log: DecompositionBaseLog, ciphertext_modulus_log: usize, ) -> Result<(), Self>
Validates the inputs
Trait Implementations§
Source§impl<EngineError: Clone + Error> Clone for LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: Clone + Error> Clone for LweKeyswitchKeyGenerationError<EngineError>
Source§fn clone(&self) -> LweKeyswitchKeyGenerationError<EngineError>
fn clone(&self) -> LweKeyswitchKeyGenerationError<EngineError>
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<EngineError: Error> Display for LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: Error> Display for LweKeyswitchKeyGenerationError<EngineError>
Source§impl<EngineError: Error> Error for LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: Error> Error for LweKeyswitchKeyGenerationError<EngineError>
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<EngineError: PartialEq + Error> PartialEq for LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: PartialEq + Error> PartialEq for LweKeyswitchKeyGenerationError<EngineError>
Source§fn eq(&self, other: &LweKeyswitchKeyGenerationError<EngineError>) -> bool
fn eq(&self, other: &LweKeyswitchKeyGenerationError<EngineError>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<EngineError: Eq + Error> Eq for LweKeyswitchKeyGenerationError<EngineError>
impl<EngineError: Error> StructuralPartialEq for LweKeyswitchKeyGenerationError<EngineError>
Auto Trait Implementations§
impl<EngineError> Freeze for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: Freeze,
impl<EngineError> RefUnwindSafe for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: RefUnwindSafe,
impl<EngineError> Send for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: Send,
impl<EngineError> Sync for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: Sync,
impl<EngineError> Unpin for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: Unpin,
impl<EngineError> UnwindSafe for LweKeyswitchKeyGenerationError<EngineError>where
EngineError: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more