Function poly_commitment::utils::combine_polys
source · pub fn combine_polys<G: CommitmentCurve, D: EvaluationDomain<G::ScalarField>>(
plnms: &'_ [(DensePolynomialOrEvaluations<'_, G::ScalarField, D>, PolyComm<G::ScalarField>)],
polyscale: G::ScalarField,
srs_length: usize
) -> (DensePolynomial<G::ScalarField>, G::ScalarField)
Expand description
Combine the polynomials using a scalar (polyscale
), creating a single
unified polynomial to open. This function also accepts polynomials in
evaluations form. In this case it applies an IFFT, and, if necessarry,
applies chunking to it (ie. split it in multiple polynomials of
degree less than the SRS size).
Parameters:
plnms
: vector of polynomials, either in evaluations or coefficients form, together with a set of scalars representing their blinders.polyscale
: scalar to combine the polynomials, which will be scaled based on the number of polynomials to combine.
Output:
combined_poly
: combined polynomial. The order of the output follows the order ofplnms
.combined_comm
: combined scalars representing the blinder commitment.
Example:
Given the three polynomials p1(X)
, and p3(X)
in coefficients
forms, p2(X) in evaluation form,
and the scaling factor polyscale
, the result will be the polynomial:
p1(X) + polyscale * i_fft(chunks(p2))(X) + polyscale^2 p3(X)
Additional complexity is added to handle chunks.