pub trait LweCiphertextDiscardingEncryptionEngine<SecretKey, Plaintext, Ciphertext>: AbstractEnginewhere
SecretKey: LweSecretKeyEntity,
Plaintext: PlaintextEntity,
Ciphertext: LweCiphertextEntity,{
fn discard_encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
) -> Result<(), LweCiphertextDiscardingEncryptionError<Self::EngineError>>;
unsafe fn discard_encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
);
}
Expand description
A trait for engines encrypting (discarding) LWE ciphertexts.
Semantics
This discarding operation fills the output
LWE ciphertext with
the encryption of the input
plaintext, under the key
secret key.
Formal Definition
cf here
Required Methods
sourcefn discard_encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
) -> Result<(), LweCiphertextDiscardingEncryptionError<Self::EngineError>>
fn discard_encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
) -> Result<(), LweCiphertextDiscardingEncryptionError<Self::EngineError>>
Encrypts an LWE ciphertext.
sourceunsafe fn discard_encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
)
unsafe fn discard_encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
output: &mut Ciphertext,
input: &Plaintext,
noise: Variance
)
Unsafely encrypts an LWE ciphertext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweCiphertextDiscardingEncryptionError
. For safety concerns specific to an engine,
refer to the implementer safety section.
Implementors
impl LweCiphertextDiscardingEncryptionEngine<LweSecretKey32, Plaintext32, LweCiphertext32> for DefaultEngine
Description:
Implementation of LweCiphertextDiscardingEncryptionEngine
for DefaultEngine
that
operates on 32 bits integers.
impl LweCiphertextDiscardingEncryptionEngine<LweSecretKey32, Plaintext32, LweCiphertextMutView32<'_>> for DefaultEngine
Description:
Implementation of LweCiphertextDiscardingEncryptionEngine
for DefaultEngine
that
operates on 32 bits integers.
impl LweCiphertextDiscardingEncryptionEngine<LweSecretKey64, Plaintext64, LweCiphertext64> for DefaultEngine
Description:
Implementation of LweCiphertextDiscardingEncryptionEngine
for DefaultEngine
that
operates on 64 bits integers.
impl LweCiphertextDiscardingEncryptionEngine<LweSecretKey64, Plaintext64, LweCiphertextMutView64<'_>> for DefaultEngine
Description:
Implementation of LweCiphertextDiscardingEncryptionEngine
for DefaultEngine
that
operates on 64 bits integers.