Template Class HEKeyGenerator< Scheme::BFV >
Defined in File keygenerator.cuh
Class Documentation
-
template<>
class HEKeyGenerator<Scheme::BFV> HEKeyGenerator is responsible for generating various keys used in homomorphic encryption, such as secret keys, public keys, relinearization keys, Galois keys, and switch keys.
The HEKeyGenerator class is initialized with encryption parameters and provides methods to generate the keys required for different homomorphic encryption schemes. It helps facilitate the encryption, decryption, and key switching operations.
Additionally, the class supports multiparty computation (MPC) by implementing key generation protocols for collaborative schemes. These include the generation of multiparty public keys, relinearization keys, and Galois keys. The implementation is based on the techniques described in the paper “Multiparty Homomorphic Encryption from
Ring-Learning-With-Errors”.
Public Functions
-
HEKeyGenerator(HEContext<Scheme::BFV> &context)
Constructs a new HEKeyGenerator object with specified parameters.
- Parameters:
context – Reference to the Parameters object that sets the encryption parameters.
-
void generate_secret_key(Secretkey<Scheme::BFV> &sk, const ExecutionOptions &options = ExecutionOptions())
Generates a secret key.
- Parameters:
sk – Reference to the Secretkey object where the generated secret key will be stored.
-
void generate_public_key(Publickey<Scheme::BFV> &pk, Secretkey<Scheme::BFV> &sk, const ExecutionOptions &options = ExecutionOptions())
Generates a public key using a secret key.
-
inline void generate_relin_key(Relinkey<Scheme::BFV> &rk, Secretkey<Scheme::BFV> &sk, const ExecutionOptions &options = ExecutionOptions())
Generates a relinearization key using a secret key.
-
inline void generate_galois_key(Galoiskey<Scheme::BFV> &gk, Secretkey<Scheme::BFV> &sk, const ExecutionOptions &options = ExecutionOptions())
Generates a Galois key using a secret key.
-
inline void generate_switch_key(Switchkey<Scheme::BFV> &swk, Secretkey<Scheme::BFV> &new_sk, Secretkey<Scheme::BFV> &old_sk, const ExecutionOptions &options = ExecutionOptions())
Generates a switch key for key switching between two secret keys.
-
inline int get_seed() const noexcept
Returns the seed of the key generator.
- Returns:
int Seed of the key generator.
-
inline void set_seed(int new_seed)
Sets the seed of the key generator with new seed.
-
inline int get_offset() const noexcept
Returns the offset of the key generator(curand).
- Returns:
int Offset of the key generator.
-
inline void set_offset(int new_offset)
Sets the offset of the key generator with new offset(curand).
-
HEKeyGenerator() = delete
-
HEKeyGenerator(const HEKeyGenerator ©) = delete
-
HEKeyGenerator(HEKeyGenerator &&source) = delete
-
HEKeyGenerator &operator=(const HEKeyGenerator &assign) = delete
-
HEKeyGenerator &operator=(HEKeyGenerator &&assign) = delete
-
HEKeyGenerator(HEContext<Scheme::BFV> &context)