create_fixed_roll_key

Engine.create_fixed_roll_key(secret_key, shift, axis, *, level)
Creates a fixed roll key used for roll by a specific shift value. Requires a secret key.
  • Input
    • SecretKey
    • shift: int. It is generated by modulo operation within the range [0~slot count).
    • axis: int | None. Specifies the roll axis for the matrix engine. Valid only for the matrix engine.
    • level: optional, keyword argument
      • Creates the key with a reduced size to contain only the specified multiplication levels.
  • Output
    • FixedRollKey
from desilofhe import Engine

engine = Engine()
secret_key = engine.create_secret_key()
fixed_roll_key = engine.create_fixed_roll_key(secret_key, shift=1)

level_3_fixed_roll_key = engine.create_fixed_roll_key(
    secret_key, shift=1, level=3
)
from desilofhe import Engine

matrix_engine = Engine(form="matrix")
secret_key = matrix_engine.create_secret_key()
axis_0_fixed_roll_key = matrix_engine.create_fixed_roll_key(
    secret_key, shift=1, axis=0
)

axis_1_level_3_fixed_roll_key = engine.create_fixed_roll_key(
    secret_key, shift=1, axis=1, level=3
)