pub trait LweCiphertextVectorEncryptionEngine<SecretKey, PlaintextVector, CiphertextVector>: AbstractEngine where
SecretKey: LweSecretKeyEntity,
PlaintextVector: PlaintextVectorEntity,
CiphertextVector: LweCiphertextVectorEntity<KeyDistribution = SecretKey::KeyDistribution>, {
fn encrypt_lwe_ciphertext_vector(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<CiphertextVector, LweCiphertextVectorEncryptionError<Self::EngineError>>;
unsafe fn encrypt_lwe_ciphertext_vector_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> CiphertextVector;
}
Expand description
A trait for engines encrypting LWE ciphertext vectors.
Semantics
This pure operation generates an LWE ciphertext vector containing
the element-wise encryption of the input
plaintext vector, under the key
secret key.
Formal Definition
Required methods
fn encrypt_lwe_ciphertext_vector(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<CiphertextVector, LweCiphertextVectorEncryptionError<Self::EngineError>>
fn encrypt_lwe_ciphertext_vector(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> Result<CiphertextVector, LweCiphertextVectorEncryptionError<Self::EngineError>>
Encrypts an LWE ciphertext vector.
unsafe fn encrypt_lwe_ciphertext_vector_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> CiphertextVector
unsafe fn encrypt_lwe_ciphertext_vector_unchecked(
&mut self,
key: &SecretKey,
input: &PlaintextVector,
noise: Variance
) -> CiphertextVector
Unsafely encrypts an LWE ciphertext vector.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LweCiphertextVectorEncryptionError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl LweCiphertextVectorEncryptionEngine<LweSecretKey32, PlaintextVector32, LweCiphertextVector32> for CoreEngine
Description:
Implementation of LweCiphertextVectorEncryptionEngine
for CoreEngine
that operates on
32 bits integers.
impl LweCiphertextVectorEncryptionEngine<LweSecretKey64, PlaintextVector64, LweCiphertextVector64> for CoreEngine
Description:
Implementation of LweCiphertextVectorEncryptionEngine
for CoreEngine
that operates on
64 bits integers.