Trait concrete_core::specification::engines::LweCiphertextPlaintextDiscardingAdditionEngine
source · [−]pub trait LweCiphertextPlaintextDiscardingAdditionEngine<InputCiphertext, Plaintext, OutputCiphertext>: AbstractEngine where
Plaintext: PlaintextEntity,
InputCiphertext: LweCiphertextEntity,
OutputCiphertext: LweCiphertextEntity<KeyDistribution = InputCiphertext::KeyDistribution>, {
fn discard_add_lwe_ciphertext_plaintext(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
) -> Result<(), LweCiphertextPlaintextDiscardingAdditionError<Self::EngineError>>;
unsafe fn discard_add_lwe_ciphertext_plaintext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
);
}
Expand description
A trait for engines adding (discarding) plaintext to LWE ciphertexts.
Semantics
This discarding operation fills the output
LWE ciphertext with
the addition of the input_1
LWE ciphertext with the input_2
plaintext.
Formal Definition
Required methods
fn discard_add_lwe_ciphertext_plaintext(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
) -> Result<(), LweCiphertextPlaintextDiscardingAdditionError<Self::EngineError>>
fn discard_add_lwe_ciphertext_plaintext(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
) -> Result<(), LweCiphertextPlaintextDiscardingAdditionError<Self::EngineError>>
Adds a plaintext to an LWE ciphertext.
unsafe fn discard_add_lwe_ciphertext_plaintext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
)
unsafe fn discard_add_lwe_ciphertext_plaintext_unchecked(
&mut self,
output: &mut OutputCiphertext,
input_1: &InputCiphertext,
input_2: &Plaintext
)
Unsafely adds a plaintext to an LWE ciphertext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweCiphertextPlaintextDiscardingAdditionError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl LweCiphertextPlaintextDiscardingAdditionEngine<LweCiphertext32, Plaintext32, LweCiphertext32> for CoreEngine
Description:
Implementation of LweCiphertextPlaintextDiscardingAdditionEngine
for CoreEngine
that
operates on 32 bits integers.
impl LweCiphertextPlaintextDiscardingAdditionEngine<LweCiphertext64, Plaintext64, LweCiphertext64> for CoreEngine
Description:
Implementation of LweCiphertextPlaintextDiscardingAdditionEngine
for CoreEngine
that
operates on 64 bits integers.