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