Learn R Programming

openfhe.R (version 1.6.1)

key_gen: Generate key pair

Description

Generate key pair

Usage

key_gen(cc, ...)

Value

A KeyPair

Arguments

cc

A CryptoContext

...

Method-specific arguments (eval_mult, rotations)

Examples

Run this code
cc <- fhe_context("CKKS", multiplicative_depth = 2L,
                  scaling_mod_size = 50L, batch_size = 8L)

## Encryption keys only:
kp <- key_gen(cc)
kp

## Also generate the relinearization key homomorphic multiplication
## needs and the rotation keys for shifts by one slot either way.
## These are stored inside the context, not in the returned pair.
kp <- key_gen(cc, eval_mult = TRUE, rotations = c(1L, -1L))
kp@public
kp@secret

Run the code above in your browser using DataLab