multiply

GLEngine.multiply(x, y)
Returns the ciphertext resulting from the multiplication of two inputs. In general, consumes a level. If one of the inputs is an integer, the multiplication does not consume a level.
  • Input:
    • x: int, double or GLCiphertext
    • y: int, double or GLCiphertext
    • One of the inputs must be a GLCiphertext.
  • Output:
    • GLCiphertext

Examples

Multiplication of a ciphertext and a scalar

from desilofhe import GLEngine

engine = GLEngine()
shape = engine.shape
secret_key = engine.create_secret_key()

message1 = np.ones(shape, dtype=np.float64)
ciphertext = engine.encrypt(plaintext, secret_key)

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