pub trait LweKeyswitchKeyCreationEngine<InputSecretKey, OutputSecretKey, KeyswitchKey>: AbstractEngine where
InputSecretKey: LweSecretKeyEntity,
OutputSecretKey: LweSecretKeyEntity,
KeyswitchKey: LweKeyswitchKeyEntity<InputKeyDistribution = InputSecretKey::KeyDistribution, OutputKeyDistribution = OutputSecretKey::KeyDistribution>, {
fn create_lwe_keyswitch_key(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> Result<KeyswitchKey, LweKeyswitchKeyCreationError<Self::EngineError>>;
unsafe fn create_lwe_keyswitch_key_unchecked(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> KeyswitchKey;
}
Expand description
A trait for engines creating LWE keyswitch keys.
Semantics
This pure operation creates an LWE keyswitch key allowing to
switch from the input_key
LWE secret key to the output_key
LWE secret key.
Formal Definition
cf here
Required Methods
fn create_lwe_keyswitch_key(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> Result<KeyswitchKey, LweKeyswitchKeyCreationError<Self::EngineError>>
fn create_lwe_keyswitch_key(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> Result<KeyswitchKey, LweKeyswitchKeyCreationError<Self::EngineError>>
Creates an LWE keyswitch key.
unsafe fn create_lwe_keyswitch_key_unchecked(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> KeyswitchKey
unsafe fn create_lwe_keyswitch_key_unchecked(
&mut self,
input_key: &InputSecretKey,
output_key: &OutputSecretKey,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: Variance
) -> KeyswitchKey
Unsafely creates an LWE keyswitch key.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweKeyswitchKeyCreationError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl LweKeyswitchKeyCreationEngine<LweSecretKey32, LweSecretKey32, LweKeyswitchKey32> for DefaultEngine
Description:
Implementation of LweKeyswitchKeyCreationEngine
for DefaultEngine
that
operates on 32 bits integers.
impl LweKeyswitchKeyCreationEngine<LweSecretKey64, LweSecretKey64, LweKeyswitchKey64> for DefaultEngine
Description:
Implementation of LweKeyswitchKeyCreationEngine
for DefaultEngine
that
operates on 64 bits integers.