make_power_basis
Engine.make_power_basis(ciphertext, max_power, relineraization_key)
- Make a power basis, which is \([x, x^2, \dots, x^{max\_power}]\) for the given ciphertext \(x\).
- Input:
- Ciphertext
- max_power: the maximum power of the power basis
- RelinearizationKey
- Output:
- power_basis: an array of Ciphertexts
from liberate 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)
power_basis = engine.make_power_basis(
ciphertext, max_power=3, relinearization_key
)