square
Engine.sqaure(ciphertext, relinearization_key)
- Returns the square of the input ciphertext.
- Input:
- Ciphertext
- RelinearizationKey, optional
- If provided, the resulting ciphertext undergoes relinearization. This is recommended to facilitate subsequent operations.
- Output:
- Ciphertext
Examples
from desilofhe import Engine
engine = Engine()
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
relinearization_key = engine.create_relinearization_key(secret_key)
message = [1, 2, 3]
ciphertext = engine.encrypt(message, public_key)
squared = engine.square(ciphertext, relinearization_key)