Package org.logolith.kzgo
Class PolynomialInterpolator
java.lang.Object
org.logolith.kzgo.PolynomialInterpolator
Performs polynomial interpolation over a finite field using BigIntegers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigInteger[]interpolate(BigInteger[] evaluations, BigInteger modulus) Interpolates a polynomial P(x) given its evaluations P(0), P(1), ..., P(degree).
-
Constructor Details
-
PolynomialInterpolator
public PolynomialInterpolator()
-
-
Method Details
-
interpolate
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].
-