bin_encrypt: Encrypt a value for Binary FHE

View source: R/binfhe.R

bin_encryptR Documentation

Encrypt a value for Binary FHE

Description

Encrypt a value for Binary FHE

Usage

bin_encrypt(
  ctx,
  sk,
  message,
  output = BinFHEOutput$BOOTSTRAPPED,
  p = 4L,
  mod = NULL
)

Arguments

ctx

A BinFHE context

sk

An LWEPrivateKey, or an LWEPublicKey to encrypt under the public key.

message

Integer (0 or 1 for Boolean; larger for integer FHE)

output

An element of BinFHEOutput (default: BinFHEOutput$BOOTSTRAPPED). Use BinFHEOutput$LARGE_DIM together with mod for the functional-bootstrapping path. With a public key the default is BinFHEOutput$SMALL_DIM, as in openfhe-python, which needs the switching key that bin_bt_key_gen() generates.

p

Plaintext modulus (default: 4)

mod

Optional large ciphertext modulus Q for the LARGE_DIM path. NULL (default) selects the standard small-modulus encrypt. A whole number of at most 2^53, or a string of decimal digits for a larger value.

Value

An LWECiphertext


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