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
46
47
48
49
50
use super::engine_error;
use crate::specification::engines::AbstractEngine;
use crate::specification::entities::{
LweSecretKeyEntity, LweSeededCiphertextVectorEntity, PlaintextVectorEntity,
};
use concrete_commons::dispersion::Variance;
engine_error! {
LweSeededCiphertextVectorEncryptionError for LweSeededCiphertextVectorEncryptionEngine @
}
pub trait LweSeededCiphertextVectorEncryptionEngine<SecretKey, PlaintextVector, CiphertextVector>:
AbstractEngine
where
SecretKey: LweSecretKeyEntity,
PlaintextVector: PlaintextVectorEntity,
CiphertextVector: LweSeededCiphertextVectorEntity<KeyDistribution = SecretKey::KeyDistribution>,
{
fn encrypt_lwe_seeded_ciphertext_vector(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance,
) -> Result<CiphertextVector, LweSeededCiphertextVectorEncryptionError<Self::EngineError>>;
unsafe fn encrypt_lwe_seeded_ciphertext_vector_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance,
) -> CiphertextVector;
}