pub trait GlweCiphertextTrivialEncryptionEngine<PlaintextVector, Ciphertext>: AbstractEngine where
PlaintextVector: PlaintextVectorEntity,
Ciphertext: GlweCiphertextEntity, {
fn trivially_encrypt_glwe_ciphertext(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Result<Ciphertext, GlweCiphertextTrivialEncryptionError<Self::EngineError>>;
unsafe fn trivially_encrypt_glwe_ciphertext_unchecked(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Ciphertext;
}
Expand description
A trait for engines trivially encrypting GLWE ciphertext.
Semantics
This pure operation generates a GLWE ciphertext 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
Required methods
fn trivially_encrypt_glwe_ciphertext(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Result<Ciphertext, GlweCiphertextTrivialEncryptionError<Self::EngineError>>
fn trivially_encrypt_glwe_ciphertext(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Result<Ciphertext, GlweCiphertextTrivialEncryptionError<Self::EngineError>>
Trivially encrypts a plaintext vector into a GLWE ciphertext.
unsafe fn trivially_encrypt_glwe_ciphertext_unchecked(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Ciphertext
unsafe fn trivially_encrypt_glwe_ciphertext_unchecked(
&mut self,
glwe_size: GlweSize,
input: &PlaintextVector
) -> Ciphertext
Unsafely creates the trivial GLWE encryption of the plaintext vector.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of GlweCiphertextTrivialEncryptionError
. For safety concerns specific to an engine,
refer to the implementer safety section.