Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::ClaimBatcher_< Curve > Struct Template Reference

Logic to support batching opening claims for unshifted and shifted polynomials in Shplemini. More...

#include <claim_batcher.hpp>

Classes

struct  Batch
 

Public Types

using Fr = typename Curve::ScalarField
 
using Commitment = typename Curve::AffineElement
 

Public Member Functions

Batch get_unshifted ()
 
Batch get_shifted ()
 
Fr get_unshifted_batch_scalar () const
 
void compute_scalars_for_each_batch (std::span< const Fr > inverted_vanishing_evals, const Fr &nu_challenge, const Fr &r_challenge)
 Compute scalars used to batch each set of claims, excluding contribution from batching challenge \rho.
 
void update_batch_mul_inputs_and_batched_evaluation (std::vector< Commitment > &commitments, std::vector< Fr > &scalars, Fr &batched_evaluation, const Fr &rho)
 Append the commitments and scalars from each batch of claims to the Shplemini vectors which subsequently will be inputs to the batch mul; update the batched evaluation and the running batching challenge (power of rho) in place.
 

Public Attributes

std::optional< Batchunshifted
 
std::optional< Batchshifted
 

Detailed Description

template<typename Curve>
struct bb::ClaimBatcher_< Curve >

Logic to support batching opening claims for unshifted and shifted polynomials in Shplemini.

Stores references to the commitments/evaluations of unshifted and shifted polynomials to be batch opened via Shplemini. Aggregates the commitments and batching scalars for each batch into the corresponding containers for Shplemini. Computes the batched evaluation. Contains logic for computing the per-batch scalars used to batch each set of claims (see details below).

Note
This class performs the actual batching of the evaluations but not of the commitments. The latter are simply appended to a larger container, along with the scalars used to batch them. This is because Shplemini is optimized to perform a single batch mul that includes all commitments from each stage of the PCS. See description of ShpleminiVerifier for more details.

Definition at line 26 of file claim_batcher.hpp.

Member Typedef Documentation

◆ Commitment

template<typename Curve >
using bb::ClaimBatcher_< Curve >::Commitment = typename Curve::AffineElement

Definition at line 28 of file claim_batcher.hpp.

◆ Fr

template<typename Curve >
using bb::ClaimBatcher_< Curve >::Fr = typename Curve::ScalarField

Definition at line 27 of file claim_batcher.hpp.

Member Function Documentation

◆ compute_scalars_for_each_batch()

template<typename Curve >
void bb::ClaimBatcher_< Curve >::compute_scalars_for_each_batch ( std::span< const Fr inverted_vanishing_evals,
const Fr nu_challenge,
const Fr r_challenge 
)
inline

Compute scalars used to batch each set of claims, excluding contribution from batching challenge \rho.

Computes scalars s_0, s_1 given by

\[ - s_0 = \left(\frac{1}{z-r} + \nu \times \frac{1}{z+r}\right) \]

,

  • s_1 = \frac{1}{r} \times \left(\frac{1}{z-r} - \nu \times \frac{1}{z+r}\right) \f] where the scalars used to batch the claims are given by

    \[ \left( - s_0, \ldots, - \rho^{i+k-1} \times s_0, - \rho^{i+k} \times s_1, \ldots, - \rho^{k+m-1} \times s_1 \right) \]

Parameters
inverse_vanishing_evals1/(z-r), 1/(z+r), 1/(z-r²), 1/(z+r²), ..., 1/(z-r^{2^{d-1}}), 1/(z+r^{2^{d-1}})
nu_challengeν (shplonk batching challenge)
r_challenger (gemini evaluation challenge)

Definition at line 68 of file claim_batcher.hpp.

◆ get_shifted()

template<typename Curve >
Batch bb::ClaimBatcher_< Curve >::get_shifted ( )
inline

Definition at line 41 of file claim_batcher.hpp.

◆ get_unshifted()

template<typename Curve >
Batch bb::ClaimBatcher_< Curve >::get_unshifted ( )
inline

Definition at line 40 of file claim_batcher.hpp.

◆ get_unshifted_batch_scalar()

template<typename Curve >
Fr bb::ClaimBatcher_< Curve >::get_unshifted_batch_scalar ( ) const
inline

Definition at line 43 of file claim_batcher.hpp.

◆ update_batch_mul_inputs_and_batched_evaluation()

template<typename Curve >
void bb::ClaimBatcher_< Curve >::update_batch_mul_inputs_and_batched_evaluation ( std::vector< Commitment > &  commitments,
std::vector< Fr > &  scalars,
Fr batched_evaluation,
const Fr rho 
)
inline

Append the commitments and scalars from each batch of claims to the Shplemini vectors which subsequently will be inputs to the batch mul; update the batched evaluation and the running batching challenge (power of rho) in place.

Parameters
commitmentscommitment inputs to the single Shplemini batch mul
scalarsscalar inputs to the single Shplemini batch mul
batched_evaluationrunning batched evaluation of the committed multilinear polynomials
rhomultivariate batching challenge \rho

Definition at line 95 of file claim_batcher.hpp.

Member Data Documentation

◆ shifted

template<typename Curve >
std::optional<Batch> bb::ClaimBatcher_< Curve >::shifted

Definition at line 38 of file claim_batcher.hpp.

◆ unshifted

template<typename Curve >
std::optional<Batch> bb::ClaimBatcher_< Curve >::unshifted

Definition at line 37 of file claim_batcher.hpp.


The documentation for this struct was generated from the following file: