Class PolynomialInterpolator

java.lang.Object
org.logolith.kzgo.PolynomialInterpolator

public class PolynomialInterpolator extends Object
Performs polynomial interpolation over a finite field using BigIntegers.
  • Constructor Details

    • PolynomialInterpolator

      public PolynomialInterpolator()
  • Method Details

    • interpolate

      public static BigInteger[] interpolate(BigInteger[] evaluations, BigInteger modulus)
      Interpolates a polynomial P(x) given its evaluations P(0), P(1), ..., P(degree). Uses Lagrange interpolation: P(x) = sum_{j=0}^{degree} evaluations[j] * L_j(x)
      Parameters:
      evaluations - Array of evaluations P(0), P(1), ... P(degree).
      modulus - The field modulus.
      Returns:
      The coefficients of the interpolated polynomial [c0, c1, ..., c_degree].