eval_poly: Evaluate a polynomial on a ciphertext

View source: R/methods-ckks.R

eval_polyR Documentation

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)

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).

Value

A Ciphertext

See Also

eval_poly_linear(), eval_poly_ps()


openfhe.R documentation built on Nov. 13, 2026, 5:07 p.m.