Class BinFHEScheme
Defined in File binfhe-base-scheme.h
Page Contents
Class Documentation
-
class lbcrypto::BinFHEScheme
Ring GSW accumulator schemes described in https://eprint.iacr.org/2014/816, https://eprint.iacr.org/2020/086 and https://eprint.iacr.org/2022/198.
Public Functions
-
BinFHEScheme() = default
-
inline explicit BinFHEScheme(BINFHE_METHOD method)
Generates a refresh key
- Parameters
params – a shared pointer to RingGSW scheme parameters
LWEsk – a shared pointer to the secret key of the underlying additive
keygenMode – enum to indicate generation of secret key only (SYM_ENCRYPT) or secret key, public key pair (PUB_ENCRYPT)
- Returns
a shared pointer to the refresh key
Evaluates a binary gate (calls bootstrapping as a subroutine)
- Parameters
params – a shared pointer to RingGSW scheme parameters
gate – the gate; can be AND, OR, NAND, NOR, XOR, or XOR
EK – a shared pointer to the bootstrapping keys
ct1 – first ciphertext
ct2 – second ciphertext
- Returns
a shared pointer to the resulting ciphertext
Evaluates a binary gate on a vector of ciphertexts (calls bootstrapping as a subroutine). The evaluation of the gates in this function is specific to 3 input and 4 input
- Parameters
params – a shared pointer to RingGSW scheme parameters
gate – the gate; can be for 3-input: AND3, OR3, MAJORITY, CMUX, for 4-input: AND4, OR4
EK – a shared pointer to the bootstrapping keys
ctvector – vector of ciphertexts
- Returns
a shared pointer to the resulting ciphertext
Evaluates NOT gate
- Parameters
params – a shared pointer to RingGSW scheme parameters
ct1 – the input ciphertext
- Returns
a shared pointer to the resulting ciphertext
Bootstraps a fresh ciphertext
- Parameters
params – a shared pointer to RingGSW scheme parameters
EK – a shared pointer to the bootstrapping keys
ct1 – input ciphertext
- Returns
a shared pointer to the resulting ciphertext
Evaluate an arbitrary function
- Parameters
params – a shared pointer to RingGSW scheme parameters
EK – a shared pointer to the bootstrapping keys
ct – input ciphertext
LUT – the look-up table of the to-be-evaluated function
beta – the error bound
- Returns
a shared pointer to the resulting ciphertext
Evaluate a round down function
- Parameters
params – a shared pointer to RingGSW scheme parameters
EK – a shared pointer to the bootstrapping keys
ct – input ciphertext
beta – the error bound
roundbits – by how many bits to round down
- Returns
a shared pointer to the resulting ciphertext
Evaluate a sign function over large precision
- Parameters
params – a shared pointer to RingGSW scheme parameters
EK – a shared pointer to the bootstrapping keys map
ct – input ciphertext
beta – the error bound
schemeSwitch – flag that indicates if it should be compatible to scheme switching
- Returns
a shared pointer to the resulting ciphertext
Evaluate digit decomposition over a large precision LWE ciphertext
- Parameters
params – a shared pointer to RingGSW scheme parameters
EKs – a shared pointer to the bootstrapping keys map
ct – input ciphertext
beta – the error bound
- Returns
a shared pointer to the resulting ciphertext
Protected Attributes
-
std::shared_ptr<LWEEncryptionScheme> LWEscheme = {std::make_shared<LWEEncryptionScheme>()}
-
std::shared_ptr<RingGSWAccumulator> ACCscheme = {nullptr}
Protected Static Functions
-
static inline uint32_t checkInputFunction(const std::vector<NativeInteger> &lut, NativeInteger mod)
Checks type of input function
- Parameters
lut – look up table for the input function
mod – modulus over which the function is defined
- Returns
the function type: 0 for negacyclic, 1 for periodic, 2 for arbitrary
-
BinFHEScheme() = default