Template Class HEEncoder< Scheme::BFV >
Defined in File encoder.cuh
Class Documentation
-
template<>
class HEEncoder<Scheme::BFV> HEEncoder is responsible for encoding messages into plaintexts suitable for homomorphic encryption.
The HEEncoder class is initialized with encryption parameters and provides methods to encode different types of messages (e.g., integers, floating-point numbers, complex numbers) into plaintexts for BFV and CKKS schemes. The class supports both synchronous and asynchronous encoding operations, making it suitable for different homomorphic encryption workflows.
Public Functions
-
HEEncoder(HEContext<Scheme::BFV> &context)
Constructs a new HEEncoder object with specified parameters.
- Parameters:
context – Reference to the Parameters object that sets the encode parameters.
-
inline void encode(Plaintext<Scheme::BFV> &plain, const std::vector<uint64_t> &message, const ExecutionOptions &options = ExecutionOptions())
Encodes a message into a plaintext.
- Parameters:
plain – Plaintext object where the result of the encoding will be stored.
message – Vector of unsigned 64-bit integers representing the message to be encoded.
scale – Parameter defining encoding precision(for CKKS), default is 0.
-
inline void encode(Plaintext<Scheme::BFV> &plain, const std::vector<int64_t> &message, const ExecutionOptions &options = ExecutionOptions())
Encodes a message of signed 64-bit integers into a plaintext.
- Parameters:
plain – Plaintext object where the result of the encoding will be stored.
message – Vector of signed 64-bit integers representing the message to be encoded.
scale – parameter defining encoding precision(for CKKS), default is 0.
-
inline void encode(Plaintext<Scheme::BFV> &plain, const HostVector<uint64_t> &message, const ExecutionOptions &options = ExecutionOptions())
Encodes a message into a plaintext.
- Parameters:
plain – Plaintext object where the result of the encoding will be stored.
message – HostVector of unsigned 64-bit integers representing the message to be encoded.
scale – parameter defining encoding precision(for CKKS), default is 0.
-
inline void encode(Plaintext<Scheme::BFV> &plain, const HostVector<int64_t> &message, const ExecutionOptions &options = ExecutionOptions())
Encodes a message of signed 64-bit integers into a plaintext.
- Parameters:
plain – Plaintext object where the result of the encoding will be stored.
message – HostVector of signed 64-bit integers representing the message to be encoded.
scale – parameter defining encoding precision(for CKKS), default is 0.
-
inline void decode(std::vector<uint64_t> &message, Plaintext<Scheme::BFV> &plain, const ExecutionOptions &options = ExecutionOptions())
Decodes a plaintext into a vector of unsigned 64-bit integers.
- Parameters:
message – Vector where the decoded message will be stored.
plain – Plaintext object to be decoded.
-
inline void decode(std::vector<int64_t> &message, Plaintext<Scheme::BFV> &plain, const ExecutionOptions &options = ExecutionOptions())
Decodes a plaintext into a vector of signed 64-bit integers.
- Parameters:
message – Vector where the decoded message will be stored.
plain – Plaintext object to be decoded.
-
inline void decode(HostVector<uint64_t> &message, Plaintext<Scheme::BFV> &plain, const ExecutionOptions &options = ExecutionOptions())
Decodes a plaintext into a HostVector of unsigned 64-bit integers.
- Parameters:
message – HostVector where the decoded message will be stored.
plain – Plaintext object to be decoded.
-
inline void decode(HostVector<int64_t> &message, Plaintext<Scheme::BFV> &plain, const ExecutionOptions &options = ExecutionOptions())
Decodes a plaintext into a HostVector of signed 64-bit integers.
- Parameters:
message – HostVector where the decoded message will be stored.
plain – Plaintext object to be decoded.
-
inline int slot_count() const noexcept
Returns the number of slots.
- Returns:
int Number of slots.
-
HEEncoder() = default
-
HEEncoder(HEContext<Scheme::BFV> &context)