create_multiparty_public_key

Engine.create_multiparty_public_key(public_key_bs, public_key_a, level)
Creates a common encryption key used for encryption in multiparty computation. Requires an array of public key bs and a public key a as inputs.
  • Input
    • public_key_bs: an array of PublicKeyBs
    • PublicKeyA
    • level: optional
      • Creates the key with a reduced size to contain only the specified multiplication levels.
  • Output
    • PublicKey
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)

level_3_public_key = engine.create_multiparty_public_key([public_key_b1, public_key_b2], public_key_a, level=3)