key_gen: Generate key pair

key_genR Documentation

Generate key pair

Description

Generate key pair

Usage

key_gen(cc, ...)

Arguments

cc

A CryptoContext

...

Method-specific arguments (eval_mult, rotations)

Value

A KeyPair

Examples

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

openfhe.R documentation built on Nov. 13, 2026, 5:07 p.m.