multiply_imaginary_integer
Engine.multiply_imaginary_integer(x, y)- Returns the ciphertext resulting from the multiplication of a ciphertext and a complex number whose real part is 0 and imaginary part is an integer. Does not consume any level.
- Input:
- x:
int | Ciphertext - y:
int | Ciphertext xandymust be passed as positional arguments.- One of the inputs must be a ciphertext. The other input is an integer value of the imaginary part.
- x:
- Output:
Ciphertext
Warning
- The matrix form does not yet support this operation.
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(message, public_key)
multiplied1 = engine.multiply_imaginary_integer(ciphertext, 2)
multiplied2 = engine.multiply_imaginary_integer(2, ciphertext)