Skip to main content

Module lagrange

Module lagrange 

Source
Expand description

Lagrange interpolation in the P-256 scalar field.

Both DKG verification and signing combine T per-party values that were generated as evaluations of a degree-T-1 polynomial. The combination is a Lagrange-basis-weighted sum evaluated at x = 0:

f(0) = \sum_i \lambda_i \cdot y_i, where \lambda_i = \prod_{j \ne i} \frac{-x_j}{x_i - x_j} and x_k is party k’s 1-based roster index.

Functions§

lagrange_basis_scalar
Compute the Lagrange basis coefficient \lambda_i for evaluating the polynomial at x = 0, given the full set of participating x-coords xs and the specific coordinate xi.
lagrange_weighted_sum
Apply Lagrange interpolation at x = 0 to (x_i, y_i) pairs.