Learn R Programming

openfhe.R (version 1.6.1)

gen_crypto_context: Generate a CryptoContext from a parameter object

Description

The counterpart of OpenFHE's GenCryptoContext(parameters). It returns the context with no feature enabled; call enable_feature() for each feature the computation needs, as the OpenFHE examples do. fhe_context() does both steps in one call and enables the three features most computations use.

Usage

gen_crypto_context(params)

Value

A CryptoContext with no feature enabled.

Arguments

params

A BFVParams, BGVParams, or CKKSParams object.

See Also

fhe_context(), enable_feature(), ccparams_setters

Examples

Run this code
p <- BFVParams()
set_plaintext_modulus(p, 65537)
set_multiplicative_depth(p, 2L)
cc <- gen_crypto_context(p)
enable_feature(cc, Feature$PKE)
enable_feature(cc, Feature$KEYSWITCH)
enable_feature(cc, Feature$LEVELEDSHE)
ring_dimension(cc)

Run the code above in your browser using DataLab