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
This generates a [LWE encryption
]
(crate::specification::engines::LweCiphertextEncryptionEngine
) of zero.
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
impl LweCiphertextZeroEncryptionEngine<LweSecretKey32, LweCiphertext32> for DefaultEngine
Description:
Implementation of LweCiphertextZeroEncryptionEngine
for DefaultEngine
that
operates on 32 bits integers.
impl LweCiphertextZeroEncryptionEngine<LweSecretKey64, LweCiphertext64> for DefaultEngine
Description:
Implementation of LweCiphertextZeroEncryptionEngine
for DefaultEngine
that
operates on 64 bits integers.