Template Class Plaintext< Scheme::BFV >
Defined in File plaintext.cuh
Class Documentation
-
template<>
class Plaintext<Scheme::BFV> Plaintext represents the unencrypted data used in homomorphic encryption.
The Plaintext class is initialized with encryption parameters and optionally a CUDA stream. It provides methods to manage the underlying data, such as resizing, and transferring between host (CPU) and device (GPU). This class is used for preparing data for encoding, encryption, and other homomorphic operations.
Public Functions
-
explicit Plaintext(HEContext<Scheme::BFV> context, const ExecutionOptions &options = ExecutionOptions())
Constructs a new Plaintext object with specified parameters and an optional CUDA stream.
- Parameters:
context – Reference to the Parameters object that sets the encryption parameters.
stream – The CUDA stream to be used for asynchronous operations. Defaults to
cudaStreamDefault.
-
void store_in_device(cudaStream_t stream = cudaStreamDefault)
Stores the plaintext in the device (GPU) memory.
-
void store_in_host(cudaStream_t stream = cudaStreamDefault)
Stores the plaintext in the host (CPU) memory.
-
inline bool is_on_device() const noexcept
Checks whether the data is stored on the device (GPU) memory.
-
Data64 *data()
Returns a pointer to the underlying plaintext data.
- Returns:
Data64* Pointer to the plaintext data.
-
inline int size() const noexcept
Returns the size of the plaintext.
- Returns:
int Size of the plaintext.
-
inline bool in_ntt_domain() const noexcept
Indicates whether the plaintext is in the NTT (Number Theoretic Transform) domain.
- Returns:
bool True if in NTT domain, false otherwise.
-
Plaintext() = default
Default constructor for Plaintext.
Initializes an empty Plaintext object. All members will have their default values.
-
void save(std::ostream &os) const
-
void load(std::istream &is)
-
explicit Plaintext(HEContext<Scheme::BFV> context, const ExecutionOptions &options = ExecutionOptions())