#[non_exhaustive]
pub enum GlweCiphertextCreationError<EngineError: Error> {
EmptyContainer,
InvalidContainerSize,
Engine(EngineError),
}
Expand description
An error used with the GlweCiphertextCreationEngine
trait.
This type provides a
GlweCiphertextCreationError::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
EmptyContainer
Generic error: The container used to create the GLWE ciphertext is of length 0!
InvalidContainerSize
Generic error:
The length of the container used to create the GLWE ciphertext needs to be a multiple of polynomial_size
.
Engine(EngineError)
Specific error to the implementing engine.
Implementations
sourceimpl<EngineError: Error> GlweCiphertextCreationError<EngineError>
impl<EngineError: Error> GlweCiphertextCreationError<EngineError>
sourcepub fn perform_generic_checks(
container_length: usize,
polynomial_size: PolynomialSize
) -> Result<(), Self>
pub fn perform_generic_checks(
container_length: usize,
polynomial_size: PolynomialSize
) -> Result<(), Self>
Validates the inputs, the container is expected to have a length of glwe_size * polynomial_size, during construction we only get the container and the polynomial size so we check the length is consistent, the GLWE size is deduced by the ciphertext implementation from the container and the polynomial size.
Trait Implementations
sourceimpl<EngineError: Clone + Error> Clone for GlweCiphertextCreationError<EngineError>
impl<EngineError: Clone + Error> Clone for GlweCiphertextCreationError<EngineError>
sourcefn clone(&self) -> GlweCiphertextCreationError<EngineError>
fn clone(&self) -> GlweCiphertextCreationError<EngineError>
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more