Trait concrete_core::specification::engines::GlweCiphertextVectorTrivialEncryptionEngine
source · [−]pub trait GlweCiphertextVectorTrivialEncryptionEngine<PlaintextVector, CiphertextVector>: AbstractEnginewhere
PlaintextVector: PlaintextVectorEntity,
CiphertextVector: GlweCiphertextVectorEntity,{
fn trivially_encrypt_glwe_ciphertext_vector(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> Result<CiphertextVector, GlweCiphertextVectorTrivialEncryptionError<Self::EngineError>>;
unsafe fn trivially_encrypt_glwe_ciphertext_vector_unchecked(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> CiphertextVector;
}
Expand description
A trait for engines trivially encrypting GLWE ciphertext vector.
Semantics
This pure operation generates a GLWE ciphertext vector containing
the trivial encryption of the input
plaintext vector with the requested glwe_size
.
Formal Definition
A trivial encryption uses a zero mask and no noise. It is absolutely not secure, as the body contains a direct copy of the plaintext. However, it is useful for some FHE algorithms taking public information as input. For example, a trivial GLWE encryption of a public lookup table is used in the bootstrap.
Required Methods
sourcefn trivially_encrypt_glwe_ciphertext_vector(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> Result<CiphertextVector, GlweCiphertextVectorTrivialEncryptionError<Self::EngineError>>
fn trivially_encrypt_glwe_ciphertext_vector(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> Result<CiphertextVector, GlweCiphertextVectorTrivialEncryptionError<Self::EngineError>>
Trivially encrypts a plaintext vector into a GLWE ciphertext vector.
sourceunsafe fn trivially_encrypt_glwe_ciphertext_vector_unchecked(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> CiphertextVector
unsafe fn trivially_encrypt_glwe_ciphertext_vector_unchecked(
&mut self,
glwe_size: GlweSize,
glwe_ciphertext_count: GlweCiphertextCount,
input: &PlaintextVector
) -> CiphertextVector
Unsafely trivially encrypts a plaintext vector into a GLWE ciphertext vector.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of GlweCiphertextVectorTrivialEncryptionError
. For safety concerns specific to an
engine, refer to the implementer safety section.