Template Class HEArithmeticOperator< Scheme::CKKS >
Defined in File operator.cuh
Inheritance Relationships
Base Type
public heongpu::HEOperator< Scheme::CKKS >(Template Class HEOperator< Scheme::CKKS >)
Class Documentation
-
template<>
class HEArithmeticOperator<Scheme::CKKS> : public heongpu::HEOperator<Scheme::CKKS> HEArithmeticOperator performs arithmetic operations on ciphertexts.
Public Functions
-
HEArithmeticOperator(HEContext<Scheme::CKKS> &context, HEEncoder<Scheme::CKKS> &encoder)
Constructs a new HEArithmeticOperator object.
- Parameters:
context – Encryption parameters.
encoder – Encoder for arithmetic operations.
-
void generate_bootstrapping_params(const double scale, const BootstrappingConfig &config, const arithmetic_bootstrapping_type &boot_type)
Generates bootstrapping parameters.
- Parameters:
scale – Scaling factor.
config – Bootstrapping configuration.
-
void generate_bootstrapping_params_v2(const double scale, const BootstrappingConfigV2 &config)
-
inline std::vector<int> bootstrapping_key_indexs()
-
Ciphertext<Scheme::CKKS> regular_bootstrapping(Ciphertext<Scheme::CKKS> &input1, Galoiskey<Scheme::CKKS> &galois_key, Relinkey<Scheme::CKKS> &relin_key, const ExecutionOptions &options = ExecutionOptions())
Performs regular bootstrapping on a ciphertext.(For more detail please check README.md)
- Parameters:
input1 – Input ciphertext.
galois_key – Galois key.
relin_key – Relinearization key.
options – Execution options.
- Returns:
Ciphertext Bootstrapped ciphertext.
-
Ciphertext<Scheme::CKKS> regular_bootstrapping_v2(Ciphertext<Scheme::CKKS> &input1, Galoiskey<Scheme::CKKS> &galois_key, Relinkey<Scheme::CKKS> &relin_key, Switchkey<Scheme::CKKS> *swk_dense_to_sparse = nullptr, Switchkey<Scheme::CKKS> *swk_sparse_to_dense = nullptr, const ExecutionOptions &options = ExecutionOptions())
Performs regular bootstrapping with non-sparse key support (v2).
Regular bootstrapping procedure based on the algorithm from “Efficient Bootstrapping for Approximate Homomorphic Encryption
with Non-Sparse Keys” (
https://eprint.iacr.org/2020/1203.pdf)Implements the optimized bootstrapping algorithm from the paper: “Efficient Bootstrapping for Approximate Homomorphic Encryption with
Non-Sparse Keys” (
https://eprint.iacr.org/2020/1203.pdf)- Parameters:
input1 – Input ciphertext at maximum depth (must have current_decomp_count == 1).
galois_key – Galois key for rotation operations.
relin_key – Relinearization key for EvalMod polynomial evaluation.
swk_dense_to_sparse – Optional switch key from dense to sparse representation.
swk_sparse_to_dense – Optional switch key from sparse to dense representation.
options – Execution options (stream, storage, etc.).
input1 – Input ciphertext at maximum depth (only 1 modulus remaining)
galois_key – Galois keys for rotation operations in CoeffToSlot/SlotToCoeff
relin_key – Relinearization key for reducing ciphertext size during EvalMod
swk_dense_to_sparse – Optional switch key from dense to sparse representation
swk_sparse_to_dense – Optional switch key from sparse back to dense representation
options – Execution options (stream, storage type, etc.)
- Throws:
std::invalid_argument – if bootstrapping context not initialized.
std::logic_error – if input ciphertext not at maximum depth.
- Returns:
Ciphertext Bootstrapped ciphertext with refreshed modulus chain.
- Returns:
Bootstrapped ciphertext with refreshed noise and full modulus chain
-
Ciphertext<Scheme::CKKS> slim_bootstrapping(Ciphertext<Scheme::CKKS> &input1, Galoiskey<Scheme::CKKS> &galois_key, Relinkey<Scheme::CKKS> &relin_key, const ExecutionOptions &options = ExecutionOptions())
Performs slim bootstrapping on a ciphertext.(For more detail please check README.md)
- Parameters:
input1 – Input ciphertext.
galois_key – Galois key.
relin_key – Relinearization key.
options – Execution options.
- Returns:
Ciphertext Bootstrapped ciphertext.
-
HEArithmeticOperator(HEContext<Scheme::CKKS> &context, HEEncoder<Scheme::CKKS> &encoder)