create_multiparty_rotation_key
Engine.create_multiparty_rotation_key(rotation_keys, level)
- Creates a common rotation key used for general rotations in multiparty computation. Requires an array of individual rotation keys as input. The common rotation key is internally composed of common fixed rotation keys of size \(2^n\). The value of n ranges from
0
to log_coeff_count - 1
.
- Input
- rotation_keys: an array of RotationKeys
- level: optional
- Creates the key with a reduced size to contain only the specified multiplication levels.
- Output
from desilofhe import Engine
engine = Engine()
secret_key1 = engine.create_secret_key()
secret_key2 = engine.create_secret_key()
public_key_a = engine.create_public_key_a()
public_key_b1 = engine.create_public_key_b(secret_key1, public_key_a)
public_key_b2 = engine.create_public_key_b(secret_key2, public_key_a)
public_key = engine.create_multiparty_public_key(
[public_key_b1, public_key_b2], public_key_a
)
rotation_key1 = engine.create_individual_rotation_key(secret_key1, public_key)
rotation_key2 = engine.create_individual_rotation_key(secret_key2, public_key)
rotation_key = engine.create_multiparty_rotation_key(
[rotation_key1, rotation_key2]
)
level_3_rotation_key = engine.create_multiparty_rotation_key(
[rotation_key1, rotation_key2], level=3
)