evaluate_chebyshev_polynomial
Engine.evaluate_chebyshev_polynomial(ciphertext, coefficients, relinearization_key)
- Evaluate a chebyshev polynomial of input coefficients with an input ciphertext.
This evaluates \(a_0 + a_1T_1(x) + a_2T_2(x) + \cdots + a_nT_n(x)\) for a given ciphertext \(x\) and given coefficients \([a_0, a_1, \dots, a_n]\), where \(T_n(x)\) is the \(n\)th Chebyshev polynomial.
- Input:
- Ciphertext
- coefficients: an array of int or double
- RelinearizationKey
- Output:
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)
coefficients = [7, 8, 9]
polynomial = engine.evaluate_chebyshev_polynomial(
ciphertext, coefficients, relinearization_key
)