Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::SumcheckVerifierRound< Flavor, IsGrumpkin > 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, const FF &indicator)
 Check that the round target sum is correct.
 
void compute_next_target_sum (bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &univariate, FF &round_challenge, const FF &indicator)
 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)
 Compute the full relation purported value.
 
void process_round (const std::shared_ptr< Transcript > &transcript, std::vector< FF > &multivariate_challenge, bb::GateSeparatorPolynomial< FF > &gate_separators, const FF &padding_indicator, 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 IsGrumpkin = IsGrumpkinFlavor<Flavor>>
class bb::SumcheckVerifierRound< Flavor, IsGrumpkin >

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 770 of file sumcheck_round.hpp.

Member Typedef Documentation

◆ ClaimedEvaluations

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::ClaimedEvaluations = typename Flavor::AllValues

Definition at line 778 of file sumcheck_round.hpp.

◆ ClaimedLibraEvaluations

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

Definition at line 779 of file sumcheck_round.hpp.

◆ Commitment

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::Commitment = typename Flavor::Commitment

Definition at line 781 of file sumcheck_round.hpp.

◆ FF

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::FF = typename Flavor::FF
private

Definition at line 771 of file sumcheck_round.hpp.

◆ Relations

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::Relations = typename Flavor::Relations
private

Definition at line 773 of file sumcheck_round.hpp.

◆ SubrelationSeparators

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

Definition at line 775 of file sumcheck_round.hpp.

◆ SumcheckRoundUnivariate

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

Definition at line 786 of file sumcheck_round.hpp.

◆ Transcript

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::Transcript = typename Flavor::Transcript

Definition at line 780 of file sumcheck_round.hpp.

◆ TupleOfArraysOfValues

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

Definition at line 774 of file sumcheck_round.hpp.

◆ Utils

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
using bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::Utils = bb::RelationUtils<Flavor>
private

Definition at line 772 of file sumcheck_round.hpp.

Constructor & Destructor Documentation

◆ SumcheckVerifierRound()

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

Definition at line 791 of file sumcheck_round.hpp.

Member Function Documentation

◆ check_sum()

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
void bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::check_sum ( bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &  univariate,
const FF indicator 
)
inline

Check that the round target sum is correct.

Definition at line 800 of file sumcheck_round.hpp.

◆ compute_full_relation_purported_value()

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
FF bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::compute_full_relation_purported_value ( const ClaimedEvaluations purported_evaluations,
const bb::RelationParameters< FF > &  relation_parameters,
const bb::GateSeparatorPolynomial< FF > &  gate_separators,
const SubrelationSeparators alphas 
)
inline

Compute the full relation purported value.

Definition at line 829 of file sumcheck_round.hpp.

◆ compute_next_target_sum()

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
void bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::compute_next_target_sum ( bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &  univariate,
FF round_challenge,
const FF indicator 
)
inline

Compute the next target sum.

Definition at line 819 of file sumcheck_round.hpp.

◆ get_round_univariate_commitments()

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

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

Definition at line 887 of file sumcheck_round.hpp.

◆ get_round_univariate_evaluations()

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

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

Definition at line 892 of file sumcheck_round.hpp.

◆ perform_final_verification()

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
bool bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::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 872 of file sumcheck_round.hpp.

◆ process_round()

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
void bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::process_round ( const std::shared_ptr< Transcript > &  transcript,
std::vector< FF > &  multivariate_challenge,
bb::GateSeparatorPolynomial< FF > &  gate_separators,
const FF padding_indicator,
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 847 of file sumcheck_round.hpp.

Member Data Documentation

◆ BATCHED_RELATION_PARTIAL_LENGTH

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
constexpr size_t bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::BATCHED_RELATION_PARTIAL_LENGTH = Flavor::BATCHED_RELATION_PARTIAL_LENGTH
staticconstexpr

Definition at line 785 of file sumcheck_round.hpp.

◆ NUM_RELATIONS

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
constexpr size_t bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::NUM_RELATIONS = Flavor::NUM_RELATIONS
staticconstexpr

Definition at line 784 of file sumcheck_round.hpp.

◆ relation_evaluations

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
TupleOfArraysOfValues bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::relation_evaluations

Definition at line 789 of file sumcheck_round.hpp.

◆ round_failed

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
bool bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::round_failed = false

Definition at line 783 of file sumcheck_round.hpp.

◆ target_total_sum

template<typename Flavor , bool IsGrumpkin = IsGrumpkinFlavor<Flavor>>
FF bb::SumcheckVerifierRound< Flavor, IsGrumpkin >::target_total_sum = 0

Definition at line 788 of file sumcheck_round.hpp.


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