concrete_core/specification/entities/
glwe_seeded_ciphertext_vector.rs

1use crate::commons::math::random::CompressionSeed;
2use crate::prelude::{GlweCiphertextCount, GlweDimension, PolynomialSize};
3use crate::specification::entities::markers::GlweSeededCiphertextVectorKind;
4use crate::specification::entities::AbstractEntity;
5
6/// A trait implemented by types embodying a seeded GLWE ciphertext vector.
7///
8/// **Remark:** GLWE ciphertexts generalize LWE ciphertexts by definition, however in this library,
9/// GLWE ciphertext entities do not generalize LWE ciphertexts, i.e., polynomial size cannot be 1.
10///
11/// # Formal Definition
12///
13/// cf [`here`](`crate::specification::entities::GlweSeededCiphertextEntity`)
14pub trait GlweSeededCiphertextVectorEntity:
15    AbstractEntity<Kind = GlweSeededCiphertextVectorKind>
16{
17    /// Returns the GLWE dimension of the ciphertexts.
18    fn glwe_dimension(&self) -> GlweDimension;
19
20    /// Returns the polynomial size of the ciphertexts.
21    fn polynomial_size(&self) -> PolynomialSize;
22
23    /// Returns the number of ciphertexts in the vector.
24    fn glwe_ciphertext_count(&self) -> GlweCiphertextCount;
25
26    /// Returns the compression seed used to generate the mask of the LWE ciphertext during
27    /// encryption.
28    fn compression_seed(&self) -> CompressionSeed;
29}