create_secret_key

Engine.create_secret_key(level)
Creates a secret key.
  • Input
    • level: optional
      • Creates the key with a reduced size to contain only the specified multiplication levels.
  • Output
    • SecretKey
from desilofhe import Engine

engine = Engine()
secret_key = engine.create_secret_key()

level_3_secret_key = engine.create_secret_key(level=3)
Engine.create_secret_key(secret, level)
Creates a custom secret key with the provided raw secret values.
  • Input
    • secret: a python list or numpy.ndarray.
      • Only int dtypes are supported.
      • The length should not exceed engine.slot_count * 2.
      • If the length is shorter than engine.slot_count * 2, the remainder will be filled with zeros.
    • level: optional
      • Creates the key with a reduced size to contain only the specified multiplication levels.
  • Output
    • SecretKey
from desilofhe import Engine

engine = Engine()
secret = np.ones(engine.slot_count * 2)
custom_secret_key = engine.create_secret_key(secret)

level_3_custom_secret_key = engine.create_secret_key(secret, level=3)