multiply_imaginary_integer

Engine.multiply_imaginary_integer(x, y)
Returns the ciphertext resulting from the multiplication a ciphertext and a complex number whose real part is 0 and imaginary part is an integer. This operation does not consume any mulitiplication level.
  • Input:
    • x: int or Ciphertext
    • y: int or Ciphertext
    • One of the inputs must be a ciphertext. The other input is an integer value of the imaginary part.
  • Output:
    • Ciphertext
from desilofhe import Engine

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

message = [1, 2, 3]
ciphertext = engine.encrypt(plaintext, public_key)

multiplied1 = engine.multiply_imaginary_integer(ciphertext, 2)
multiplied2 = engine.multiply_imaginary_integer(2, ciphertext)