Template Class HEDecryptor< Scheme::BFV >
Defined in File decryptor.cuh
Class Documentation
-
template<>
class HEDecryptor<Scheme::BFV> HEDecryptor is responsible for decrypting ciphertexts back into plaintexts using a secret key in homomorphic encryption schemes.
The HEDecryptor class is initialized with encryption parameters and a secret key. It provides methods to decrypt ciphertexts into plaintexts for BFV and CKKS schemes. The class also supports noise budget calculation, which is essential for understanding the remaining “noise” tolerance in a given ciphertext.
Additionally, the class includes methods for multiparty computation (MPC) scenarios. These methods enable partial decryption by multiple participants and the fusion of these partial decryptions into a fully decrypted plaintext.
Public Functions
-
HEDecryptor(HEContext<Scheme::BFV> &context, Secretkey<Scheme::BFV> &secret_key)
Constructs a new HEDecryptor object with specified parameters and secret key.
- Parameters:
context – Reference to the Parameters object that sets the encryption parameters.
secret_key – Reference to the Secretkey object used for decryption.
-
inline void decrypt(Plaintext<Scheme::BFV> &plaintext, Ciphertext<Scheme::BFV> &ciphertext, const ExecutionOptions &options = ExecutionOptions())
Decrypts a ciphertext into a plaintext, automatically determining the scheme type.
- Parameters:
plaintext – Plaintext object where the result of the decryption will be stored.
ciphertext – Ciphertext object to be decrypted.
-
inline int remainder_noise_budget(Ciphertext<Scheme::BFV> &ciphertext, const ExecutionOptions &options = ExecutionOptions())
Calculates the remainder of the noise budget in a ciphertext.
- Parameters:
ciphertext – Ciphertext object for which the remaining noise budget is calculated.
- Returns:
int The remainder of the noise budget in the ciphertext.
-
inline int get_seed() const noexcept
Returns the seed of the decryptor.
- Returns:
int Seed of the decryptor.
-
inline void set_seed(int new_seed)
Sets the seed of the decryptor with new seed.
-
inline int get_offset() const noexcept
Returns the offset of the decryptor(curand).
- Returns:
int Offset of the decryptor.
-
inline void set_offset(int new_offset)
Sets the offset of the decryptor with new offset(curand).
-
HEDecryptor() = default
-
HEDecryptor(const HEDecryptor ©) = default
-
HEDecryptor(HEDecryptor &&source) = default
-
HEDecryptor &operator=(const HEDecryptor &assign) = default
-
HEDecryptor &operator=(HEDecryptor &&assign) = default
-
HEDecryptor(HEContext<Scheme::BFV> &context, Secretkey<Scheme::BFV> &secret_key)