#[non_exhaustive]pub enum LweCiphertextDiscardingBitExtractError<EngineError: Error> {
InputLweDimensionMismatch,
InputKeyswitchKeyLweDimensionMismatch,
OutputLweDimensionMismatch,
ExtractedBitsCountMismatch,
KeyDimensionMismatch,
NotEnoughBitsToExtract,
Engine(EngineError),
}Expand description
An error used with the LweCiphertextDiscardingBitExtractEngine trait.
This type provides a
LweCiphertextDiscardingBitExtractError::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
InputLweDimensionMismatch
Generic error: The input ciphertext and bootstrap key LWE dimension must be the same.
InputKeyswitchKeyLweDimensionMismatch
Generic error: The input ciphertext LWE dimension must be the same as the keyswitch key input LWE dimension.
OutputLweDimensionMismatch
Generic error: The output ciphertext vector LWE dimension must be the same as the output LWE dimension of the keyswitch key.
ExtractedBitsCountMismatch
Generic error: The output LWE ciphertext vector count must be the same as the number of bits to extract.
KeyDimensionMismatch
Generic error: The keyswitch key output LWE dimension must be the same as the bootstrap key input LWE dimension.
NotEnoughBitsToExtract
Generic error: The number of bits to extract, starting from the bit at index delta_log towards the most significant bits, should not exceed the total number of available bits in the ciphertext.
Engine(EngineError)
Specific error to the implementing engine.
Implementations§
Source§impl<EngineError: Error> LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Error> LweCiphertextDiscardingBitExtractError<EngineError>
Sourcepub fn perform_generic_checks<BootstrapKey, KeyswitchKey, InputCiphertext, OutputCiphertextVector>(
output: &OutputCiphertextVector,
input: &InputCiphertext,
bsk: &BootstrapKey,
ksk: &KeyswitchKey,
extracted_bits_count: ExtractedBitsCount,
ciphertext_modulus_log: CiphertextModulusLog,
delta_log: DeltaLog,
) -> Result<(), Self>where
BootstrapKey: LweBootstrapKeyEntity,
KeyswitchKey: LweKeyswitchKeyEntity,
InputCiphertext: LweCiphertextEntity,
OutputCiphertextVector: LweCiphertextVectorEntity,
pub fn perform_generic_checks<BootstrapKey, KeyswitchKey, InputCiphertext, OutputCiphertextVector>(
output: &OutputCiphertextVector,
input: &InputCiphertext,
bsk: &BootstrapKey,
ksk: &KeyswitchKey,
extracted_bits_count: ExtractedBitsCount,
ciphertext_modulus_log: CiphertextModulusLog,
delta_log: DeltaLog,
) -> Result<(), Self>where
BootstrapKey: LweBootstrapKeyEntity,
KeyswitchKey: LweKeyswitchKeyEntity,
InputCiphertext: LweCiphertextEntity,
OutputCiphertextVector: LweCiphertextVectorEntity,
Validates the inputs
Trait Implementations§
Source§impl<EngineError: Clone + Error> Clone for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Clone + Error> Clone for LweCiphertextDiscardingBitExtractError<EngineError>
Source§fn clone(&self) -> LweCiphertextDiscardingBitExtractError<EngineError>
fn clone(&self) -> LweCiphertextDiscardingBitExtractError<EngineError>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<EngineError: Debug + Error> Debug for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Debug + Error> Debug for LweCiphertextDiscardingBitExtractError<EngineError>
Source§impl<EngineError: Error> Display for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Error> Display for LweCiphertextDiscardingBitExtractError<EngineError>
Source§impl<EngineError: Error> Error for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Error> Error for LweCiphertextDiscardingBitExtractError<EngineError>
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
Source§impl<EngineError: PartialEq + Error> PartialEq for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: PartialEq + Error> PartialEq for LweCiphertextDiscardingBitExtractError<EngineError>
Source§fn eq(
&self,
other: &LweCiphertextDiscardingBitExtractError<EngineError>,
) -> bool
fn eq( &self, other: &LweCiphertextDiscardingBitExtractError<EngineError>, ) -> bool
self and other values to be equal, and is used by ==.impl<EngineError: Eq + Error> Eq for LweCiphertextDiscardingBitExtractError<EngineError>
impl<EngineError: Error> StructuralPartialEq for LweCiphertextDiscardingBitExtractError<EngineError>
Auto Trait Implementations§
impl<EngineError> Freeze for LweCiphertextDiscardingBitExtractError<EngineError>where
EngineError: Freeze,
impl<EngineError> RefUnwindSafe for LweCiphertextDiscardingBitExtractError<EngineError>where
EngineError: RefUnwindSafe,
impl<EngineError> Send for LweCiphertextDiscardingBitExtractError<EngineError>where
EngineError: Send,
impl<EngineError> Sync for LweCiphertextDiscardingBitExtractError<EngineError>where
EngineError: Sync,
impl<EngineError> Unpin for LweCiphertextDiscardingBitExtractError<EngineError>where
EngineError: Unpin,
impl<EngineError> UnwindSafe for LweCiphertextDiscardingBitExtractError<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
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>
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>
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