Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::TranslatorFlavor Class Reference

#include <translator_flavor.hpp>

Classes

class  AllEntities
 A base class labelling all entities (for instance, all of the polynomials used by the prover during sumcheck) in this Honk variant along with particular subsets of interest. More...
 
class  AllValues
 A field element for each entity of the flavor. These entities represent the prover polynomials evaluated at one point. More...
 
class  CommitmentLabels
 A container for commitment labels. More...
 
class  DerivedWitnessEntities
 
class  InterleavedRangeConstraints
 
class  OrderedRangeConstraints
 
class  PartiallyEvaluatedMultivariates
 A container for storing the partially evaluated multivariates produced by sumcheck. More...
 
class  PrecomputedEntities
 A base class labelling precomputed entities and (ordered) subsets of interest. More...
 
class  ProverPolynomials
 A container for the prover polynomials handles. More...
 
class  ProvingKey
 The proving key is responsible for storing the polynomials used by the prover. More...
 
class  ShiftedEntities
 Represents polynomials shifted by 1 or their evaluations, defined relative to WireToBeShiftedEntities. More...
 
class  VerificationKey
 The verification key is responsible for storing the commitments to the precomputed (non-witnessk) polynomials used by the verifier. More...
 
class  VerifierCommitments_
 
class  WireNonshiftedEntities
 
class  WireToBeShiftedEntities
 
class  WitnessEntities
 Container for all witness polynomials used/constructed by the prover. More...
 

Public Types

using CircuitBuilder = TranslatorCircuitBuilder
 
using Curve = curve::BN254
 
using PCS = KZG< Curve >
 
using GroupElement = Curve::Element
 
using Commitment = Curve::AffineElement
 
using CommitmentKey = bb::CommitmentKey< Curve >
 
using VerifierCommitmentKey = bb::VerifierCommitmentKey< Curve >
 
using FF = Curve::ScalarField
 
using BF = Curve::BaseField
 
using Polynomial = bb::Polynomial< FF >
 
using Transcript = NativeTranscript
 
using GrandProductRelations = std::tuple< TranslatorPermutationRelation< FF > >
 
template<typename FF >
using Relations_ = std::tuple< TranslatorPermutationRelation< FF >, TranslatorDeltaRangeConstraintRelation< FF >, TranslatorOpcodeConstraintRelation< FF >, TranslatorAccumulatorTransferRelation< FF >, TranslatorDecompositionRelation< FF >, TranslatorNonNativeFieldRelation< FF >, TranslatorZeroConstraintsRelation< FF > >
 
using Relations = Relations_< FF >
 
using SubrelationSeparators = std::array< FF, NUM_SUBRELATIONS - 1 >
 
template<size_t LENGTH>
using ProverUnivariates = AllEntities< bb::Univariate< FF, LENGTH > >
 A container for univariates used during sumcheck.
 
using ExtendedEdges = ProverUnivariates< MAX_PARTIAL_RELATION_LENGTH >
 A container for univariates produced during the hot loop in sumcheck.
 
using VerifierCommitments = VerifierCommitments_< Commitment, VerificationKey >
 

Static Public Member Functions

static constexpr const std::array< FF, 5 > & negative_modulus_limbs ()
 
template<typename ProverPolynomialsOrPartiallyEvaluatedMultivariates , typename EdgeType >
static bool skip_entire_row (const ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const EdgeType edge_idx)
 When evaluating the sumcheck protocol - can we skip evaluation of all relations for a given row?
 

Static Public Attributes

static constexpr bool USE_SHORT_MONOMIALS = false
 
static constexpr bool HasZK = true
 
static constexpr bool USE_PADDING = false
 
static constexpr size_t NUM_OP_QUEUE_WIRES = 4
 
static constexpr size_t INTERLEAVING_GROUP_SIZE = 16
 
static constexpr size_t LOG_MINI_CIRCUIT_SIZE = 14
 
static constexpr size_t CONST_TRANSLATOR_LOG_N = LOG_MINI_CIRCUIT_SIZE + numeric::get_msb(INTERLEAVING_GROUP_SIZE)
 
static constexpr size_t VIRTUAL_LOG_N = CONST_TRANSLATOR_LOG_N
 
static constexpr size_t MINI_CIRCUIT_SIZE = 1UL << LOG_MINI_CIRCUIT_SIZE
 
static constexpr size_t NUM_INTERLEAVED_WIRES = 4
 
static constexpr size_t SORT_STEP = 3
 
static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES
 
static constexpr size_t RESULT_ROW = CircuitBuilder::RESULT_ROW
 
static constexpr size_t MICRO_LIMB_BITS = CircuitBuilder::MICRO_LIMB_BITS
 
static constexpr size_t SORTED_STEPS_COUNT = (1 << MICRO_LIMB_BITS) / SORT_STEP + 1
 
static constexpr size_t NUM_LIMB_BITS = CircuitBuilder::NUM_LIMB_BITS
 
static constexpr size_t MINIMUM_MINI_CIRCUIT_SIZE = 2048
 
static constexpr size_t NUM_ALL_ENTITIES = 187
 
static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 10
 
static constexpr size_t NUM_WITNESS_ENTITIES = 91
 
static constexpr size_t NUM_WIRES_NON_SHIFTED = 1
 
static constexpr size_t NUM_SHIFTED_WITNESSES = 86
 
static constexpr size_t NUM_INTERLEAVED = NUM_INTERLEAVED_WIRES * INTERLEAVING_GROUP_SIZE
 
static constexpr size_t NUM_WIRES_TO_BE_SHIFTED_WITHOUT_INTERLEAVED = 16
 
static constexpr size_t TO_BE_SHIFTED_WITNESSES_START = NUM_PRECOMPUTED_ENTITIES + NUM_WIRES_NON_SHIFTED
 
static constexpr size_t SHIFTED_WITNESSES_START = NUM_SHIFTED_WITNESSES + TO_BE_SHIFTED_WITNESSES_START
 
static constexpr size_t TO_BE_INTERLEAVED_START
 
static constexpr size_t INTERLEAVED_START = NUM_SHIFTED_WITNESSES + SHIFTED_WITNESSES_START
 
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
 
static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>()
 
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>()
 
static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>()
 
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 2
 
static constexpr size_t NUM_RELATIONS = std::tuple_size_v<Relations>
 
static constexpr size_t num_frs_comm = bb::field_conversion::calc_num_bn254_frs<Commitment>()
 
static constexpr size_t num_frs_fr = bb::field_conversion::calc_num_bn254_frs<FF>()
 
static constexpr size_t num_frs_fq = bb::field_conversion::calc_num_bn254_frs<BF>()
 
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS
 

Detailed Description

Definition at line 30 of file translator_flavor.hpp.

Member Typedef Documentation

◆ BF

◆ CircuitBuilder

◆ Commitment

◆ CommitmentKey

◆ Curve

◆ ExtendedEdges

A container for univariates produced during the hot loop in sumcheck.

Definition at line 866 of file translator_flavor.hpp.

◆ FF

◆ GrandProductRelations

◆ GroupElement

◆ PCS

Definition at line 35 of file translator_flavor.hpp.

◆ Polynomial

◆ ProverUnivariates

template<size_t LENGTH>
using bb::TranslatorFlavor::ProverUnivariates = AllEntities<bb::Univariate<FF, LENGTH> >

A container for univariates used during sumcheck.

Definition at line 861 of file translator_flavor.hpp.

◆ Relations

◆ Relations_

◆ SubrelationSeparators

Definition at line 159 of file translator_flavor.hpp.

◆ Transcript

◆ VerifierCommitmentKey

◆ VerifierCommitments

Member Function Documentation

◆ negative_modulus_limbs()

static constexpr const std::array< FF, 5 > & bb::TranslatorFlavor::negative_modulus_limbs ( )
inlinestaticconstexpr

Definition at line 100 of file translator_flavor.hpp.

◆ skip_entire_row()

template<typename ProverPolynomialsOrPartiallyEvaluatedMultivariates , typename EdgeType >
static bool bb::TranslatorFlavor::skip_entire_row ( const ProverPolynomialsOrPartiallyEvaluatedMultivariates &  polynomials,
const EdgeType  edge_idx 
)
inlinestatic

When evaluating the sumcheck protocol - can we skip evaluation of all relations for a given row?

When used in ClientIVC, the Translator has a large fixed size, which is often not fully utilized. If a row is completely empty, the values of z_perm and z_perm_shift will match, we can use this as a proxy to determine if we can skip Sumcheck::compute_univariate

Definition at line 1010 of file translator_flavor.hpp.

Member Data Documentation

◆ BATCHED_RELATION_PARTIAL_LENGTH

constexpr size_t bb::TranslatorFlavor::BATCHED_RELATION_PARTIAL_LENGTH = MAX_PARTIAL_RELATION_LENGTH + 2
staticconstexpr

Definition at line 168 of file translator_flavor.hpp.

◆ CONST_TRANSLATOR_LOG_N

constexpr size_t bb::TranslatorFlavor::CONST_TRANSLATOR_LOG_N = LOG_MINI_CIRCUIT_SIZE + numeric::get_msb(INTERLEAVING_GROUP_SIZE)
staticconstexpr

Definition at line 68 of file translator_flavor.hpp.

◆ HasZK

constexpr bool bb::TranslatorFlavor::HasZK = true
staticconstexpr

Definition at line 49 of file translator_flavor.hpp.

◆ INTERLEAVED_START

constexpr size_t bb::TranslatorFlavor::INTERLEAVED_START = NUM_SHIFTED_WITNESSES + SHIFTED_WITNESSES_START
staticconstexpr

Definition at line 137 of file translator_flavor.hpp.

◆ INTERLEAVING_GROUP_SIZE

constexpr size_t bb::TranslatorFlavor::INTERLEAVING_GROUP_SIZE = 16
staticconstexpr

Definition at line 61 of file translator_flavor.hpp.

◆ LOG_MINI_CIRCUIT_SIZE

constexpr size_t bb::TranslatorFlavor::LOG_MINI_CIRCUIT_SIZE = 14
staticconstexpr

Definition at line 65 of file translator_flavor.hpp.

◆ MAX_PARTIAL_RELATION_LENGTH

constexpr size_t bb::TranslatorFlavor::MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>()
staticconstexpr

Definition at line 161 of file translator_flavor.hpp.

◆ MAX_TOTAL_RELATION_LENGTH

constexpr size_t bb::TranslatorFlavor::MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>()
staticconstexpr

Definition at line 162 of file translator_flavor.hpp.

◆ MICRO_LIMB_BITS

constexpr size_t bb::TranslatorFlavor::MICRO_LIMB_BITS = CircuitBuilder::MICRO_LIMB_BITS
staticconstexpr

Definition at line 90 of file translator_flavor.hpp.

◆ MINI_CIRCUIT_SIZE

constexpr size_t bb::TranslatorFlavor::MINI_CIRCUIT_SIZE = 1UL << LOG_MINI_CIRCUIT_SIZE
staticconstexpr

Definition at line 73 of file translator_flavor.hpp.

◆ MINIMUM_MINI_CIRCUIT_SIZE

constexpr size_t bb::TranslatorFlavor::MINIMUM_MINI_CIRCUIT_SIZE = 2048
staticconstexpr

Definition at line 110 of file translator_flavor.hpp.

◆ NUM_ALL_ENTITIES

constexpr size_t bb::TranslatorFlavor::NUM_ALL_ENTITIES = 187
staticconstexpr

Definition at line 116 of file translator_flavor.hpp.

◆ num_frs_comm

constexpr size_t bb::TranslatorFlavor::num_frs_comm = bb::field_conversion::calc_num_bn254_frs<Commitment>()
staticconstexpr

Definition at line 173 of file translator_flavor.hpp.

◆ num_frs_fq

constexpr size_t bb::TranslatorFlavor::num_frs_fq = bb::field_conversion::calc_num_bn254_frs<BF>()
staticconstexpr

Definition at line 175 of file translator_flavor.hpp.

◆ num_frs_fr

constexpr size_t bb::TranslatorFlavor::num_frs_fr = bb::field_conversion::calc_num_bn254_frs<FF>()
staticconstexpr

Definition at line 174 of file translator_flavor.hpp.

◆ NUM_INTERLEAVED

constexpr size_t bb::TranslatorFlavor::NUM_INTERLEAVED = NUM_INTERLEAVED_WIRES * INTERLEAVING_GROUP_SIZE
staticconstexpr

Definition at line 124 of file translator_flavor.hpp.

◆ NUM_INTERLEAVED_WIRES

constexpr size_t bb::TranslatorFlavor::NUM_INTERLEAVED_WIRES = 4
staticconstexpr

Definition at line 76 of file translator_flavor.hpp.

◆ NUM_LIMB_BITS

constexpr size_t bb::TranslatorFlavor::NUM_LIMB_BITS = CircuitBuilder::NUM_LIMB_BITS
staticconstexpr

Definition at line 107 of file translator_flavor.hpp.

◆ NUM_OP_QUEUE_WIRES

constexpr size_t bb::TranslatorFlavor::NUM_OP_QUEUE_WIRES = 4
staticconstexpr

Definition at line 58 of file translator_flavor.hpp.

◆ NUM_PRECOMPUTED_ENTITIES

constexpr size_t bb::TranslatorFlavor::NUM_PRECOMPUTED_ENTITIES = 10
staticconstexpr

Definition at line 119 of file translator_flavor.hpp.

◆ NUM_RELATIONS

constexpr size_t bb::TranslatorFlavor::NUM_RELATIONS = std::tuple_size_v<Relations>
staticconstexpr

Definition at line 171 of file translator_flavor.hpp.

◆ NUM_SHIFTED_WITNESSES

constexpr size_t bb::TranslatorFlavor::NUM_SHIFTED_WITNESSES = 86
staticconstexpr

Definition at line 123 of file translator_flavor.hpp.

◆ NUM_SUBRELATIONS

constexpr size_t bb::TranslatorFlavor::NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>()
staticconstexpr

Definition at line 158 of file translator_flavor.hpp.

◆ NUM_WIRES

constexpr size_t bb::TranslatorFlavor::NUM_WIRES = CircuitBuilder::NUM_WIRES
staticconstexpr

Definition at line 82 of file translator_flavor.hpp.

◆ NUM_WIRES_NON_SHIFTED

constexpr size_t bb::TranslatorFlavor::NUM_WIRES_NON_SHIFTED = 1
staticconstexpr

Definition at line 122 of file translator_flavor.hpp.

◆ NUM_WIRES_TO_BE_SHIFTED_WITHOUT_INTERLEAVED

constexpr size_t bb::TranslatorFlavor::NUM_WIRES_TO_BE_SHIFTED_WITHOUT_INTERLEAVED = 16
staticconstexpr

Definition at line 126 of file translator_flavor.hpp.

◆ NUM_WITNESS_ENTITIES

constexpr size_t bb::TranslatorFlavor::NUM_WITNESS_ENTITIES = 91
staticconstexpr

Definition at line 121 of file translator_flavor.hpp.

◆ PROOF_LENGTH_WITHOUT_PUB_INPUTS

constexpr size_t bb::TranslatorFlavor::PROOF_LENGTH_WITHOUT_PUB_INPUTS
staticconstexpr
Initial value:
=
(NUM_SMALL_IPA_EVALUATIONS * num_frs_fr) +
static constexpr size_t num_frs_fq
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t num_frs_comm
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t CONST_TRANSLATOR_LOG_N
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t num_frs_fr

Definition at line 178 of file translator_flavor.hpp.

◆ REPEATED_COMMITMENTS

constexpr RepeatedCommitmentsData bb::TranslatorFlavor::REPEATED_COMMITMENTS
staticconstexpr
Initial value:

Definition at line 139 of file translator_flavor.hpp.

◆ RESULT_ROW

constexpr size_t bb::TranslatorFlavor::RESULT_ROW = CircuitBuilder::RESULT_ROW
staticconstexpr

Definition at line 87 of file translator_flavor.hpp.

◆ SHIFTED_WITNESSES_START

constexpr size_t bb::TranslatorFlavor::SHIFTED_WITNESSES_START = NUM_SHIFTED_WITNESSES + TO_BE_SHIFTED_WITNESSES_START
staticconstexpr

Definition at line 131 of file translator_flavor.hpp.

◆ SORT_STEP

constexpr size_t bb::TranslatorFlavor::SORT_STEP = 3
staticconstexpr

Definition at line 79 of file translator_flavor.hpp.

◆ SORTED_STEPS_COUNT

constexpr size_t bb::TranslatorFlavor::SORTED_STEPS_COUNT = (1 << MICRO_LIMB_BITS) / SORT_STEP + 1
staticconstexpr

Definition at line 94 of file translator_flavor.hpp.

◆ TO_BE_INTERLEAVED_START

constexpr size_t bb::TranslatorFlavor::TO_BE_INTERLEAVED_START
staticconstexpr

◆ TO_BE_SHIFTED_WITNESSES_START

constexpr size_t bb::TranslatorFlavor::TO_BE_SHIFTED_WITNESSES_START = NUM_PRECOMPUTED_ENTITIES + NUM_WIRES_NON_SHIFTED
staticconstexpr

Definition at line 129 of file translator_flavor.hpp.

◆ USE_PADDING

constexpr bool bb::TranslatorFlavor::USE_PADDING = false
staticconstexpr

Definition at line 51 of file translator_flavor.hpp.

◆ USE_SHORT_MONOMIALS

constexpr bool bb::TranslatorFlavor::USE_SHORT_MONOMIALS = false
staticconstexpr

Definition at line 46 of file translator_flavor.hpp.

◆ VIRTUAL_LOG_N

constexpr size_t bb::TranslatorFlavor::VIRTUAL_LOG_N = CONST_TRANSLATOR_LOG_N
staticconstexpr

Definition at line 71 of file translator_flavor.hpp.


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