snark_verifier_sdk::halo2::aggregation

Function aggregate_snarks

Source
pub fn aggregate_snarks<AS>(
    pool: &mut SinglePhaseCoreManager<Fr>,
    range: &RangeChip<Fr>,
    svk: Svk,
    snarks: impl IntoIterator<Item = Snark>,
    universality: VerifierUniversality,
) -> SnarkAggregationOutput
where AS: for<'a> Halo2KzgAccumulationScheme<'a>,
Expand description

Given snarks, this populates the circuit builder with the virtual cells and constraints necessary to verify all the snarks.

§Notes

  • This function does not expose any public instances.
  • svk is the generator of the KZG trusted setup, usually gotten via params.get_g()[0] (avoids having to pass params into function just to get generator)

§Universality

  • If universality is not None, then the verifying keys of each snark in snarks is loaded as a witness in the circuit.
  • Moreover, if universality is Full, then the number of rows n of each snark in snarks is also loaded as a witness. In this case the generator omega of the order n multiplicative subgroup of F is also loaded as a witness.
  • By default, these witnesses are private and returned in `self.preprocessed_digests
  • The user can optionally modify the circuit after calling this function to add more instances to assigned_instances to expose.

§Warning

Will fail silently if snarks were created using a different multi-open scheme than AS where AS can be either crate::SHPLONK or crate::GWC (for original PLONK multi-open scheme)

§Assumptions

  • pool and range reference the same SharedCopyConstraintManager.