concrete_core/specification/engines/
lwe_ciphertext_decryption.rs1use super::engine_error;
2
3use crate::specification::engines::AbstractEngine;
4use crate::specification::entities::{LweCiphertextEntity, LweSecretKeyEntity, PlaintextEntity};
5
6engine_error! {
7 LweCiphertextDecryptionError for LweCiphertextDecryptionEngine @
8}
9
10pub trait LweCiphertextDecryptionEngine<SecretKey, Ciphertext, Plaintext>: AbstractEngine
19where
20 SecretKey: LweSecretKeyEntity,
21 Ciphertext: LweCiphertextEntity<KeyDistribution = SecretKey::KeyDistribution>,
22 Plaintext: PlaintextEntity,
23{
24 fn decrypt_lwe_ciphertext(
26 &mut self,
27 key: &SecretKey,
28 input: &Ciphertext,
29 ) -> Result<Plaintext, LweCiphertextDecryptionError<Self::EngineError>>;
30
31 unsafe fn decrypt_lwe_ciphertext_unchecked(
38 &mut self,
39 key: &SecretKey,
40 input: &Ciphertext,
41 ) -> Plaintext;
42}