1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use super::engine_error;
use crate::specification::engines::AbstractEngine;
use crate::specification::entities::{LweCiphertextEntity, LweSecretKeyEntity};
use concrete_commons::dispersion::Variance;
engine_error! {
LweCiphertextZeroEncryptionError for LweCiphertextZeroEncryptionEngine @
}
pub trait LweCiphertextZeroEncryptionEngine<SecretKey, Ciphertext>: AbstractEngine
where
SecretKey: LweSecretKeyEntity,
Ciphertext: LweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>,
{
fn zero_encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
noise: Variance,
) -> Result<Ciphertext, LweCiphertextZeroEncryptionError<Self::EngineError>>;
unsafe fn zero_encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
noise: Variance,
) -> Ciphertext;
}