Learn R Programming

openfhe.R (version 1.6.1)

eval_poly: Evaluate a polynomial on a ciphertext

Description

Evaluates p(x) = c0 + c1x + c2x^2 + ... on encrypted x. Uses OpenFHE's default algorithm selector, which routes to eval_poly_linear() for degree < 5 and eval_poly_ps() (Paterson-Stockmeyer) for higher degrees. Call the variants directly to force one algorithm or the other — Linear is shallower for low-degree polynomials; PS has fewer multiplications for high-degree polynomials.

Usage

eval_poly(ct, coefficients)

Value

A Ciphertext

Arguments

ct

A Ciphertext

coefficients

Vector of polynomial coefficients, constant term first. An integer, double or complex vector; OpenFHE evaluates each type with its own arithmetic (integer coefficients as exact 64-bit integers, complex coefficients for a context with CKKSDataType$COMPLEX).

See Also

eval_poly_linear(), eval_poly_ps()