#[non_exhaustive]
pub enum LweToGlweSecretKeyTransformationError<EngineError: Error> {
IncompatibleLweDimension,
NullPolynomialSize,
SizeOnePolynomial,
Engine(EngineError),
}
Expand description
An error used with the LweToGlweSecretKeyTransformationEngine
trait.
This type provides a
LweToGlweSecretKeyTransformationError::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
IncompatibleLweDimension
Generic error: The input key LweDimension is not compatible with the provided PolynomialSize
NullPolynomialSize
Generic error: The output secret key polynomial size must be greater than zero.
SizeOnePolynomial
Generic error: The output secret key polynomial size must be greater than one. Otherwiseyou should prefer the LWE scheme.
Engine(EngineError)
Specific error to the implementing engine.
Implementations
sourceimpl<EngineError: Error> LweToGlweSecretKeyTransformationError<EngineError>
impl<EngineError: Error> LweToGlweSecretKeyTransformationError<EngineError>
sourcepub fn perform_generic_checks<InputKey>(
lwe_secret_key: &InputKey,
polynomial_size: PolynomialSize
) -> Result<(), Self>where
InputKey: LweSecretKeyEntity,
pub fn perform_generic_checks<InputKey>(
lwe_secret_key: &InputKey,
polynomial_size: PolynomialSize
) -> Result<(), Self>where
InputKey: LweSecretKeyEntity,
Validates the inputs
Trait Implementations
sourceimpl<EngineError: Clone + Error> Clone for LweToGlweSecretKeyTransformationError<EngineError>
impl<EngineError: Clone + Error> Clone for LweToGlweSecretKeyTransformationError<EngineError>
sourcefn clone(&self) -> LweToGlweSecretKeyTransformationError<EngineError>
fn clone(&self) -> LweToGlweSecretKeyTransformationError<EngineError>
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more