pub trait LweCiphertextDecryptionEngine<SecretKey, Ciphertext, Plaintext>: AbstractEngine where
    SecretKey: LweSecretKeyEntity,
    Ciphertext: LweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>,
    Plaintext: PlaintextEntity
{ fn decrypt_lwe_ciphertext(
        &mut self,
        key: &SecretKey,
        input: &Ciphertext
    ) -> Result<Plaintext, LweCiphertextDecryptionError<Self::EngineError>>; unsafe fn decrypt_lwe_ciphertext_unchecked(
        &mut self,
        key: &SecretKey,
        input: &Ciphertext
    ) -> Plaintext; }
Expand description

A trait for engines decrypting LWE ciphertexts.

Semantics

This pure operation generates an plaintext containing the decryption of the input LWE ciphertext, under the key secret key.

Formal Definition

LWE Decryption

inputs:
  • $\mathsf{ct} = \left( \vec{a} , b\right) \in \mathsf{LWE}^n_{\vec{s}}( \mathsf{pt} )\subseteq \mathbb{Z}_q^{(n+1)}$: an LWE ciphertext
  • $\vec{s}\in\mathbb{Z}_q^n$: a secret key
outputs:
  • $\mathsf{pt}\in\mathbb{Z}_q$: a plaintext
algorithm:
  1. compute $\mathsf{pt} = b - \left\langle \vec{a} , \vec{s} \right\rangle \in\mathbb{Z}_q$
  2. output $\mathsf{pt}$

Remark: Observe that the decryption is followed by a decoding phase that will contain a rounding.

Required Methods

Decrypts an LWE ciphertext.

Unsafely decrypts an LWE ciphertext.

Safety

For the general safety concerns regarding this operation, refer to the different variants of LweCiphertextDecryptionError. For safety concerns specific to an engine, refer to the implementer safety section.

Implementors