Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ > Class Template Reference

A flexible, minimal test flavor for sumcheck testing. More...

#include <sumcheck_test_flavor.hpp>

Classes

class  AllEntities
 All entities combined. More...
 
class  AllValues
 Container for evaluations. More...
 
class  PartiallyEvaluatedMultivariates
 Partially evaluated multivariates for folded sumcheck. More...
 
class  PrecomputedEntities
 Precomputed polynomials (selectors) More...
 
class  ProverPolynomials
 Container for prover polynomials. More...
 
class  ShiftedEntities
 Shifted witness polynomials. More...
 
class  WitnessEntities
 Witness polynomials. More...
 

Public Types

using CircuitBuilder = UltraCircuitBuilder
 
using Curve = CurveType
 
using FF = typename Curve::ScalarField
 
using GroupElement = typename Curve::Element
 
using Commitment = typename Curve::AffineElement
 
using PCS = KZG< Curve >
 
using Polynomial = bb::Polynomial< FF >
 
using CommitmentKey = bb::CommitmentKey< Curve >
 
using VerifierCommitmentKey = bb::VerifierCommitmentKey< Curve >
 
using Transcript = NativeTranscript
 
template<typename FF_ >
using Relations_ = std::tuple< ArithmeticRelation< FF_ >, DependentTestRelation< FF_ > >
 
using Relations = Relations_< FF >
 
using SubrelationSeparator = FF
 
template<size_t LENGTH>
using ProverUnivariates = AllEntities< bb::Univariate< FF, LENGTH > >
 Container for univariates (used in sumcheck)
 
using ExtendedEdges = ProverUnivariates< MAX_PARTIAL_RELATION_LENGTH >
 Extended edges for sumcheck.
 

Static Public Attributes

static constexpr bool HasZK = HasZK_
 
static constexpr bool USE_SHORT_MONOMIALS = UseShortMonomials_
 
static constexpr bool USE_PADDING = false
 
static constexpr size_t NUM_WIRES = 4
 
static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 8
 
static constexpr size_t NUM_WITNESS_ENTITIES = 6
 
static constexpr size_t NUM_SHIFTED_ENTITIES = 2
 
static constexpr size_t NUM_ALL_ENTITIES = NUM_PRECOMPUTED_ENTITIES + NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES
 
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>()
 
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + (HasZK ? 3 : 1)
 
static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>()
 
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>
 
static constexpr bool has_zero_row = false
 

Detailed Description

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
class bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >

A flexible, minimal test flavor for sumcheck testing.

This flavor is designed to test sumcheck in isolation without dependencies on full Ultra complexity. It includes TWO relations:

  1. ArithmeticRelation - linearly independent (WILL be scaled by sumcheck)
  2. DependentTestRelation - linearly DEPENDENT (will NOT be scaled)

Tests can activate either or both relations via selectors.

Template Parameters
CurveTypeThe elliptic curve to use (BN254 or Grumpkin)
HasZK_Whether to use ZK sumcheck (adds masking rows)
UseShortMonomials_Whether to use short monomials (degree-1) or full barycentric extension

Benefits:

  • Tests are faster (only 16 entities vs 41 in UltraFlavor)
  • Tests are clearer (only essential relations)
  • No coupling to Ultra-specific features (lookups, permutations, etc.)
  • Template parameters allow all combinations (ZK + Grumpkin + FullBary, etc.)
  • Clean separation: one independent relation, one dependent relation

Example usage:

// Base flavor (BN254, non-ZK, short monomials)
// ZK variant
// Grumpkin with full barycentric extension
// In tests, activate relations via selectors:
prover_polynomials.q_arith = Polynomial({ 1, 1, 1, 1 }); // Activate arithmetic (independent)
prover_polynomials.q_test = Polynomial({ 1, 1, 1, 1 }); // Activate test relation (dependent)
A flexible, minimal test flavor for sumcheck testing.
bb::Polynomial< FF > Polynomial

Definition at line 143 of file sumcheck_test_flavor.hpp.

Member Typedef Documentation

◆ CircuitBuilder

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::CircuitBuilder = UltraCircuitBuilder

Definition at line 145 of file sumcheck_test_flavor.hpp.

◆ Commitment

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Commitment = typename Curve::AffineElement

Definition at line 149 of file sumcheck_test_flavor.hpp.

◆ CommitmentKey

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::CommitmentKey = bb::CommitmentKey<Curve>

Definition at line 152 of file sumcheck_test_flavor.hpp.

◆ Curve

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Curve = CurveType

Definition at line 146 of file sumcheck_test_flavor.hpp.

◆ ExtendedEdges

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::ExtendedEdges = ProverUnivariates<MAX_PARTIAL_RELATION_LENGTH>

Extended edges for sumcheck.

Definition at line 300 of file sumcheck_test_flavor.hpp.

◆ FF

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::FF = typename Curve::ScalarField

Definition at line 147 of file sumcheck_test_flavor.hpp.

◆ GroupElement

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::GroupElement = typename Curve::Element

Definition at line 148 of file sumcheck_test_flavor.hpp.

◆ PCS

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::PCS = KZG<Curve>

Definition at line 150 of file sumcheck_test_flavor.hpp.

◆ Polynomial

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Polynomial = bb::Polynomial<FF>

Definition at line 151 of file sumcheck_test_flavor.hpp.

◆ ProverUnivariates

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
template<size_t LENGTH>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::ProverUnivariates = AllEntities<bb::Univariate<FF, LENGTH> >

Container for univariates (used in sumcheck)

Definition at line 295 of file sumcheck_test_flavor.hpp.

◆ Relations

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Relations = Relations_<FF>

Definition at line 177 of file sumcheck_test_flavor.hpp.

◆ Relations_

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
template<typename FF_ >
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Relations_ = std::tuple<ArithmeticRelation<FF_>, DependentTestRelation<FF_> >

Definition at line 176 of file sumcheck_test_flavor.hpp.

◆ SubrelationSeparator

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::SubrelationSeparator = FF

Definition at line 188 of file sumcheck_test_flavor.hpp.

◆ Transcript

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::Transcript = NativeTranscript

Definition at line 154 of file sumcheck_test_flavor.hpp.

◆ VerifierCommitmentKey

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
using bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::VerifierCommitmentKey = bb::VerifierCommitmentKey<Curve>

Definition at line 153 of file sumcheck_test_flavor.hpp.

Member Data Documentation

◆ BATCHED_RELATION_PARTIAL_LENGTH

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + (HasZK ? 3 : 1)
staticconstexpr

Definition at line 185 of file sumcheck_test_flavor.hpp.

◆ has_zero_row

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr bool bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::has_zero_row = false
staticconstexpr

Definition at line 190 of file sumcheck_test_flavor.hpp.

◆ HasZK

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr bool bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::HasZK = HasZK_
staticconstexpr

Definition at line 157 of file sumcheck_test_flavor.hpp.

◆ MAX_PARTIAL_RELATION_LENGTH

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>()
staticconstexpr

Definition at line 179 of file sumcheck_test_flavor.hpp.

◆ NUM_ALL_ENTITIES

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_ALL_ENTITIES = NUM_PRECOMPUTED_ENTITIES + NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES
staticconstexpr

Definition at line 170 of file sumcheck_test_flavor.hpp.

◆ NUM_PRECOMPUTED_ENTITIES

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_PRECOMPUTED_ENTITIES = 8
staticconstexpr

Definition at line 167 of file sumcheck_test_flavor.hpp.

◆ NUM_RELATIONS

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_RELATIONS = std::tuple_size_v<Relations>
staticconstexpr

Definition at line 187 of file sumcheck_test_flavor.hpp.

◆ NUM_SHIFTED_ENTITIES

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_SHIFTED_ENTITIES = 2
staticconstexpr

Definition at line 169 of file sumcheck_test_flavor.hpp.

◆ NUM_SUBRELATIONS

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>()
staticconstexpr

Definition at line 186 of file sumcheck_test_flavor.hpp.

◆ NUM_WIRES

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_WIRES = 4
staticconstexpr

Definition at line 160 of file sumcheck_test_flavor.hpp.

◆ NUM_WITNESS_ENTITIES

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr size_t bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::NUM_WITNESS_ENTITIES = 6
staticconstexpr

Definition at line 168 of file sumcheck_test_flavor.hpp.

◆ USE_PADDING

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr bool bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::USE_PADDING = false
staticconstexpr

Definition at line 159 of file sumcheck_test_flavor.hpp.

◆ USE_SHORT_MONOMIALS

template<typename CurveType = curve::BN254, bool HasZK_ = false, bool UseShortMonomials_ = true>
constexpr bool bb::SumcheckTestFlavor_< CurveType, HasZK_, UseShortMonomials_ >::USE_SHORT_MONOMIALS = UseShortMonomials_
staticconstexpr

Definition at line 158 of file sumcheck_test_flavor.hpp.


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