pub trait GlweCiphertextEncryptionEngine<SecretKey, PlaintextVector, Ciphertext>: AbstractEngine where
SecretKey: GlweSecretKeyEntity,
PlaintextVector: PlaintextVectorEntity,
Ciphertext: GlweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>, {
fn encrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<Ciphertext, GlweCiphertextEncryptionError<Self::EngineError>>;
unsafe fn encrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Ciphertext;
}
Expand description
A trait for engines encrypting GLWE ciphertexts.
Semantics
This pure operation generates a GLWE ciphertext containing the
encryptions of the input
plaintext vector, under the key
secret key.
Formal Definition
Required methods
fn encrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<Ciphertext, GlweCiphertextEncryptionError<Self::EngineError>>
fn encrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<Ciphertext, GlweCiphertextEncryptionError<Self::EngineError>>
Encrypts a plaintext vector into a GLWE ciphertext.
unsafe fn encrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Ciphertext
unsafe fn encrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Ciphertext
Unsafely encrypts a plaintext vector into a GLWE ciphertext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of GlweCiphertextEncryptionError
. For safety concerns specific to an engine, refer to
the implementer safety section.
Implementors
impl GlweCiphertextEncryptionEngine<GlweSecretKey32, PlaintextVector32, GlweCiphertext32> for CoreEngine
Description:
Implementation of GlweCiphertextEncryptionEngine
for CoreEngine
that operates on 32 bits
integers.
impl GlweCiphertextEncryptionEngine<GlweSecretKey64, PlaintextVector64, GlweCiphertext64> for CoreEngine
Description:
Implementation of GlweCiphertextEncryptionEngine
for CoreEngine
that operates on 64 bits
integers.