key_switch_gen: Switch a ciphertext from one secret key to another

View source: R/key-switching.R

key_switch_genR Documentation

Switch a ciphertext from one secret key to another

Description

key_switch_gen() makes the key that switches ciphertexts under old_private_key to ciphertexts under new_private_key. key_switch() applies it and returns the switched ciphertext; key_switch_in_place() switches the ciphertext it is given.

Usage

key_switch_gen(cc, old_private_key, new_private_key)

key_switch(ct, eval_key)

key_switch_in_place(ct, eval_key)

Arguments

cc

A CryptoContext.

old_private_key, new_private_key

PrivateKey objects.

ct

A Ciphertext.

eval_key

The EvalKey from key_switch_gen().

Value

key_switch_gen(): an EvalKey. key_switch(): a Ciphertext. key_switch_in_place(): ct, invisibly.

See Also

re_key_gen() for the form that needs only the public key of the receiving party.


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