Skip to main content

combine_commitments

Function combine_commitments 

Source
pub fn combine_commitments<G: CommitmentCurve>(
    evaluations: &[Evaluation<G>],
    scalars: &mut Vec<G::ScalarField>,
    points: &mut Vec<G>,
    polyscale: G::ScalarField,
    rand_base: G::ScalarField,
)
Expand description

Populates the parameters scalars and points.

It iterates over the evaluations and adds each commitment to the vector points. The parameter scalars is populated with the values: rand_base * polyscale^i for each commitment. For instance, if we have 3 commitments, the scalars vector will contain the values

[rand_base, rand_base * polyscale, rand_base * polyscale^2]

and the vector points will contain the commitments.

Note that the function skips the commitments that are empty.

If more than one commitment is present in a single evaluation (i.e. if elems is larger than one), it means that probably chunking was used (i.e. it is a commitment to a polynomial larger than the SRS).