Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::SumcheckVerifierRound< Flavor, CommittedSumcheck > Class Template Reference

Implementation of the Sumcheck Verifier Round. More...

#include <sumcheck_round.hpp>

Public Types

using ClaimedEvaluations = typename Flavor::AllValues
 
using ClaimedLibraEvaluations = typename std::vector< FF >
 
using Transcript = typename Flavor::Transcript
 
using Commitment = typename Flavor::Commitment
 
using SumcheckRoundUnivariate = bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH >
 

Public Member Functions

 SumcheckVerifierRound (FF target_total_sum=0)
 
void check_sum (bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &univariate)
 Check that the round target sum is correct.
 
void compute_next_target_sum (bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &univariate, FF &round_challenge)
 Compute the next target sum.
 
FF compute_full_relation_purported_value (const ClaimedEvaluations &purported_evaluations, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas, std::span< const FF > multivariate_challenge={})
 Evaluate the full Honk relation at the sumcheck challenge u.
 
void process_round (const std::shared_ptr< Transcript > &transcript, std::vector< FF > &multivariate_challenge, bb::GateSeparatorPolynomial< FF > &gate_separators, size_t round_idx)
 Process a single sumcheck round: receive univariate from transcript, verify sum, generate challenge.
 
bool perform_final_verification (const FF &full_honk_purported_value)
 Perform final verification: check that the computed target sum matches the full relation evaluation. i.e. the final evaluation check.
 
std::vector< Commitmentget_round_univariate_commitments ()
 Get round univariate commitments (only used for Grumpkin flavors).
 
std::vector< std::array< FF, 3 > > get_round_univariate_evaluations ()
 Get round univariate evaluations (only used for Grumpkin flavors).
 

Public Attributes

bool round_failed = false
 
FF target_total_sum = 0
 
TupleOfArraysOfValues relation_evaluations
 

Static Public Attributes

static constexpr size_t NUM_RELATIONS = Flavor::NUM_RELATIONS
 
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = Flavor::BATCHED_RELATION_PARTIAL_LENGTH
 

Private Types

using FF = typename Flavor::FF
 
using Utils = bb::RelationUtils< Flavor >
 
using Relations = typename Flavor::Relations
 
using TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values< typename Flavor::Relations >())
 
using SubrelationSeparators = std::array< FF, Flavor::NUM_SUBRELATIONS - 1 >
 

Detailed Description

template<typename Flavor, bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
class bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >

Implementation of the Sumcheck Verifier Round.

This Flavor contains the methods

  • Check target sum: \(\quad \sigma_{ i } \stackrel{?}{=} \tilde{S}^i(0) + \tilde{S}^i(1) \)
  • Compute next targetsum" : \( \quad \sigma_{i+1} \gets \tilde{S}^i(u_i) \) required in Round \( i = 0,\ldots, d-1 \).

The last step of the verifification requires to compute the value \( pow(u_0,\ldots, u_{d-1}) \cdot F \left(P_1(u_0,\ldots, u_{d-1}), \ldots, P_N(u_0,\ldots, u_{d-1}) \right) \) implemented as

Definition at line 1131 of file sumcheck_round.hpp.

Member Typedef Documentation

◆ ClaimedEvaluations

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::ClaimedEvaluations = typename Flavor::AllValues

Definition at line 1139 of file sumcheck_round.hpp.

◆ ClaimedLibraEvaluations

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::ClaimedLibraEvaluations = typename std::vector<FF>

Definition at line 1140 of file sumcheck_round.hpp.

◆ Commitment

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::Commitment = typename Flavor::Commitment

Definition at line 1142 of file sumcheck_round.hpp.

◆ FF

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::FF = typename Flavor::FF
private

Definition at line 1132 of file sumcheck_round.hpp.

◆ Relations

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::Relations = typename Flavor::Relations
private

Definition at line 1134 of file sumcheck_round.hpp.

◆ SubrelationSeparators

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::SubrelationSeparators = std::array<FF, Flavor::NUM_SUBRELATIONS - 1>
private

Definition at line 1136 of file sumcheck_round.hpp.

◆ SumcheckRoundUnivariate

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::SumcheckRoundUnivariate = bb::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>

Definition at line 1147 of file sumcheck_round.hpp.

◆ Transcript

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::Transcript = typename Flavor::Transcript

Definition at line 1141 of file sumcheck_round.hpp.

◆ TupleOfArraysOfValues

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values<typename Flavor::Relations>())
private

Definition at line 1135 of file sumcheck_round.hpp.

◆ Utils

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
using bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::Utils = bb::RelationUtils<Flavor>
private

Definition at line 1133 of file sumcheck_round.hpp.

Constructor & Destructor Documentation

◆ SumcheckVerifierRound()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::SumcheckVerifierRound ( FF  target_total_sum = 0)
inlineexplicit

Definition at line 1152 of file sumcheck_round.hpp.

Member Function Documentation

◆ check_sum()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
void bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::check_sum ( bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &  univariate)
inline

Check that the round target sum is correct.

Definition at line 1161 of file sumcheck_round.hpp.

◆ compute_full_relation_purported_value()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
FF bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::compute_full_relation_purported_value ( const ClaimedEvaluations purported_evaluations,
const bb::RelationParameters< FF > &  relation_parameters,
const bb::GateSeparatorPolynomial< FF > &  gate_separators,
const SubrelationSeparators alphas,
std::span< const FF multivariate_challenge = {} 
)
inline

Evaluate the full Honk relation at the sumcheck challenge u.

Row-disabling gating is internal: for UseRowDisablingPolynomial<Flavor> && Flavor::HasZK, main-domain rels are scaled by (1 - L)(u) and offset-only rels by L(u); otherwise factors collapse to (1, 0) (offset-only rels drop out).

Definition at line 1198 of file sumcheck_round.hpp.

◆ compute_next_target_sum()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
void bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::compute_next_target_sum ( bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &  univariate,
FF round_challenge 
)
inline

Compute the next target sum.

Definition at line 1186 of file sumcheck_round.hpp.

◆ get_round_univariate_commitments()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
std::vector< Commitment > bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::get_round_univariate_commitments ( )
inline

Get round univariate commitments (only used for Grumpkin flavors).

Definition at line 1263 of file sumcheck_round.hpp.

◆ get_round_univariate_evaluations()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
std::vector< std::array< FF, 3 > > bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::get_round_univariate_evaluations ( )
inline

Get round univariate evaluations (only used for Grumpkin flavors).

Definition at line 1268 of file sumcheck_round.hpp.

◆ perform_final_verification()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
bool bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::perform_final_verification ( const FF full_honk_purported_value)
inline

Perform final verification: check that the computed target sum matches the full relation evaluation. i.e. the final evaluation check.

Definition at line 1248 of file sumcheck_round.hpp.

◆ process_round()

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
void bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::process_round ( const std::shared_ptr< Transcript > &  transcript,
std::vector< FF > &  multivariate_challenge,
bb::GateSeparatorPolynomial< FF > &  gate_separators,
size_t  round_idx 
)
inline

Process a single sumcheck round: receive univariate from transcript, verify sum, generate challenge.

  1. gets the round univariate and round challenge
  2. checks the consistency of the new round univariate with respect to the one from the previous round
  3. updates the target for the next consistency check

Definition at line 1224 of file sumcheck_round.hpp.

Member Data Documentation

◆ BATCHED_RELATION_PARTIAL_LENGTH

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
constexpr size_t bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::BATCHED_RELATION_PARTIAL_LENGTH = Flavor::BATCHED_RELATION_PARTIAL_LENGTH
staticconstexpr

Definition at line 1146 of file sumcheck_round.hpp.

◆ NUM_RELATIONS

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
constexpr size_t bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::NUM_RELATIONS = Flavor::NUM_RELATIONS
staticconstexpr

Definition at line 1145 of file sumcheck_round.hpp.

◆ relation_evaluations

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
TupleOfArraysOfValues bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::relation_evaluations

Definition at line 1150 of file sumcheck_round.hpp.

◆ round_failed

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
bool bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::round_failed = false

Definition at line 1144 of file sumcheck_round.hpp.

◆ target_total_sum

template<typename Flavor , bool CommittedSumcheck = UsesCommittedSumcheck<Flavor>>
FF bb::SumcheckVerifierRound< Flavor, CommittedSumcheck >::target_total_sum = 0

Definition at line 1149 of file sumcheck_round.hpp.


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