Skip to contents

Context and Keys

fhe_context()
Create a fully homomorphic encryption context
gen_crypto_context()
Generate a CryptoContext from a parameter object
key_gen()
Generate key pair
enable_feature()
Enable a feature on a CryptoContext
CryptoContext()
Crypto Context
BFVParams()
BFV Parameters
BGVParams()
BGV Parameters
CKKSParams()
CKKS Parameters
KeyPair()
Key Pair
PublicKey()
Public Key
PrivateKey()
Private Key

Encryption and Decryption

encrypt()
Encrypt a plaintext
decrypt()
Decrypt a ciphertext
make_packed_plaintext()
Make a packed integer plaintext
make_coef_packed_plaintext()
Make a coefficient-packed integer plaintext
make_ckks_packed_plaintext()
Make a CKKS packed plaintext from real numbers
get_packed_value()
Get packed integer values from a plaintext
get_real_packed_value()
Get real values from a CKKS plaintext
Ciphertext()
Ciphertext class
Plaintext()
Plaintext

Plaintext accessors

Key tags

get_key_tag() set_key_tag()
Key tag accessors
is_good()
Is a KeyPair valid?

Ciphertext accessors

get_crypto_context()
Associated CryptoContext of a Ciphertext
get_scaling_factor_real()
Real-valued CKKS scaling factor at a modulus-chain level
ckks_scaling_factor_bits()
CKKS scaling-mod-size in bits

CryptoContext getters

get_crypto_parameters()
Crypto parameters of a CryptoContext
get_element_params()
Element parameters of a CryptoContext
get_encoding_params()
Encoding parameters of a CryptoContext
get_cyclotomic_order()
Cyclotomic order of a CryptoContext
get_key_gen_level()
Key-generation level of a CryptoContext
set_key_gen_level()
Set the key-generation level of a CryptoContext

Homomorphic Operations

eval_add()
Homomorphic addition
eval_sub()
Homomorphic subtraction
eval_mult()
Homomorphic multiplication
eval_negate()
Homomorphic negation
eval_square()
Homomorphic squaring
eval_rotate()
Rotate ciphertext slots
eval_sum()
Sum all slots in a ciphertext
rescale()
Rescale a CKKS ciphertext (alias for ModReduce)
ring_dimension()
Ring dimension of a CryptoContext
eval_add_in_place()
Homomorphic addition in place
eval_sub_in_place()
Homomorphic subtraction in place
eval_mult_in_place()
Homomorphic multiplication by a number, in place
eval_negate_in_place()
Homomorphic negation in place
eval_add_mutable()
Homomorphic add, mutable variant
eval_sub_mutable()
Homomorphic subtract, mutable variant
eval_mult_mutable()
Homomorphic multiply, mutable variant
eval_square_mutable()
Homomorphic square, mutable variant
eval_mult_no_relin()
Homomorphic multiplication without relinearization
relinearize()
Relinearize a higher-degree ciphertext
eval_mult_and_relinearize()
Fused multiply-and-relinearize
mod_reduce()
Reduce the modulus chain by one level
mod_reduce_in_place()
Reduce the modulus chain by one level, in place
level_reduce()
Reduce the modulus chain by multiple levels
level_reduce_in_place()
Reduce the modulus chain by multiple levels, in place
compress()
Compress a ciphertext to fewer towers
eval_add_many() eval_add_many_in_place() eval_mult_many()
Add or multiply a list of ciphertexts
eval_merge()
Merge the first slots of several ciphertexts into one
eval_linear_wsum() eval_linear_wsum_mutable()
Weighted sum of ciphertexts (CKKS)
eval_inner_product()
Inner product of two encrypted vectors
eval_sum_rows() eval_sum_cols() eval_sum_rows_key_gen() eval_sum_cols_key_gen()
Sum the rows or the columns of an encrypted matrix
eval_at_index()
Rotate the slots of a ciphertext by an index
eval_square_in_place() rescale_in_place() relinearize_in_place()
Square, rescale or relinearize a ciphertext in place
eval_add_mutable_in_place() eval_sub_mutable_in_place() eval_mult_mutable_in_place()
Mutable arithmetic on two ciphertexts, in place
eval_add_in_place_no_check() eval_mult_no_check() eval_mult_no_relin_no_check()
Arithmetic without the library's operand checks
composed_eval_mult()
Multiply two ciphertexts and reduce the modulus
eval_mult_keys_gen()
Generate relinearization keys for higher powers of the secret key
make_string_plaintext()
Encode a character string as a plaintext

Proxy re-encryption and key switching

re_key_gen() re_encrypt()
Proxy re-encryption
key_switch_gen() key_switch() key_switch_in_place()
Switch a ciphertext from one secret key to another
key_switch_ext() key_switch_down_first_element()
Steps of hybrid key switching
sparse_key_gen()
Generate a sparse key pair
multi_mult_eval_key()
A party's share of the joint multiplication key (threshold FHE)
clear_eval_sum_keys()
Remove summation keys from the registry
get_all_contexts()
All contexts the library currently holds
enable_precompute_crt_tables_after_deserializaton() disable_precompute_crt_tables_after_deserializaton()
Precompute CRT tables when a context is deserialized
eval_chebyshev_function_ptxt()
Chebyshev approximation of a function, in the clear
get_multiplicative_depth_by_coeff_vector()
Multiplicative depth of a polynomial evaluation

CKKS Advanced

eval_poly()
Evaluate a polynomial on a ciphertext
eval_poly_linear()
Evaluate a polynomial via the linear evaluator
eval_poly_ps()
Evaluate a polynomial via the Paterson-Stockmeyer method
eval_chebyshev()
Evaluate a Chebyshev series on a ciphertext
eval_chebyshev_linear()
Evaluate a Chebyshev series via the linear evaluator
eval_chebyshev_ps()
Evaluate a Chebyshev series via the Paterson-Stockmeyer method
eval_chebyshev_coefficients()
Chebyshev coefficients for a real-valued function
eval_chebyshev_function()
Evaluate a user-supplied function on a CKKS ciphertext via Chebyshev approximation
eval_powers() eval_poly_with_precomp() eval_cheby_polys() eval_chebyshev_series_with_precomp()
Evaluate several series on one ciphertext
SeriesPowers()
Precomputed powers of a ciphertext
eval_sin()
Evaluate sine on a ciphertext (Chebyshev approximation)
eval_cos()
Evaluate cosine on a ciphertext
eval_logistic()
Evaluate logistic function on a ciphertext
eval_divide()
Evaluate division approximation on a ciphertext
eval_bootstrap()
Perform CKKS bootstrapping
eval_bootstrap_setup()
Set up CKKS bootstrapping
eval_bootstrap_key_gen()
Generate bootstrapping keys
eval_bootstrap_precompute()
Precompute the plaintexts of CKKS bootstrapping
eval_bootstrap_stc_first()
CKKS bootstrapping with slots-to-coefficients first
get_bootstrap_depth()
Get the required multiplicative depth for CKKS bootstrapping
get_ckks_boot_correction_factor()
Get the CKKS bootstrap correction factor
set_ckks_boot_correction_factor()
Set the CKKS bootstrap correction factor
eval_fast_rotation()
Hoisted slot rotation using precomputed digits
eval_fast_rotation_ext()
Extended hoisted slot rotation
eval_fast_rotation_precompute()
Precompute digit decomposition for hoisted fast rotations
FastRotationPrecomputation()
Precomputed digit decomposition for hoisted rotations
get_complex_packed_value()
Get complex values from a CKKS plaintext
find_automorphism_index()
Compute the automorphism index for a single slot index
find_automorphism_indices()
Compute the automorphism indices for a list of slot indices
eval_automorphism_key_gen()
Generate automorphism evaluation keys for a set of indices
eval_automorphism()
Apply an automorphism to a ciphertext

Interactive bootstrap

key_switch_down()
Scale a ciphertext down from extended CRT basis to Q
int_boot_decrypt()
Server-side masked decryption for interactive bootstrap
int_boot_encrypt()
Client-side re-encryption for interactive bootstrap
int_boot_add()
Combine encrypted and unencrypted masked decryptions
int_boot_adjust_scale()
Prepare a ciphertext for interactive bootstrap
int_mp_boot_adjust_scale()
Prepare a ciphertext for multi-party interactive bootstrap
int_mp_boot_random_element_gen()
Generate a common random element for multi-party bootstrap
int_mp_boot_decrypt()
Multi-party masked decryption for interactive bootstrap
int_mp_boot_add()
Aggregate multi-party shares pairs
int_mp_boot_encrypt()
Final re-encryption for multi-party interactive bootstrap

Serialization and key registry

fhe_serialize()
Serialize an OpenFHE object
fhe_deserialize()
Deserialize an OpenFHE object from file
fhe_deserialize_string()
Deserialize an OpenFHE object held in memory
serialize_eval_keys()
Serialize evaluation keys from the key registry
deserialize_eval_keys()
Deserialize evaluation keys from file
deserialize_eval_keys_string()
Deserialize evaluation keys held in memory
serialize_eval_bootstrap_key() deserialize_eval_bootstrap_key()
Serialize the keys CKKS bootstrapping uses
clear_fhe_state()
Clear cached evaluation keys and contexts
with_fhe_context()
Execute code with automatic cleanup of FHE state
eval_sum_key_gen()
Generate sum keys for a secret key
eval_mult_key_gen()
Generate relinearization (eval-mult) keys for a secret key
eval_rotate_key_gen()
Generate rotation keys for a secret key
eval_at_index_key_gen()
Generate at-index (rotation) keys for a secret key
insert_eval_mult_key()
Insert an EvalMult key vector into the cc registry
insert_eval_sum_key()
Insert a joined sum-key map into the cc registry
insert_eval_automorphism_key()
Insert a joined automorphism-key map into the cc registry
clear_eval_mult_keys()
Clear the EvalMult key cache
clear_eval_automorphism_keys()
Clear the EvalAutomorphism key cache
get_all_eval_mult_keys()
Retrieve all registered EvalMult key vectors
get_eval_mult_key_vector()
Retrieve the EvalMult key vector for a given key tag
get_all_eval_automorphism_keys()
Retrieve all registered EvalAutomorphism key maps
get_eval_automorphism_key_map()
Retrieve the automorphism-key map for a given key tag
get_all_eval_sum_keys()
Retrieve all registered EvalSum key maps
get_eval_sum_key_map()
Retrieve the sum-key map for a given key tag

Threshold FHE

multiparty_key_gen()
Generate a key pair for a secondary party in threshold FHE
multiparty_decrypt_lead()
Lead party's partial decryption
multiparty_decrypt_main()
Non-lead party's partial decryption
multiparty_decrypt_fusion()
Fuse partial decryptions into final plaintext
threshold_decrypt()
Threshold decryption convenience: lead + main + fusion in one call
multi_add_pub_keys()
Combine public keys from multiple parties
multi_add_eval_keys()
Combine evaluation keys from multiple parties
multi_add_eval_mult_keys()
Combine partial eval-mult keys from multiple parties
multi_key_switch_gen()
Multi-party key-switch eval-key generation
multi_eval_sum_key_gen()
Generate a joint sum-key share for multi-party EvalSum
multi_eval_automorphism_key_gen()
Generate a joint automorphism-key share for multi-party rotation
multi_eval_at_index_key_gen()
Generate a joint rotation-at-index key share
multi_add_eval_sum_keys()
Combine two sum-key map shares into a joint sum-key map
multi_add_eval_automorphism_keys()
Combine two automorphism-key map shares
share_keys()
Distribute a secret key into shares
recover_shared_key()
Recover a secret key from distributed shares
EvalKey()
EvalKey class for multi-party key operations
EvalKeyMap()
Map of homomorphic evaluation keys
SecretShareMap()
Map of secret-key shares for threshold-FHE abort recovery

Binary FHE

bin_fhe_context()
Create a Binary FHE context
bin_key_gen()
Generate BinFHE secret key
bin_bt_key_gen()
Generate BinFHE bootstrapping keys
bin_encrypt()
Encrypt a value for Binary FHE
bin_decrypt()
Decrypt a Binary FHE ciphertext
eval_bin_gate()
Evaluate a binary gate on encrypted values
eval_not()
Evaluate NOT on an encrypted value
eval_sign()
Evaluate sign on an encrypted value (functional bootstrapping)
eval_func()
Evaluate an arbitrary function on an encrypted value
eval_floor()
Evaluate a floor (rounding) function on an LWE ciphertext
generate_lut_via_function()
Generate a lookup table for an arbitrary plaintext function
get_max_plaintext_space()
Maximum supported plaintext space for functional bootstrapping
bin_key_gen_pair() bin_pub_key_gen() bin_key_gen_n() bin_key_switch_gen()
Keys of the LWE scheme of a BinFHE context
switch_ct_to_qn()
Switch a public-key ciphertext to the small modulus and dimension
bin_bootstrap()
Bootstrap an LWE ciphertext
eval_constant()
A constant as an LWE ciphertext
eval_decomp()
Decompose a large-precision ciphertext into digits
get_bt_key() get_bt_key_map() bin_bt_key_load() bin_bt_key_map_load_single_element() bin_clear_bt_keys() get_switch_key() has_internal32_refresh_key() has_internal32_switch_key()
The bootstrapping keys of a BinFHE context
get_public_key()
The public key an object holds
get_n() get_big_n() get_q() get_big_q() get_beta()
Parameters of a BinFHE context
get_pt_modulus() set_modulus() set_pt_modulus()
Moduli of an LWE ciphertext
BinFHEContext()
BinFHE context (Binary FHE)
LWECiphertext()
LWE Ciphertext (Binary FHE)
LWEPrivateKey()
LWE Private Key (Binary FHE)
LWEPublicKey()
LWE public key (Binary FHE)
LWEKeyPair()
LWE key pair (Binary FHE)
LWESwitchingKey()
LWE switching key (Binary FHE)
RingGSWBTKey()
Bootstrapping key (Binary FHE)

Scheme switching

Switching between CKKS and FHEW ciphertexts, and the comparison, minimum and maximum built on it.

SchSwchParams() set_security_level_ckks() set_security_level_fhew() set_arbitrary_function_evaluation() set_use_dynamic_mode_fhew() set_compute_argmin() set_one_hot_encoding() set_use_alt_argmin() set_num_slots_ckks() set_num_values() set_ctxt_mod_size_fhew_large_prec() set_ctxt_mod_size_fhew_intermed_swch() set_b_step_ltr_ckks_to_fhew() set_b_step_ltr_fhew_to_ckks() set_level_ltr_ckks_to_fhew() set_level_ltr_fhew_to_ckks() set_ring_dimension() set_initial_ckks_modulus() set_params_from_ckks_cryptocontext_called() get_security_level_ckks() get_security_level_fhew() get_arbitrary_function_evaluation() get_use_dynamic_mode_fhew() get_compute_argmin() get_one_hot_encoding() get_use_alt_argmin() get_num_slots_ckks() get_num_values() get_ctxt_mod_size_fhew_large_prec() get_ctxt_mod_size_fhew_intermed_swch() get_b_step_ltr_ckks_to_fhew() get_b_step_ltr_fhew_to_ckks() get_level_ltr_ckks_to_fhew() get_level_ltr_fhew_to_ckks() get_ring_dimension() get_initial_ckks_modulus()
Parameters of scheme switching
eval_ckks_to_fhew_setup() eval_ckks_to_fhew_key_gen() eval_ckks_to_fhew_precompute() eval_ckks_to_fhew()
Switch a CKKS ciphertext to FHEW ciphertexts
eval_fhew_to_ckks_setup() eval_fhew_to_ckks_key_gen() eval_fhew_to_ckks()
Switch FHEW ciphertexts to a CKKS ciphertext
eval_scheme_switching_setup() eval_scheme_switching_key_gen() eval_compare_switch_precompute() eval_compare_scheme_switching() eval_min_scheme_switching() eval_min_scheme_switching_alt() eval_max_scheme_switching() eval_max_scheme_switching_alt()
Comparison, minimum and maximum through scheme switching
get_bin_cc_for_scheme_switch() set_bin_cc_for_scheme_switch() get_swk_fc() set_swk_fc()
The FHEW side of a scheme-switching context
set_params_from_ckks_cryptocontext()
Fill scheme-switching parameters from a CKKS context
SchemeSwitchingDataSerializer() SchemeSwitchingDataDeserializer() set_data_directory() serialize_scheme_switching_data() deserialize_scheme_switching_data() get_raw_ciphertext()
Write and read the data of a scheme-switching computation

Enums

Feature
PKE Scheme Features (bitmask)
SecurityLevel
Security Levels
ScalingTechnique
Scaling Techniques (CKKS)
KeySwitchTechnique
Key Switching Techniques
SecretKeyDist
Secret Key Distribution
BinFHEParamSet
Binary FHE Parameter Sets
BinFHEMethod
Binary FHE Methods
BinGate
Binary Gate Types
BinFHEOutput
Binary FHE Output Types
KeygenMode
Key Generation Mode
PlaintextEncodings
Plaintext Encoding Types
DistributionType
Distribution Type (lattice parameters)
MultipartyMode
Multiparty Mode
ExecutionMode
Execution Mode
DecryptionNoiseMode
Decryption Noise Mode
PREMode
Proxy Re-encryption Mode
MultiplicationTechnique
Multiplication Technique (BFV)
EncryptionTechnique
Encryption Technique
CKKSDataType
CKKS Data Type
CompressionLevel
Compression Level (interactive multi-party bootstrap)
SchemeId
Scheme Identifier

Functional bootstrapping

CKKS functional bootstrapping of RLWE ciphertexts: look-up tables, several tables on one input, and Fourier series.

eval_fbt_setup() eval_fbt() eval_fbt_no_decoding() eval_hom_decoding()
CKKS functional bootstrapping of a look-up table
eval_mvb_precompute() eval_mvb() eval_mvb_no_decoding()
Several look-up tables on one input (multi-value bootstrapping)
eval_hermite_trig_series()
Evaluate a trigonometric Hermite series on a ciphertext
eval_fe_func_bootstrap_setup() eval_fe_func_bootstrap() eval_fe_func_bootstrap_precompute() eval_fe_func_bootstrap_with_precomp()
CKKS functional bootstrapping of a Fourier series
get_hermite_trig_coefficients()
Trigonometric Hermite interpolation of a look-up table
get_fbt_depth() get_fefbt_depth()
Multiplicative depth of functional bootstrapping
schemelet_get_element_params() schemelet_encrypt_coeff() schemelet_decrypt_coeff() schemelet_mod_switch() schemelet_get_q_prime()
RLWE encryption under a CKKS secret key
schemelet_convert_rlwe_to_ckks() schemelet_convert_ckks_to_rlwe()
Convert between RLWE and CKKS ciphertexts
PolyVector() switch_modulus()
An RLWE ciphertext

Supporting types

ElementParams()
Element Parameters (opaque)
CryptoParameters()
Crypto Parameters (opaque)
EncodingParams()
Encoding Parameters (opaque)

Object accessors

get_modulus()
The ciphertext modulus
get_modulus_ckks() get_root_of_unity()
Moduli and root of unity of a CryptoContext
get_plaintext_generator()
The plaintext generator of an encoding
set_scheme_id()
Set the scheme identifier of a CryptoContext
serialized_object_name() serialized_version()
Name and version of a serialized object
clear_all_ckks_caches() clear_bootstrap_precom() clear_scheme_switch_precom()
Release the precomputations a CKKS context has cached
get_plaintext_for_decrypt()
An empty plaintext of the type a decryption will fill
get_existing_eval_automorphism_key_indices() get_eval_automorphism_no_key_indices() get_unique_values()
Which automorphism keys exist
clone() clone_empty()
Copy a ciphertext
number_ciphertext_elements() get_elements() get_elements_mutable() set_elements() set_elements_move() remove_element()
The ring elements of a ciphertext
get_hop_level() set_hop_level() set_encoding_type()
Hop level and encoding type of a ciphertext
encode() decode()
Encode or decode a plaintext
get_element_modulus() set_format()
Modulus and representation of a plaintext's element
DCRTPoly()
A ring element of a ciphertext
SchemeBase()
The scheme object of a CryptoContext
Format
Polynomial representation

CCParams getters

CCParams setters

Utilities

get_native_int()
Get the native integer size of the OpenFHE build
set_num_threads()
Set the number of OpenMP threads OpenFHE may use
get_num_threads()
Report the number of OpenMP threads available to OpenFHE
set_length()
Set the effective length of a plaintext
clear_static_maps_and_vectors()
Clear OpenFHE static maps and vectors
OpenFHEObject()
Base class for OpenFHE objects
ptr_is_valid()
Check if an external pointer is valid (non-NULL)
get_ptr()
Extract pointer with validation
openfhe.R openfhe.R-package
openfhe.R: R Interface to the 'OpenFHE' Fully Homomorphic Encryption Library

CKKS numerical tolerance

fhe_ckks_tolerance()
Per-test CKKS precision tolerance