A class consisting of bootstrap and its related functions.
More...
#include <Bootstrapper.hpp>
|
| Bootstrapper (const HomEvaluator &eval, const u64 log_slots) |
| Constructs a class for boostrap. Pre-computation of bootstrapping constants is included. More...
|
|
| Bootstrapper (const HomEvaluator &eval) |
|
| Bootstrapper (const HomEvaluator &eval, const Context &context_sparse, const u64 log_slots) |
| Constructs a class for boostrap which can perform sparse secret encapsulation, using the same Parameter as eval. Includes pre-computation of bootstrapping constants. More...
|
|
| Bootstrapper (const HomEvaluator &eval, const Context &context_sparse) |
|
bool | isBootstrapReady (const u64 log_slots) const |
| Check whether bootstrap is available. More...
|
|
void | makeBootConstants (const u64 log_slots) |
| make the pre-computed data for bootstrapping More...
|
|
void | loadBootConstants (const u64 log_slots, const Device &device) const |
| load the pre-computed data for bootstrapping to CPU/GPU memory More...
|
|
u64 | getLevelAfterFullSlotBootstrap () const |
| return the level right after (full slot) bootstrap More...
|
|
u64 | getMinLevelForBootstrap () const |
| return minimum level which is available to bootstrap More...
|
|
void | bootstrap (const Ciphertext &ctxt, Ciphertext &ctxt_out, bool is_complex=false) const |
| Bootstrap a Ciphertext with input range [-1, 1]. More...
|
|
void | bootstrap (const Ciphertext &ctxt, Ciphertext &ctxt_out_real, Ciphertext &ctxt_out_imag) const |
| Bootstrap a Ciphertext with two output Ciphertext, one for real part and the other for imaginary part. More...
|
|
void | bootstrapExtended (const Ciphertext &ctxt, Ciphertext &ctxt_out, bool is_complex=false) const |
| Bootstrap a Ciphertext with larger input range [-2^20, 2^20]. More...
|
|
void | bootstrapExtended (const Ciphertext &ctxt, Ciphertext &ctxt_out_real, Ciphertext &ctxt_out_imag) const |
| Bootstrap a Ciphertext with two output Ciphertext, one for real part and the other for imaginary part, with larger input range [-2^20, 2^20]. More...
|
|
|
std::shared_ptr< BootstrapperImpl > | impl_ |
|
A class consisting of bootstrap and its related functions.
◆ Bootstrapper() [1/4]
HEaaN::Bootstrapper::Bootstrapper |
( |
const HomEvaluator & |
eval, |
|
|
const u64 |
log_slots |
|
) |
| |
|
explicit |
Constructs a class for boostrap. Pre-computation of bootstrapping constants is included.
- Parameters
-
[in] | eval | HomEvaluator to be used for bootstrapping. |
[in] | log_slots | |
Without /p log_slots argument, it pre-compute the boot constants for full slots
◆ Bootstrapper() [2/4]
HEaaN::Bootstrapper::Bootstrapper |
( |
const HomEvaluator & |
eval | ) |
|
|
explicit |
◆ Bootstrapper() [3/4]
HEaaN::Bootstrapper::Bootstrapper |
( |
const HomEvaluator & |
eval, |
|
|
const Context & |
context_sparse, |
|
|
const u64 |
log_slots |
|
) |
| |
|
explicit |
Constructs a class for boostrap which can perform sparse secret encapsulation, using the same Parameter as eval. Includes pre-computation of bootstrapping constants.
- Parameters
-
[in] | eval | HomEvaluator to be used for bootstrapping. |
[in] | context_sparse | The context constructed with the corresponding sparse parameter of which eval was constructed. |
[in] | log_slots | Logarithm (base 2) of the number of plaintext slots. |
If the log_slots
argument is not provided, the bootstrapping constants will be pre-computed for full slots.
- Exceptions
-
RuntimeException | if context_sparse is not a context constructed with the corresponding sparse parameter of which eval was constructed. Please refer to SparseParameterPresetFor() in ParameterPreset.hpp for the sparse parameters. |
◆ Bootstrapper() [4/4]
HEaaN::Bootstrapper::Bootstrapper |
( |
const HomEvaluator & |
eval, |
|
|
const Context & |
context_sparse |
|
) |
| |
|
explicit |
◆ bootstrap() [1/2]
void HEaaN::Bootstrapper::bootstrap |
( |
const Ciphertext & |
ctxt, |
|
|
Ciphertext & |
ctxt_out, |
|
|
bool |
is_complex = false |
|
) |
| const |
Bootstrap a Ciphertext with input range [-1, 1].
- Parameters
-
[in] | ctxt | |
[out] | ctxt_out | |
[in] | is_complex | Set it to TRUE when the input ciphertext actually encrypting complex vectors. |
Recover the level of Ciphertext.
- Exceptions
-
◆ bootstrap() [2/2]
Bootstrap a Ciphertext with two output Ciphertext, one for real part and the other for imaginary part.
- Parameters
-
[in] | ctxt | |
[out] | ctxt_out_real | |
[out] | ctxt_out_imag | |
Recover the level of Ciphertexts.
- Exceptions
-
◆ bootstrapExtended() [1/2]
void HEaaN::Bootstrapper::bootstrapExtended |
( |
const Ciphertext & |
ctxt, |
|
|
Ciphertext & |
ctxt_out, |
|
|
bool |
is_complex = false |
|
) |
| const |
Bootstrap a Ciphertext with larger input range [-2^20, 2^20].
- Parameters
-
[in] | ctxt | |
[out] | ctxt_out | |
[in] | is_complex | Set it to TRUE when the input ciphertext actually encrypting complex vectors. |
Recover the level of Ciphertext. Note that this function is approximately two times slower than basic bootstrap function. Enabled only for FV and FG parameters.
- Exceptions
-
◆ bootstrapExtended() [2/2]
Bootstrap a Ciphertext with two output Ciphertext, one for real part and the other for imaginary part, with larger input range [-2^20, 2^20].
- Parameters
-
[in] | ctxt | |
[out] | ctxt_out_real | |
[out] | ctxt_out_imag | |
Recover the level of Ciphertexts.
- Exceptions
-
◆ getLevelAfterFullSlotBootstrap()
u64 HEaaN::Bootstrapper::getLevelAfterFullSlotBootstrap |
( |
| ) |
const |
return the level right after (full slot) bootstrap
◆ getMinLevelForBootstrap()
u64 HEaaN::Bootstrapper::getMinLevelForBootstrap |
( |
| ) |
const |
return minimum level which is available to bootstrap
◆ isBootstrapReady()
bool HEaaN::Bootstrapper::isBootstrapReady |
( |
const u64 |
log_slots | ) |
const |
Check whether bootstrap is available.
- Parameters
-
Check whether bootstrapping constants are pre-computed. These constants are necessary for the process of bootstrapping.
◆ loadBootConstants()
void HEaaN::Bootstrapper::loadBootConstants |
( |
const u64 |
log_slots, |
|
|
const Device & |
device |
|
) |
| const |
load the pre-computed data for bootstrapping to CPU/GPU memory
- Parameters
-
The pre-computed constants for bootstrapping are initially
- Exceptions
-
◆ makeBootConstants()
void HEaaN::Bootstrapper::makeBootConstants |
( |
const u64 |
log_slots | ) |
|
make the pre-computed data for bootstrapping
- Parameters
-
- Exceptions
-
◆ impl_
std::shared_ptr<BootstrapperImpl> HEaaN::Bootstrapper::impl_ |
|
private |
The documentation for this class was generated from the following file: