Template Class Secretkey< Scheme::TFHE >

Class Documentation

template<>
class Secretkey<Scheme::TFHE>

Public Functions

Secretkey(HEContext<Scheme::TFHE> context, bool store_in_gpu = true)
void store_in_device(cudaStream_t stream = cudaStreamDefault)

Stores the Secretkey in the device (GPU) memory.

void store_in_host(cudaStream_t stream = cudaStreamDefault)

Stores the Secretkey in the host (CPU) memory.

inline bool is_on_device() const noexcept

Checks whether the data is stored on the device (GPU) memory.

inline void switch_stream(cudaStream_t stream)

Switches the Ciphertext CUDA stream.

Parameters:

stream – The new CUDA stream to be used.

inline cudaStream_t stream() const noexcept

Retrieves the CUDA stream associated with the ciphertext.

This function returns the CUDA stream that was used to create or last modify the ciphertext.

Returns:

The CUDA stream associated with the ciphertext.

inline bool is_generated() const noexcept

Indicates whether the secret key has been generated.

Returns:

true if the secret key has been generated, false otherwise.

Secretkey() = default
inline void set_context(HEContext<Scheme::TFHE> context)
inline Secretkey(const Secretkey &copy)

Copy constructor for creating a new Secretkey object by copying an existing one.

This constructor performs a deep copy of the secret key data, ensuring that the new object has its own independent copy of the data. GPU memory operations are handled using cudaMemcpyAsync for asynchronous data transfer.

Parameters:

copy – The source Secretkey object to copy from.

inline Secretkey(Secretkey &&assign) noexcept

Move constructor for transferring ownership of a Secretkey object.

Transfers all resources, including GPU memory, from the source object to the newly constructed object. The source object is left in a valid but undefined state.

Parameters:

assign – The source Secretkey object to move from.

inline Secretkey &operator=(const Secretkey &copy)

Copy assignment operator for assigning one Secretkey object to another.

Performs a deep copy of the secret key data, ensuring that the target object has its own independent copy. GPU memory is copied using cudaMemcpyAsync.

Parameters:

copy – The source Secretkey object to copy from.

Returns:

Reference to the assigned object.

inline Secretkey &operator=(Secretkey &&assign) noexcept

Move assignment operator for transferring ownership of a Secretkey object.

Transfers all resources, including GPU memory, from the source object to the target object. The source object is left in a valid but undefined state.

Parameters:

assign – The source Secretkey object to move from.

Returns:

Reference to the assigned object.