pub trait LweCiphertextEncryptionEngine<SecretKey, Plaintext, Ciphertext>: AbstractEngine where
SecretKey: LweSecretKeyEntity,
Plaintext: PlaintextEntity,
Ciphertext: LweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>, {
fn encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Result<Ciphertext, LweCiphertextEncryptionError<Self::EngineError>>;
unsafe fn encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Ciphertext;
}
Expand description
A trait for engines encrypting LWE ciphertexts.
Semantics
This pure operation generates an LWE ciphertext containing the
encryption of the input
plaintext under the key
secret key.
Formal Definition
Required methods
fn encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Result<Ciphertext, LweCiphertextEncryptionError<Self::EngineError>>
fn encrypt_lwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Result<Ciphertext, LweCiphertextEncryptionError<Self::EngineError>>
Encrypts an LWE ciphertext.
unsafe fn encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Ciphertext
unsafe fn encrypt_lwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Plaintext,
noise: Variance
) -> Ciphertext
Unsafely encrypts an LWE ciphertext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweCiphertextEncryptionError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
Description:
Implementation of LweCiphertextEncryptionEngine
for CoreEngine
that operates on
32 bits integers.
Description:
Implementation of LweCiphertextEncryptionEngine
for CoreEngine
that operates on
64 bits integers.