LweCiphertextDiscardingEncryptionEngine

Trait LweCiphertextDiscardingEncryptionEngine 

Source
pub trait LweCiphertextDiscardingEncryptionEngine<SecretKey, Plaintext, Ciphertext>: AbstractEngine
where SecretKey: LweSecretKeyEntity, Plaintext: PlaintextEntity, Ciphertext: LweCiphertextEntity,
{ // Required methods 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§

Source

fn discard_encrypt_lwe_ciphertext( &mut self, key: &SecretKey, output: &mut Ciphertext, input: &Plaintext, noise: Variance, ) -> Result<(), LweCiphertextDiscardingEncryptionError<Self::EngineError>>

Encrypts an LWE ciphertext.

Source

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§