concrete_core/specification/engines/
lwe_ciphertext_encryption.rs1use super::engine_error;
2
3use crate::specification::engines::AbstractEngine;
4use crate::specification::entities::{LweCiphertextEntity, LweSecretKeyEntity, PlaintextEntity};
5use concrete_commons::dispersion::Variance;
6
7engine_error! {
8 LweCiphertextEncryptionError for LweCiphertextEncryptionEngine @
9}
10
11pub trait LweCiphertextEncryptionEngine<SecretKey, Plaintext, Ciphertext>: AbstractEngine
20where
21 SecretKey: LweSecretKeyEntity,
22 Plaintext: PlaintextEntity,
23 Ciphertext: LweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>,
24{
25 fn encrypt_lwe_ciphertext(
27 &mut self,
28 key: &SecretKey,
29 input: &Plaintext,
30 noise: Variance,
31 ) -> Result<Ciphertext, LweCiphertextEncryptionError<Self::EngineError>>;
32
33 unsafe fn encrypt_lwe_ciphertext_unchecked(
40 &mut self,
41 key: &SecretKey,
42 input: &Plaintext,
43 noise: Variance,
44 ) -> Ciphertext;
45}