pub trait GlweCiphertextDecryptionEngine<SecretKey, Ciphertext, PlaintextVector>: AbstractEnginewhere
SecretKey: GlweSecretKeyEntity,
Ciphertext: GlweCiphertextEntity,
PlaintextVector: PlaintextVectorEntity,{
fn decrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> Result<PlaintextVector, GlweCiphertextDecryptionError<Self::EngineError>>;
unsafe fn decrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> PlaintextVector;
}
Expand description
A trait for engines decrypting GLWE ciphertexts.
Semantics
This pure operation generates a plaintext vector containing the
decryption of the input
ciphertext, under the key
secret key.
Formal Definition
GLWE Decryption
inputs:
- $\mathsf{CT} = \left( \vec{A} , B \right) \in \mathsf{GLWE}_{\vec{S}}( \mathsf{PT} )\subseteq \mathcal{R}_q^{k+1}$: an GLWE ciphertext
- $\vec{S} \in\mathcal{R}_q^k$: a secret key
outputs:
- $\mathsf{PT}\in\mathcal{R}_q$: a plaintext
algorithm:
- compute $\mathsf{PT} = B - \left\langle \vec{A} , \vec{S} \right\rangle \in\mathcal{R}_q$
- output $\mathsf{PT}$
Remark: Observe that the decryption is followed by a decoding phase that will contain a rounding.
Required Methods
sourcefn decrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> Result<PlaintextVector, GlweCiphertextDecryptionError<Self::EngineError>>
fn decrypt_glwe_ciphertext(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> Result<PlaintextVector, GlweCiphertextDecryptionError<Self::EngineError>>
Decrypts a GLWE ciphertext into a plaintext vector.
sourceunsafe fn decrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> PlaintextVector
unsafe fn decrypt_glwe_ciphertext_unchecked(
&mut self,
key: &SecretKey,
input: &Ciphertext
) -> PlaintextVector
Unsafely decrypts a GLWE ciphertext into a plaintext vector.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of GlweCiphertextDecryptionError
. For safety concerns specific to an engine, refer to
the implementer safety section.
Implementors
impl GlweCiphertextDecryptionEngine<GlweSecretKey32, GlweCiphertext32, PlaintextVector32> for DefaultEngine
Description:
Implementation of GlweCiphertextDecryptionEngine
for DefaultEngine
that operates on 32
bits integers.
impl GlweCiphertextDecryptionEngine<GlweSecretKey64, GlweCiphertext64, PlaintextVector64> for DefaultEngine
Description:
Implementation of GlweCiphertextDecryptionEngine
for DefaultEngine
that operates on 64
bits integers.