pub trait LweCiphertextDiscardingKeyswitchEngine<KeyswitchKey, InputCiphertext, OutputCiphertext>: AbstractEngine where
KeyswitchKey: LweKeyswitchKeyEntity,
InputCiphertext: LweCiphertextEntity<KeyDistribution = KeyswitchKey::InputKeyDistribution>,
OutputCiphertext: LweCiphertextEntity<KeyDistribution = KeyswitchKey::OutputKeyDistribution>, {
fn discard_keyswitch_lwe_ciphertext(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
) -> Result<(), LweCiphertextDiscardingKeyswitchError<Self::EngineError>>;
unsafe fn discard_keyswitch_lwe_ciphertext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
);
}
Expand description
A trait for engines keyswitching (discarding) LWE ciphertexts.
Semantics
This discarding operation fills the output
LWE ciphertext with
the keyswitch of the input
LWE ciphertext, using the ksk
LWE keyswitch key.
Formal Definition
Required methods
fn discard_keyswitch_lwe_ciphertext(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
) -> Result<(), LweCiphertextDiscardingKeyswitchError<Self::EngineError>>
fn discard_keyswitch_lwe_ciphertext(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
) -> Result<(), LweCiphertextDiscardingKeyswitchError<Self::EngineError>>
Keyswitch an LWE ciphertext.
unsafe fn discard_keyswitch_lwe_ciphertext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
)
unsafe fn discard_keyswitch_lwe_ciphertext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input: &InputCiphertext,
ksk: &KeyswitchKey
)
Unsafely keyswitch an LWE ciphertext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweCiphertextDiscardingKeyswitchError
. For safety concerns specific to an engine,
refer to the implementer safety section.
Implementors
impl LweCiphertextDiscardingKeyswitchEngine<LweKeyswitchKey32, LweCiphertext32, LweCiphertext32> for CoreEngine
Description:
Implementation of LweCiphertextDiscardingKeyswitchEngine
for CoreEngine
that operates on
32 bits integers.
impl LweCiphertextDiscardingKeyswitchEngine<LweKeyswitchKey64, LweCiphertext64, LweCiphertext64> for CoreEngine
Description:
Implementation of LweCiphertextDiscardingKeyswitchEngine
for CoreEngine
that operates on
64 bits integers.