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

Entry point for Barretenberg command-line interface. More...

Namespaces

namespace  acir_bincode_mocks
 
namespace  avm2
 
namespace  bbapi
 
namespace  benchmark
 
namespace  crypto
 
namespace  curve
 
namespace  detail
 
namespace  eccvm
 
namespace  field_conversion
 
namespace  field_conversion_tests
 
namespace  gemini
 Prover output (evalutation pair, witness) that can be passed on to Shplonk batch opening.
 
namespace  group_elements
 
namespace  grumpkin
 
namespace  lmdblib
 
namespace  merkle
 
namespace  messaging
 
namespace  mock_circuits
 
namespace  nodejs
 
namespace  numeric
 
namespace  pairing
 
namespace  plookup
 
namespace  polynomial_arithmetic
 
namespace  proving_key_inspector
 
namespace  scalar_multiplication
 
namespace  secp256k1
 
namespace  secp256r1
 
namespace  srs
 
namespace  starknet
 
namespace  stdlib
 
namespace  thread_heuristics
 
namespace  transform
 
namespace  utils
 
namespace  wnaf
 
namespace  world_state
 

Classes

struct  accumulator_triple_
 
struct  ActiveRegionData
 
struct  add_quad_
 
struct  add_triple_
 
class  API
 
class  BarycentricDataCompileTime
 
class  BarycentricDataRunTime
 
class  BaseTranscript
 Common transcript class for both parties. Stores the data for the current round, as well as the manifest. More...
 
class  BatchedAffineAddition
 Class for handling fast batched affine addition of large sets of EC points. More...
 
class  BatchedAffineAdditionTests
 
struct  BatchOpeningClaim
 An accumulator consisting of the Shplonk evaluation challenge and vectors of commitments and scalars. More...
 
struct  Bn254Fq12Params
 
struct  Bn254Fq2Params
 
struct  Bn254Fq6Params
 
class  Bn254FqParams
 
class  Bn254FrParams
 
struct  Bn254G1Params
 
struct  Bn254G2Params
 
class  BN254Settings
 Mock Flavors to use ZKSumcheckData and SmallSubgroupIPAProver in the PCS tests. More...
 
struct  BusVector
 A DataBus column. More...
 
class  CircuitBuilderBase
 
class  CircuitChecker
 The unified interface for check circuit functionality implemented in the specialized CircuitChecker classes. More...
 
struct  CircuitSchemaInternal
 Serialized state of a circuit. More...
 
struct  ClaimBatcher_
 Logic to support batching opening claims for unshifted and shifted polynomials in Shplemini. More...
 
class  ClientIVC
 The IVC scheme used by the aztec client for private function execution. More...
 
class  ClientIVCAPI
 
class  CommitmentKey
 CommitmentKey object over a pairing group 𝔾₁. More...
 
class  CommitmentKeyTest
 
class  CommitmentTest
 
class  ContainerSlabAllocator
 
struct  cycle_node
 cycle_node represents the idx of a value of the circuit. It will belong to a CyclicPermutation, such that all nodes in a CyclicPermutation must have the value. The total number of constraints is always <2^32 since that is the type used to represent variables, so we can save space by using a type smaller than size_t. More...
 
struct  databus_lookup_gate_
 
class  DatabusLookupRelationImpl
 Log-derivative lookup argument relation for establishing DataBus reads. More...
 
class  DeciderProver_
 
class  DeciderProvingKey_
 A DeciderProvingKey is normally constructed from a finalized circuit and it contains all the information required by an Mega Honk prover to create a proof. A DeciderProvingKey is also the result of running the Protogalaxy prover, in which case it becomes a relaxed counterpart with the folding parameters (target sum and gate challenges set to non-zero values). More...
 
struct  DeciderProvingKeys_
 
class  DeciderVerificationKey_
 The DeciderVerificationKey encapsulates all the necessary information for a Mega Honk Verifier to verify a proof (sumcheck + Shplemini). In the context of folding, this is returned by the Protogalaxy verifier with non-zero target sum and gate challenges. More...
 
struct  DeciderVerificationKeys_
 
class  DeciderVerifier_
 
class  DefaultIO
 Manages the data that is propagated on the public inputs of an application/function circuit. More...
 
class  DeltaRangeConstraintRelationImpl
 
struct  ecc_add_gate_
 
struct  ecc_dbl_gate_
 
struct  ecc_op_tuple
 
struct  EccOpCode
 Defines the opcodes for ECC operations used in both the Ultra and ECCVM formats. There are three opcodes that are reflected in both ultra ops and eccvm table and so, that lead to actual operations in the ECCVM : More...
 
class  ECCOpQueue
 Used to construct execution trace representations of elliptic curve operations. More...
 
class  EccOpQueueRelationImpl
 
class  EccOpsTable
 A table of ECC operations. More...
 
class  EccRelationsConsistency
 
class  ECCVMBoolsRelationImpl
 ECCVMBoolsRelationImpl evaluates the correctness of ECCVM boolean checks. More...
 
class  ECCVMCircuitBuilder
 
class  ECCVMFixedVKCommitments
 Stores the fixed ECCVM VK commitments (to precomputed polynomials) that depend only on the circuit size constant ECCVM_FIXED_SIZE. More...
 
class  ECCVMFlavor
 
class  ECCVMLookupRelationImpl
 
class  ECCVMMSMMBuilder
 
class  ECCVMMSMRelationImpl
 MSM relations that evaluate the Strauss multiscalar multiplication algorithm. More...
 
struct  ECCVMOperation
 
class  ECCVMPointTablePrecomputationBuilder
 
class  ECCVMPointTableRelationImpl
 ECCVMPointTableRelationImpl. More...
 
struct  ECCVMProof
 
class  ECCVMProver
 
class  ECCVMRecursiveFlavor
 
class  ECCVMRecursiveTests
 
class  ECCVMRecursiveVerifier
 
class  EccvmRowTracker
 Class for tracking the number of rows in the ECCVM circuit and the number of muls performed as the op queue is populated. More...
 
class  ECCVMSetRelationImpl
 
class  ECCVMTraceChecker
 
class  ECCVMTranscriptBuilder
 
class  ECCVMTranscriptRelationImpl
 ECCVMTranscriptRelationImpl evaluates the correctness of the ECCVM transcript columns. More...
 
class  ECCVMVerifier
 
class  ECCVMWnafRelationImpl
 ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices. More...
 
class  EcdsaCircuit
 
class  EllipticRelationImpl
 
class  EvaluationDomain
 
class  ExecutionTraceBlock
 Basic structure for storing gate data in a builder. More...
 
struct  ExecutionTraceUsageTracker
 Tracks the cumulative usage of the execution trace across a series of circuits. More...
 
struct  field
 General class for prime fields see Prime field documentation["field documentation"] for general implementation reference. More...
 
class  field12
 
struct  field2
 
class  field6
 
struct  FieldVM
 Virtual machine for field arithmetic operations. More...
 
struct  fixed_group_add_quad_
 
struct  fixed_group_init_quad_
 
struct  FoldingResult
 The result of running the Protogalaxy prover containing a new accumulator as well as the proof data to instantiate the verifier transcript. More...
 
class  Formatter
 
struct  GateSeparatorPolynomial
 Implementation of the methods for the \(pow_{\ell}\)-polynomials used in Protogalaxy and \(pow_{\beta}\)-polynomials used in Sumcheck. More...
 
class  GeminiProver_
 
class  GeminiVerifier_
 
class  GenericLookupRelationImpl
 Specifies positions of elements in the tuple of entities received from methods in the Settings class. More...
 
class  GenericPermutationRelationImpl
 
class  Goblin
 
struct  GoblinAccumulationOutput
 
class  GoblinMockCircuits
 
struct  GoblinProof
 
struct  GoogleBenchOpCountReporter
 
class  group
 group class. Represents an elliptic curve group element. Group is parametrised by Fq and Fr More...
 
class  GrumpkinSettings
 
class  HidingKernelIO
 Manages the data that is propagated on the public inputs of of a hiding kernel circuit. More...
 
class  IPA
 IPA (inner product argument) commitment scheme class. More...
 
struct  is_field_type
 Helper to determine whether input is bberg::field type. More...
 
struct  is_field_type< bb::field< Params > >
 
struct  is_iterable
 
struct  is_iterable< T, std::void_t< decltype(std::begin(std::declval< T & >())), decltype(std::end(std::declval< T & >()))> >
 
struct  KeccakTranscriptParams
 
class  KZG
 
class  KZGTest
 
class  LogDerivLookupRelationImpl
 
struct  Mapping
 Stores permutation mapping data for a single wire column. More...
 
class  MegaCircuitBuilder_
 
class  MegaExecutionTraceBlocks
 
class  MegaFlavor
 
class  MegaRecursiveFlavor_
 The recursive counterpart to the "native" Mega flavor. More...
 
class  MegaTraceArithmeticBlock
 
class  MegaTraceBlock
 
struct  MegaTraceBlockData
 A container indexed by the types of the blocks in the execution trace. More...
 
class  MegaTraceBusReadBlock
 
class  MegaTraceDeltaRangeBlock
 
class  MegaTraceEllipticBlock
 
class  MegaTraceLookupBlock
 
class  MegaTraceMemoryBlock
 
class  MegaTraceNonNativeFieldBlock
 
class  MegaTraceOverflowBlock
 
class  MegaTracePoseidon2ExternalBlock
 
class  MegaTracePoseidon2InternalBlock
 
class  MegaTracePublicInputBlock
 
class  MegaZKFlavor
 Child class of MegaFlavor that runs with ZK Sumcheck. See more in Sumcheck Outline. More...
 
class  MegaZKRecursiveFlavor_
 The recursive counterpart to the "native" MegaZKFlavor. More...
 
class  MemoryRelationImpl
 
class  MergeProver
 Prover class for the Goblin ECC op queue transcript merge protocol. More...
 
class  MergeVerifier
 Verifier class for the Goblin ECC op queue transcript merge protocol. More...
 
struct  MetaData
 Dyadic trace size and public inputs metadata; Common between prover and verifier keys. More...
 
class  MockCircuits
 
struct  MockClaimGenerator
 Constructs random polynomials, computes commitments and corresponding evaluations. More...
 
class  MockTranscript
 Mock transcript class used by IPA tests and fuzzer. More...
 
struct  mul_quad_
 
struct  mul_triple_
 
struct  MultithreadData
 
class  NamedUnion
 A wrapper around std::variant that provides msgpack serialization based on type names. More...
 
struct  NativeTranscriptParams
 
class  NativeVerificationKey_
 Base Native verification key class. More...
 
struct  non_native_multiplication_witnesses
 
struct  non_native_partial_multiplication_witnesses
 
class  NonNativeFieldRelationImpl
 
class  OinkProver
 Class for all the oink rounds, which are shared between the folding prover and ultra prover. More...
 
class  OinkVerifier
 Verifier class for all the presumcheck rounds, which are shared between the folding verifier and ultra verifier. More...
 
class  OpeningClaim
 Unverified claim (C,r,v) for some witness polynomial p(X) such that. More...
 
class  OpeningPair
 Opening pair (r,v) for some witness polynomial p(X) such that p(r) = v. More...
 
struct  OriginTag
 
class  PairingPoints
 An object storing two bn254 points that represent the inputs to a pairing check. More...
 
struct  permutation_subgroup_element
 Permutations subgroup element structure is used to hold data necessary to construct permutation polynomials. More...
 
struct  PermutationMapping
 
struct  poly_triple_
 
struct  PolyData
 
class  Polynomial
 Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x ... a_n x^n of a finite field polynomial equation of degree that is at most the size of some zk circuit. Past 'n' it has a virtual size where it conceptually has coefficients all equal to 0. Notably, we allow indexing past 'n' up to our virtual size (checked only in a debug build, however). As well, we have a start index that means coefficients before start_index are also considered to be 0. The polynomial is used to represent the gates of our arithmetized zk programs. Polynomials use the majority of the memory in proving, so caution should be used in making sure unnecessary copies are avoided, both for avoiding unnecessary memory usage and performance due to unnecessary allocations. The polynomial has a maximum degree in the underlying SharedShiftedVirtualZeroesArray, dictated by the circuit size, this is just used for debugging as we represent. More...
 
struct  PolynomialSpan
 
struct  poseidon2_external_gate_
 
struct  poseidon2_internal_gate_
 
class  Poseidon2ExternalRelationImpl
 
class  Poseidon2InternalRelationImpl
 
struct  PrecomputedData_
 The precomputed data needed to compute a Honk VK. More...
 
struct  PrivateExecutionStepRaw
 This is the msgpack encoding of the objects returned by the following typescript: const stepToStruct = (step: PrivateExecutionStep) => { return { bytecode: step.bytecode, witness: serializeWitness(step.witness), vk: step.vk, functionName: step.functionName }; }; await fs.writeFile(path, encode(executionSteps.map(stepToStruct))); See format notes below. More...
 
struct  PrivateExecutionSteps
 
class  ProtogalaxyProver_
 
class  ProtogalaxyProverInternal
 A purely static class (never add state to this!) consisting of functions used by the Protogalaxy prover. More...
 
class  ProtogalaxyVerifier_
 
class  ProverOpeningClaim
 Polynomial p and an opening pair (r,v) such that p(r) = v. More...
 
class  ProxyCaller
 Class that allows us to call internal IPA methods, because it's friendly. More...
 
struct  PublicComponentKey
 
class  PublicInputComponent
 A wrapper class for deserializing objects from the public inputs of a circuit. More...
 
struct  PublicInputsAndProof
 
struct  RamRecord
 A RAM memory record that can be ordered. More...
 
struct  RamTranscript
 Each ram array is an instance of memory transcript. It saves values and indexes for a particular memory array. More...
 
class  RecursiveCircuit
 
class  RecursiveVeriferCommitmentKeyTest
 
class  RefArray
 A template class for a reference array. Behaves as if std::array<T&, N> was possible. More...
 
class  RefSpan
 
class  RefVector
 A template class for a reference vector. Behaves as if std::vector<T&> was possible. More...
 
class  Relation
 A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribution of a given relation to the corresponding accumulator. More...
 
class  RelationChecker
 A debugging utility for checking whether a set of polynomials satisfies the relations for a given Flavor. More...
 
class  RelationChecker< bb::UltraFlavor >
 
class  RelationChecker< MegaFlavor >
 
struct  RelationParameters
 Container for parameters used by the grand product (permutation, lookup) Honk relations. More...
 
class  RelationUtils
 
struct  RepeatedCommitmentsData
 
class  RollupIO
 The data that is propagated on the public inputs of a rollup circuit. More...
 
class  RomRamLogic_
 ROM/RAM logic handler for UltraCircuitBuilder. More...
 
struct  RomRecord
 A ROM memory record that can be ordered. More...
 
struct  RomTranscript
 Each rom array is an instance of memory transcript. It saves values and indexes for a particular memory array. More...
 
struct  RowDisablingPolynomial
 Polynomial for Sumcheck with disabled Rows. More...
 
class  Selector
 Abstract interface for a generic selector. More...
 
class  ShpleminiProver_
 
class  ShpleminiTest
 
class  ShpleminiVerifier_
 An efficient verifier for the evaluation proofs of multilinear polynomials and their shifts. More...
 
class  ShplonkProver_
 Shplonk Prover. More...
 
class  ShplonkTest
 
class  ShplonkVerifier_
 Shplonk Verifier. More...
 
class  SlabVectorSelector
 Selector backed by a slab allocator vector. More...
 
struct  SmallSubgroupIPACommitments
 Contains commitments to polynomials [G], [A], and [Q]. See SmallSubgroupIPAProver docs. More...
 
class  SmallSubgroupIPAProver
 A Curve-agnostic ZK protocol to prove inner products of small vectors. More...
 
class  SmallSubgroupIPATest
 
class  SmallSubgroupIPAVerifier
 Verifies the consistency of polynomial evaluations provided by the the prover. More...
 
class  StdlibVerificationKey_
 Base Stdlib verification key class. More...
 
struct  SumcheckOutput
 Contains the evaluations of multilinear polynomials \( P_1, \ldots, P_N\) at the challenge point \(\vec u =(u_0,\ldots, u_{d-1})\). These are computed by Sumcheck Prover and need to be checked using Shplemini. More...
 
class  SumcheckProver
 The implementation of the sumcheck Prover for statements of the form \(\sum_{\vec \ell \in \{0,1\}^d} pow_{\beta}(\vec \ell) \cdot F \left(P_1(\vec \ell),\ldots, P_N(\vec \ell) \right) = 0 \) for multilinear polynomials \(P_1, \ldots, P_N \). More...
 
class  SumcheckProverRound
 Imlementation of the Sumcheck prover round. More...
 
class  SumcheckVerifier
 Implementation of the sumcheck Verifier for statements of the form \(\sum_{\vec \ell \in \{0,1\}^d} pow_{\beta}(\vec \ell) \cdot F \left(P_1(\vec \ell),\ldots, P_N(\vec \ell) \right) = 0 \) for multilinear polynomials \(P_1, \ldots, P_N \). More...
 
class  SumcheckVerifierRound
 Implementation of the Sumcheck Verifier Round. More...
 
class  ThreadPool
 
struct  TraceSettings
 
struct  TraceStructure
 
class  TraceToPolynomials
 
class  TranscriptManifest
 
class  TranslationData
 A class designed to accept the ECCVM Transcript Polynomials, concatenate their masking terms in Lagrange basis over the SmallSubgroup, and commit to the concatenation. More...
 
struct  TranslationEvaluations_
 Stores the evaluations of op, Px, Py, z1, and z2 computed by the ECCVM Prover. These evaluations are batched and checked against the accumulated_result, which is computed and verified by Translator. More...
 
class  TranslatorAccumulatorTransferRelationImpl
 
class  TranslatorCircuitBuilder
 TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQueue in Fq while operating in the Fr scalar field (r is the modulus of Fr and q is the modulus of Fq) More...
 
class  TranslatorCircuitChecker
 
class  TranslatorDecompositionRelationImpl
 
class  TranslatorDeltaRangeConstraintRelationImpl
 
struct  TranslatorFixedVKCommitments
 Stores the fixed Translator VK commitments (to precomputed polynomials) that depend only on the circuit size constant CONST_TRANSLATOR_LOG_N. More...
 
class  TranslatorFlavor
 
class  TranslatorNonNativeFieldRelationImpl
 
class  TranslatorOpcodeConstraintRelationImpl
 
class  TranslatorPermutationRelationImpl
 
class  TranslatorProver
 
class  TranslatorProvingKey
 
class  TranslatorRecursiveFlavor
 The recursive counterpart of the native Translator flavor. More...
 
class  TranslatorRecursiveTests
 Test suite for standalone recursive verification of translation proofs. More...
 
class  TranslatorRecursiveVerifier
 
class  TranslatorVerifier
 
class  TranslatorZeroConstraintsRelationImpl
 
struct  TupleOfContainersOverArray
 Generic templates for constructing a container of containers of varying length, where the various lengths are specified in an array. More...
 
struct  TupleOfContainersOverArray< InnerContainer, ValueType, domain_end, domain_start, skip_count, std::index_sequence< I... > >
 
class  UltraArithmeticRelationImpl
 
class  UltraCircuitBuilder_
 
class  UltraCircuitChecker
 
class  UltraEccOpsTable
 Stores a table of elliptic curve operations represented in the Ultra format. More...
 
class  UltraExecutionTraceBlocks
 
class  UltraFlavor
 
class  UltraHonkAPI
 
class  UltraKeccakFlavor
 
class  UltraKeccakRecursiveFlavor_
 
class  UltraKeccakZKFlavor
 
struct  UltraOp
 
class  UltraPermutationRelationImpl
 Ultra Permutation Relation. More...
 
class  UltraProver_
 
class  UltraRecursiveFlavor_
 The recursive counterpart to the "native" Ultra flavor. More...
 
class  UltraRollupFlavor
 
class  UltraRollupRecursiveFlavor_
 The recursive counterpart to the "native" UltraRollupFlavor. More...
 
class  UltraTraceArithmeticBlock
 
class  UltraTraceBlock
 
struct  UltraTraceBlockData
 Defines the circuit block types for the Ultra arithmetization. More...
 
class  UltraTraceDeltaRangeBlock
 
class  UltraTraceEllipticBlock
 
class  UltraTraceLookupBlock
 
class  UltraTraceMemoryBlock
 
class  UltraTraceNonNativeFieldBlock
 
class  UltraTraceOverflowBlock
 
class  UltraTracePoseidon2ExternalBlock
 
class  UltraTracePoseidon2InternalBlock
 
class  UltraTracePublicInputBlock
 
class  UltraVerifier_
 
class  UltraZKFlavor
 Child class of UltraFlavor that runs with ZK Sumcheck. More...
 
class  UltraZKRecursiveFlavor_
 The recursive counterpart to the Ultra flavor with ZK. More...
 
class  Univariate
 A univariate polynomial represented by its values on {domain_start, domain_start + 1,..., domain_end - 1}. For memory efficiency purposes, we store the evaluations in an array starting from 0 and make the mapping to the right domain under the hood. More...
 
class  UnivariateClaimData
 
class  UnivariateCoefficientBasis
 A view of a univariate, also used to truncate univariates. More...
 
class  UnivariateView
 A view of a univariate, also used to truncate univariates. More...
 
class  VerifierCommitmentKey
 Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit. More...
 
class  VerifierCommitmentKey< curve::BN254 >
 Specialization for bn254. More...
 
class  VerifierCommitmentKey< curve::Grumpkin >
 Specialization for Grumpkin. More...
 
class  VKAndHash_
 
struct  VMSettings
 Settings structure to control which operations are enabled in the VM. More...
 
class  WitnessComputation
 Methods for managing the compututation of derived witness polynomials such as the permutation grand product, log-derivative lookup inverses, and RAM/RAM memory records. More...
 
class  ZeroSelector
 Selector specialization that only allows zeros. More...
 
struct  ZKSumcheckData
 This structure is created to contain various polynomials and constants required by ZK Sumcheck. More...
 

Concepts

concept  IsCheckable
 
concept  HasMsgpackSchemaName
 Concept to check if a type has a static NAME member.
 
concept  IsUltraHonk
 Test whether a type T lies in a list of types ...U.
 
concept  IsUltraOrMegaHonk
 
concept  IsMegaFlavor
 
concept  HasDataBus
 
concept  UseRowDisablingPolynomial
 
concept  HasIPAAccumulator
 
concept  IsRecursiveFlavor
 
concept  IsKeccakFlavor
 
concept  IsGrumpkinFlavor
 
concept  HasAdditionalSelectors
 
concept  IsAnyOf
 
concept  IsDeserializableFromPublicInputs
 A concept defining requirements for types that are to be deserialized from the public inputs of a circuit via the PublicInputComponent class.
 
concept  HasSubrelationLinearlyIndependentMember
 
concept  HasParameterLengthAdjustmentsMember
 
concept  isSkippable
 The templates defined herein facilitate sharing the relation arithmetic between the prover and the verifier.
 
concept  isRowSkippable
 Check if the flavor has a static skip method to determine if accumulation of all relations can be skipped for a given row.
 
concept  specifiesUnivariateChunks
 
concept  Loggable
 
concept  InCircuit
 

Typedefs

using Flavor = MegaFlavor
 
using FF = typename Flavor::FF
 
using CommitmentSchemeParams = ::testing::Types< curve::BN254 >
 
using IpaCommitmentSchemeParams = ::testing::Types< curve::Grumpkin >
 
using Curve = curve::Grumpkin
 
using TestSettings = ::testing::Types< BN254Settings, GrumpkinSettings >
 
using CurveTypes = ::testing::Types< curve::BN254, curve::Grumpkin >
 
using TestFlavors = ::testing::Types< BN254Settings, GrumpkinSettings >
 
using Curves = ::testing::Types< curve::BN254, curve::Grumpkin >
 
template<typename T >
using SlabVector = std::vector< T, bb::ContainerSlabAllocator< T > >
 A vector that uses the slab allocator.
 
using fq = field< Bn254FqParams >
 
using fq12 = field12< fq2, fq6, Bn254Fq12Params >
 
using fq2 = field2< fq, Bn254Fq2Params >
 
using fq6 = field6< fq2, Bn254Fq6Params >
 
using fr = field< Bn254FrParams >
 
using g1 = group< fq, fr, Bn254G1Params >
 
using g2 = group< fq2, fr, Bn254G2Params >
 
using CyclicPermutation = std::vector< cycle_node >
 
using poly_triple = poly_triple_< bb::fr >
 
using PublicInputsVector = std::vector< fr >
 
using HonkProof = std::vector< fr >
 
template<typename Builder >
using StdlibPublicInputsVector = std::vector< bb::stdlib::field_t< Builder > >
 
using EccvmOpsTable = EccOpsTable< ECCVMOperation >
 A VM operation is represented as one row with 6 columns in the ECCVM version of the Op Queue. | OP | X | Y | z_1 | z_2 | mul_scalar_full |.
 
template<class Fr , size_t domain_end, size_t num_evals, size_t domain_start = 0>
using BarycentricData = std::conditional_t< is_field_type_v< Fr >, BarycentricDataCompileTime< Fr, domain_end, num_evals, domain_start >, BarycentricDataRunTime< Fr, domain_end, num_evals, domain_start > >
 Exposes BarycentricData with compile time arrays if the type is bberg::field and runtime arrays otherwise.
 
using evaluation_domain = EvaluationDomain< bb::fr >
 
template<typename FF >
using DatabusLookupRelation = Relation< DatabusLookupRelationImpl< FF > >
 
template<typename FF >
using DeltaRangeConstraintRelation = Relation< DeltaRangeConstraintRelationImpl< FF > >
 
template<typename FF >
using EccOpQueueRelation = Relation< EccOpQueueRelationImpl< FF > >
 
template<typename FF >
using ECCVMBoolsRelation = Relation< ECCVMBoolsRelationImpl< FF > >
 
template<typename FF >
using ECCVMLookupRelation = Relation< ECCVMLookupRelationImpl< FF > >
 
template<typename FF >
using ECCVMMSMRelation = Relation< ECCVMMSMRelationImpl< FF > >
 
template<typename FF >
using ECCVMPointTableRelation = Relation< ECCVMPointTableRelationImpl< FF > >
 
template<typename FF >
using ECCVMSetRelation = Relation< ECCVMSetRelationImpl< FF > >
 
template<typename FF >
using ECCVMTranscriptRelation = Relation< ECCVMTranscriptRelationImpl< FF > >
 
template<typename FF >
using ECCVMWnafRelation = Relation< ECCVMWnafRelationImpl< FF > >
 
template<typename FF >
using EllipticRelation = Relation< EllipticRelationImpl< FF > >
 
template<typename Settings , typename FF >
using GenericLookupRelation = Relation< GenericLookupRelationImpl< Settings, FF > >
 
template<typename Settings , typename FF >
using GenericLookup = GenericLookupRelationImpl< Settings, FF >
 
template<typename Settings , typename FF >
using GenericPermutationRelation = Relation< GenericPermutationRelationImpl< Settings, FF > >
 
template<typename Settings , typename FF >
using GenericPermutation = GenericPermutationRelationImpl< Settings, FF >
 
template<typename FF >
using LogDerivLookupRelation = Relation< LogDerivLookupRelationImpl< FF > >
 
template<typename FF >
using MemoryRelation = Relation< MemoryRelationImpl< FF > >
 
template<typename ValueType , size_t , size_t , size_t >
using ExtractValueType = ValueType
 
template<typename Tuple >
using HomogeneousTupleToArray = std::array< std::tuple_element_t< 0, Tuple >, std::tuple_size_v< Tuple > >
 
template<typename FF , auto LENGTHS>
using TupleOfUnivariates = typename TupleOfContainersOverArray< bb::Univariate, FF, LENGTHS, 0, 0 >::type
 
template<typename FF , auto LENGTHS, size_t SKIP_COUNT>
using TupleOfUnivariatesWithOptimisticSkipping = typename TupleOfContainersOverArray< bb::Univariate, FF, LENGTHS, 0, SKIP_COUNT >::type
 
template<typename FF , auto LENGTHS>
using TupleOfValues = typename TupleOfContainersOverArray< ExtractValueType, FF, LENGTHS >::type
 
template<typename FF , auto LENGTHS>
using ArrayOfValues = HomogeneousTupleToArray< TupleOfValues< FF, LENGTHS > >
 
template<typename FF >
using NonNativeFieldRelation = Relation< NonNativeFieldRelationImpl< FF > >
 
template<typename FF >
using UltraPermutationRelation = Relation< UltraPermutationRelationImpl< FF > >
 
template<typename FF >
using Poseidon2ExternalRelation = Relation< Poseidon2ExternalRelationImpl< FF > >
 
template<typename FF >
using Poseidon2InternalRelation = Relation< Poseidon2InternalRelationImpl< FF > >
 
template<typename Params , typename View >
using GetParameterView = std::conditional_t< IsField< typename Params::DataType >, typename Params::DataType, View >
 A type to optionally extract a view of a relation parameter in a relation.
 
template<typename FF >
using TranslatorDecompositionRelation = Relation< TranslatorDecompositionRelationImpl< FF > >
 
template<typename FF >
using TranslatorDeltaRangeConstraintRelation = Relation< TranslatorDeltaRangeConstraintRelationImpl< FF > >
 
template<typename FF >
using TranslatorOpcodeConstraintRelation = Relation< TranslatorOpcodeConstraintRelationImpl< FF > >
 
template<typename FF >
using TranslatorAccumulatorTransferRelation = Relation< TranslatorAccumulatorTransferRelationImpl< FF > >
 
template<typename FF >
using TranslatorZeroConstraintsRelation = Relation< TranslatorZeroConstraintsRelationImpl< FF > >
 
template<typename FF >
using TranslatorNonNativeFieldRelation = Relation< TranslatorNonNativeFieldRelationImpl< FF > >
 
template<typename FF >
using TranslatorPermutationRelation = Relation< TranslatorPermutationRelationImpl< FF > >
 
template<typename FF >
using UltraArithmeticRelation = Relation< UltraArithmeticRelationImpl< FF > >
 
using UltraCircuitBuilder = UltraCircuitBuilder_< UltraExecutionTraceBlocks >
 
using MegaCircuitBuilder = MegaCircuitBuilder_< field< Bn254FrParams > >
 
using DataBus = std::array< BusVector, 3 >
 The DataBus; facilitates storage of public circuit input/output.
 
using NativeTranscript = BaseTranscript< NativeTranscriptParams >
 
using KeccakTranscript = BaseTranscript< KeccakTranscriptParams >
 
using UltraDeciderProver = DeciderProver_< UltraFlavor >
 
using MegaDeciderProver = DeciderProver_< MegaFlavor >
 
using MegaZKDeciderProver = DeciderProver_< MegaZKFlavor >
 
using UltraDeciderVerifier = DeciderVerifier_< UltraFlavor >
 
using MegaDeciderVerifier = DeciderVerifier_< MegaFlavor >
 
using MegaZKDeciderVerifier = DeciderVerifier_< MegaZKFlavor >
 
using MegaOinkProver = OinkProver< MegaFlavor >
 
using UltraProver = UltraProver_< UltraFlavor >
 
using UltraZKProver = UltraProver_< UltraZKFlavor >
 
using UltraKeccakProver = UltraProver_< UltraKeccakFlavor >
 
using UltraKeccakZKProver = UltraProver_< UltraKeccakZKFlavor >
 
using MegaProver = UltraProver_< MegaFlavor >
 
using MegaZKProver = UltraProver_< MegaZKFlavor >
 
using UltraVerifier = UltraVerifier_< UltraFlavor >
 
using UltraRollupVerifier = UltraVerifier_< UltraRollupFlavor >
 
using UltraKeccakVerifier = UltraVerifier_< UltraKeccakFlavor >
 
using MegaVerifier = UltraVerifier_< MegaFlavor >
 
using MegaZKVerifier = UltraVerifier_< MegaZKFlavor >
 

Enumerations

enum  CurveType { BN254 , SECP256K1 , SECP256R1 , GRUMPKIN }
 
enum class  Instruction {
  SET_VALUE , ADD , ADD_ASSIGN , INCREMENT ,
  MUL , MUL_ASSIGN , SUB , SUB_ASSIGN ,
  DIV , DIV_ASSIGN , INV , NEG ,
  SQR , SQR_ASSIGN , POW , SQRT ,
  IS_ZERO , EQUAL , NOT_EQUAL , TO_MONTGOMERY ,
  FROM_MONTGOMERY , REDUCE_ONCE , SELF_REDUCE , BATCH_INVERT
}
 Enumeration of VM instructions that can be executed. More...
 
enum class  CircuitType : uint32_t { STANDARD = 0 , ULTRA = 2 , UNDEFINED = 3 }
 
enum  MergeSettings { PREPEND , APPEND }
 The MergeSettings define whether an current subtable will be added at the beginning (PREPEND) or at the end (APPEND) of the EccOpQueue. More...
 
enum  GenericPermutationSettingIndices {
  INVERSE_POLYNOMIAL_INDEX , ENABLE_INVERSE_CORRECTNESS_CHECK_POLYNOMIAL_INDEX , FIRST_PERMUTATION_SET_ENABLE_POLYNOMIAL_INDEX , SECOND_PERMUTATION_SET_ENABLE_POLYNOMIAL_INDEX ,
  PERMUTATION_SETS_START_POLYNOMIAL_INDEX
}
 Specifies positions of elements in the tuple of entities received from methods in the Settings class. More...
 
enum class  TamperType {
  MODIFY_SUMCHECK_UNIVARIATE , MODIFY_SUMCHECK_EVAL , MODIFY_Z_PERM_COMMITMENT , MODIFY_GEMINI_WITNESS ,
  END
}
 
enum class  BusId { CALLDATA , SECONDARY_CALLDATA , RETURNDATA }
 

Functions

acir_format::WitnessVector get_witness (std::string const &witness_path)
 
acir_format::AcirFormat get_constraint_system (std::string const &bytecode_path)
 
acir_format::WitnessVectorStack get_witness_stack (std::string const &witness_path)
 
std::vector< acir_format::AcirFormatget_constraint_systems (std::string const &bytecode_path)
 
void avm_prove (const std::filesystem::path &inputs_path, const std::filesystem::path &output_path)
 Writes an avm proof and corresponding (incomplete) verification key to files.
 
void avm_check_circuit (const std::filesystem::path &inputs_path)
 
bool avm_verify (const std::filesystem::path &proof_path, const std::filesystem::path &public_inputs_path, const std::filesystem::path &vk_path)
 Verifies an avm proof and writes the result to stdout.
 
void gate_count_for_ivc (const std::string &bytecode_path, bool include_gates_per_opcode)
 
void write_arbitrary_valid_client_ivc_proof_and_vk_to_file (const std::filesystem::path &output_dir)
 
std::vector< uint8_t > decompress (const void *bytes, size_t size)
 
std::vector< uint8_t > compress (const std::vector< uint8_t > &input)
 
int process_msgpack_commands (std::istream &input_stream)
 Process msgpack API commands from an input stream.
 
int execute_msgpack_run (const std::string &msgpack_input_file)
 Execute msgpack run command.
 
template<typename Flavor >
void write_recursion_inputs_ultra_honk (const std::string &bytecode_path, const std::string &witness_path, const std::string &output_path)
 
template void write_recursion_inputs_ultra_honk< UltraFlavor > (const std::string &bytecode_path, const std::string &witness_path, const std::string &output_path)
 
template void write_recursion_inputs_ultra_honk< UltraRollupFlavor > (const std::string &bytecode_path, const std::string &witness_path, const std::string &output_path)
 
std::vector< uint8_t > exec_pipe (const std::string &command)
 
size_t get_file_size (std::string const &filename)
 
std::vector< uint8_t > read_file (const std::string &filename, size_t bytes=0)
 
void write_file (const std::string &filename, std::vector< uint8_t > const &data)
 
template<typename Fr >
std::string field_elements_to_json (const std::vector< Fr > &fields)
 
void prove_tube (const std::string &output_path, const std::string &vk_path)
 Creates a Honk Proof for the Tube circuit responsible for recursively verifying a ClientIVC proof.
 
void print_active_subcommands (const CLI::App &app, const std::string &prefix="bb command: ")
 
CLI::App * find_deepest_subcommand (CLI::App *app)
 
void print_subcommand_options (const CLI::App *sub)
 
int parse_and_run_cli_command (int argc, char *argv[])
 Parse command line arguments and run the corresponding command.
 
void vector_of_evaluations (State &state) noexcept
 
void compute_row_evaluations (State &state) noexcept
 
void fold_k (State &state) noexcept
 
 BENCHMARK (vector_of_evaluations) -> DenseRange(15, 21) ->Unit(kMillisecond) ->Iterations(1)
 
 BENCHMARK (compute_row_evaluations) -> DenseRange(15, 21) ->Unit(kMillisecond)
 
 BENCHMARK (fold_k) -> DenseRange(14, 20) ->Unit(kMillisecond)
 
void _bench_round (::benchmark::State &state, void(*F)(ProtogalaxyProver_< Flavor > &))
 
void bench_round_mega (::benchmark::State &state, void(*F)(ProtogalaxyProver_< MegaFlavor > &))
 
 BENCHMARK_CAPTURE (bench_round_mega, oink, [](auto &prover) { prover.run_oink_prover_on_each_incomplete_key();}) -> DenseRange(14, 20) -> Unit(kMillisecond)
 
 BENCHMARK_CAPTURE (bench_round_mega, perturbator, [](auto &prover) { prover.perturbator_round(prover.accumulator);}) -> DenseRange(14, 20) -> Unit(kMillisecond)
 
 BENCHMARK_CAPTURE (bench_round_mega, combiner_quotient, [](auto &prover) { prover.combiner_quotient_round(prover.accumulator->gate_challenges, prover.deltas, prover.keys_to_fold);}) -> DenseRange(14, 20) -> Unit(kMillisecond)
 
 BENCHMARK_CAPTURE (bench_round_mega, fold, [](auto &prover) { prover.update_target_sum_and_fold(prover.keys_to_fold, prover.combiner_quotient, prover.alphas, prover.relation_parameters, prover.perturbator_evaluation);}) -> DenseRange(14, 20) -> Unit(kMillisecond)
 
 TEST (MegaCircuitBuilder, CopyConstructor)
 
 TEST (MegaCircuitBuilder, BaseCase)
 
 TEST (MegaCircuitBuilder, GoblinSimple)
 Test the queueing of simple ecc ops via the Goblin builder.
 
 TEST (MegaCircuitBuilder, GoblinEccOpQueueUltraOps)
 Check that the ultra ops are recorded correctly in the EccOpQueue.
 
 TEST (MegaCircuitBuilder, CompleteSelectorPartitioningCheck)
 Check that the selector partitioning is correct for the mega circuit builder.
 
 TEST (UltraCircuitBuilder, CopyConstructor)
 
 TEST (UltraCircuitBuilder, CreateGatesFromPlookupAccumulators)
 
 TEST (UltraCircuitBuilder, BadLookupFailure)
 
 TEST (UltraCircuitBuilder, BaseCase)
 
 TEST (UltraCircuitBuilder, TestNoLookupProof)
 
 TEST (UltraCircuitBuilder, TestEllipticGate)
 
 TEST (UltraCircuitBuilder, TestEllipticDoubleGate)
 
 TEST (UltraCircuitBuilder, NonTrivialTagPermutation)
 
 TEST (UltraCircuitBuilder, NonTrivialTagPermutationAndCycles)
 
 TEST (UltraCircuitBuilder, BadTagPermutation)
 
 TEST (UltraCircuitBuilder, SortWidget)
 
std::vector< uint32_t > add_variables (UltraCircuitBuilder &builder, std::vector< fr > variables)
 
 TEST (UltraCircuitBuilder, SortWithEdgesGate)
 
 TEST (UltraCircuitBuilder, RangeConstraint)
 
 TEST (UltraCircuitBuilder, RangeWithGates)
 
 TEST (UltraCircuitBuilder, RangeWithGatesWhereRangeIsNotAPowerOfTwo)
 
 TEST (UltraCircuitBuilder, SortWidgetComplex)
 
 TEST (UltraCircuitBuilder, SortWidgetNeg)
 
 TEST (UltraCircuitBuilder, ComposedRangeConstraint)
 
 TEST (UltraCircuitBuilder, NonNativeFieldMultiplication)
 
 TEST (UltraCircuitBuilder, NonNativeFieldMultiplicationSortCheck)
 Test that the nnf block only contains nnf gates.
 
 TEST (UltraCircuitBuilder, Rom)
 
 TEST (UltraCircuitBuilder, RamSimple)
 A simple-as-possible RAM read test, for easier debugging.
 
 TEST (UltraCircuitBuilder, Ram)
 
 TEST (UltraCircuitBuilder, RangeChecksOnDuplicates)
 
 TEST (UltraCircuitBuilder, CheckCircuitShowcase)
 
template<>
auto UltraCircuitChecker::init_empty_values< MegaCircuitBuilder_< bb::fr > > ()
 
template<>
MegaCircuitBuilder_< bb::frUltraCircuitChecker::prepare_circuit< MegaCircuitBuilder_< bb::fr > > (const MegaCircuitBuilder_< bb::fr > &builder_in)
 
template bool UltraCircuitChecker::check< MegaCircuitBuilder_< bb::fr > > (const MegaCircuitBuilder_< bb::fr > &builder_in)
 
template<typename T >
unpack_from_file (const std::filesystem::path &filename)
 
bool verify_ivc (ClientIVC::Proof &proof, ClientIVC &ivc)
 Verify an IVC proof.
 
std::pair< ClientIVC::Proof, ClientIVC::VerificationKeyaccumulate_and_prove_ivc_with_precomputed_vks (size_t num_app_circuits, auto &precomputed_vks, const bool large_first_app=true)
 Perform a specified number of circuit accumulation rounds.
 
std::vector< std::shared_ptr< typename MegaFlavor::VerificationKey > > precompute_vks (const size_t num_app_circuits, const bool large_first_app=true)
 
template<typename Curve >
CommitmentKey< Curvecreate_commitment_key (const size_t num_points)
 
template<typename FF >
Polynomial< FFsparse_random_poly (const size_t size, const size_t num_nonzero)
 
template<typename FF >
PolyData< FFstructured_random_poly (bool non_zero_complement=false)
 
template<typename Curve >
void bench_commit_zero (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_sparse (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_sparse_preprocessed (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_sparse_random (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_sparse_random_preprocessed (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_random (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_random_non_power_of_2 (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_structured_random_poly (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_structured_random_poly_preprocessed (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_mock_z_perm (::benchmark::State &state)
 
template<typename Curve >
void bench_commit_mock_z_perm_preprocessed (::benchmark::State &state)
 
template<typename Curve >
void bench_pippenger_without_endomorphism_basis_points (::benchmark::State &state)
 Benchmark pippenger_without_endomorphism_basis_points function, which is used notably in the IPA verifier.
 
 DenseRange (MIN_LOG_NUM_GRUMPKIN_POINTS, MAX_LOG_NUM_GRUMPKIN_POINTS) -> Unit(benchmark::kMillisecond)
 
 DenseRange (MIN_LOG_NUM_POINTS, MAX_LOG_NUM_POINTS) -> Unit(benchmark::kMillisecond)
 
 BENCHMARK (bench_commit_structured_random_poly< curve::BN254 >) -> Unit(benchmark::kMillisecond)
 
 BENCHMARK (bench_commit_structured_random_poly_preprocessed< curve::BN254 >) -> Unit(benchmark::kMillisecond)
 
 BENCHMARK (bench_commit_mock_z_perm< curve::BN254 >) -> Unit(benchmark::kMillisecond)
 
 BENCHMARK (bench_commit_mock_z_perm_preprocessed< curve::BN254 >) -> Unit(benchmark::kMillisecond)
 
template<class CK >
CK create_commitment_key (const size_t num_points=0)
 
template<>
CommitmentKey< curve::BN254create_commitment_key< CommitmentKey< curve::BN254 > > (const size_t num_points)
 
template<>
CommitmentKey< curve::Grumpkincreate_commitment_key< CommitmentKey< curve::Grumpkin > > (const size_t num_points)
 
template<class VK >
VK create_verifier_commitment_key ()
 
template<>
VerifierCommitmentKey< curve::BN254create_verifier_commitment_key< VerifierCommitmentKey< curve::BN254 > > ()
 
template<>
VerifierCommitmentKey< curve::Grumpkincreate_verifier_commitment_key< VerifierCommitmentKey< curve::Grumpkin > > ()
 
 TEST_F (IPATest, ChallengesAreZero)
 
 TEST_F (IPATest, AIsZeroAfterOneRound)
 
 TEST_F (KZGTest, Single)
 
 TEST_F (KZGTest, ZeroEvaluation)
 
 TEST_F (KZGTest, ZeroPolynomial)
 
 TEST_F (KZGTest, ConstantPolynomial)
 
 TEST_F (KZGTest, EmptyPolynomial)
 
 TEST_F (KZGTest, SingleInLagrangeBasis)
 Test opening proof of a polynomial given by its evaluations at \( i = 0, \ldots, n \). Should only be used for small values of \( n \).
 
 TEST_F (KZGTest, GeminiShplonkKzgWithShift)
 Test full PCS protocol: Gemini, Shplonk, KZG and pairing check.
 
 TEST_F (KZGTest, ShpleminiKzgWithShift)
 
 TEST_F (KZGTest, ShpleminiKzgWithShiftAndInterleaving)
 
 TEST_F (KZGTest, ShpleminiKzgShiftsRemoval)
 
 TYPED_TEST_SUITE (ShpleminiTest, TestSettings)
 
 TYPED_TEST (ShpleminiTest, CorrectnessOfMultivariateClaimBatching)
 
 TYPED_TEST (ShpleminiTest, CorrectnessOfGeminiClaimBatching)
 
 TYPED_TEST (ShpleminiTest, ShpleminiZKNoSumcheckOpenings)
 Test Shplemini with ZK data consisting of a hiding polynomial generated by GeminiProver and Libra polynomials used to mask Sumcheck Round Univariates. This abstracts the PCS step in each ZK Flavor running over BN254.
 
 TYPED_TEST (ShpleminiTest, ShpleminiZKWithSumcheckOpenings)
 Test Shplemini with ZK data consisting of a hiding polynomial generated by GeminiProver, Libra polynomials used to mask Sumcheck Round Univariates and prove/verify the claimed evaluations of committed sumcheck round univariates. This test abstracts the PCS step in each ZK Flavor running over Grumpkin.
 
 TYPED_TEST_SUITE (ShplonkTest, CurveTypes)
 
 TYPED_TEST (ShplonkTest, ShplonkSimple)
 
 TYPED_TEST (ShplonkTest, ShplonkLinearlyDependent)
 
 TYPED_TEST (ShplonkTest, ExportBatchClaimAndVerify)
 
template<typename Curve >
std::vector< typename Curve::ScalarFieldcompute_eccvm_challenge_coeffs (const typename Curve::ScalarField &evaluation_challenge_x, const typename Curve::ScalarField &batching_challenge_v)
 Denote \( M = \text{NUM_DISABLED_ROWS_IN_SUMCHECK} \) and \( N = NUM_SMALL_IPA_EVALUTIONS\). Given an evaluation challenge \( x \) and a batching challenge \(v\), compute the polynomial whose coefficients are given by the vector \( (1, x , x^2 , \ldots, x^{M - 1 }, v\cdot x, \ldots, v^{N-1} \cdot x^{M-2}, v^{N-1}, \cdot x^{M-1}, 0, \ldots, 0)\) in the Lagrange basis over the Small Subgroup.
 
 TYPED_TEST_SUITE (SmallSubgroupIPATest, TestFlavors)
 
 TYPED_TEST (SmallSubgroupIPATest, ProverComputationsCorrectness)
 
 TYPED_TEST (SmallSubgroupIPATest, VerifierEvaluations)
 
 TYPED_TEST (SmallSubgroupIPATest, LibraEvaluationsConsistency)
 
 TYPED_TEST (SmallSubgroupIPATest, LibraEvaluationsConsistencyFailure)
 
 TYPED_TEST (SmallSubgroupIPATest, TranslationMaskingTermConsistency)
 
 TYPED_TEST (SmallSubgroupIPATest, TranslationMaskingTermConsistencyFailure)
 
std::array< std::string, NUM_SMALL_IPA_EVALUATIONS > get_evaluation_labels (const std::string &label_prefix)
 Shared by Prover and Verifier. label_prefix is either Libra: or Translation:.
 
template<typename FF >
std::array< FF, NUM_SMALL_IPA_EVALUATIONS > compute_evaluation_points (const FF &small_ipa_evaluation_challenge, const FF &subgroup_generator)
 The verification of Grand Sum Identity requires the evaluations G(r), A(g * r), A(r), Q(r). Shared by Prover and Verifier.
 
 TYPED_TEST_SUITE (CommitmentKeyTest, Curves)
 
 TYPED_TEST (CommitmentKeyTest, CommitFull)
 
 TYPED_TEST (CommitmentKeyTest, CommitFullMedium)
 
 TYPED_TEST (CommitmentKeyTest, CommitSRSCheck)
 
 TYPED_TEST (CommitmentKeyTest, CommitStructuredWire)
 Test commit_structured on polynomial with blocks of non-zero values (like wires when using structured trace)
 
 TYPED_TEST (CommitmentKeyTest, CommitStructuredMaskedWire)
 Test commit_structured on polynomial with blocks of non-zero values that resembles masked structured witness.
 
 TYPED_TEST (CommitmentKeyTest, CommitStructuredNonzeroComplement)
 Test the method for committing to structured polynomials with a constant nonzero complement (i.e. the permutation grand product polynomial z_perm in the structured trace setting).
 
template<size_t Start, size_t End, size_t Inc, class F >
constexpr void constexpr_for (F &&f)
 Implements a loop using a compile-time iterator. Requires c++20. Implementation (and description) from https://artificial-mind.net/blog/2020/10/31/constexpr-for.
 
template<typename C >
C slice (C const &container, size_t start)
 
template<typename C >
C slice (C const &container, size_t start, size_t end)
 
template<typename C >
C join (std::initializer_list< C > to_join)
 
std::string join (std::vector< std::string > const &to_join, std::string const &with=",")
 
template<template< typename, typename... > typename Cont, typename InnerCont , typename... Args>
InnerCont flatten (Cont< InnerCont, Args... > const &in)
 
template<typename T >
int64_t index_of (std::vector< T > const &vec, T const &item)
 
template<template< typename, typename... > typename Cont, typename Inner , typename... Args>
Inner sum (Cont< Inner, Args... > const &in)
 
template<template< typename, typename... > typename Cont, typename Left , typename Right , typename... Args>
std::pair< Left, Right > sum_pairs (Cont< std::pair< Left, Right >, Args... > const &in)
 
std::string msgpack_to_json (msgpack::object const &o, size_t max_chars)
 
template<typename... Types>
 NamedUnion (std::variant< Types... >) -> NamedUnion< Types... >
 
void parallel_for_atomic_pool (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for_mutex_pool (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for_queued (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for_spawning (size_t num_iterations, const std::function< void(size_t)> &func)
 
template<typename T , typename... Ts>
 RefArray (T &, Ts &...) -> RefArray< T, 1+sizeof...(Ts)>
 Deduction guide for the RefArray class. Allows for RefArray {a, b, c} without explicit template params.
 
template<typename T , std::size_t... Ns>
RefArray< T,(Ns+...)> constexpr concatenate (const RefArray< T, Ns > &... ref_arrays)
 Concatenates multiple RefArray objects into a single RefArray.
 
template<typename T , typename... Ts>
 RefVector (T &, Ts &...) -> RefVector< T >
 Deduction guide for the RefVector class. Allows for RefVector {a, b, c} without explicit template params.
 
template<typename T >
RefVector< T > concatenate (const RefVector< T > &ref_vector, const auto &... ref_vectors)
 Concatenates multiple RefVector objects into a single RefVector.
 
void init_slab_allocator (size_t circuit_subgroup_size)
 
std::shared_ptr< void > get_mem_slab (size_t size)
 
void * get_mem_slab_raw (size_t size)
 
void free_mem_slab_raw (void *p)
 
template<typename T , std::size_t... Ns>
std::array< T,(Ns+...)> concatenate (const std::array< T, Ns > &... arrays)
 Concatenates multiple std::array objects into a single array.
 
template<typename T >
std::vector< T > concatenate (const std::vector< T > &vector, const auto &... vectors)
 Concatenates multiple std::vector objects into a single std::vector.
 
void parallel_for_omp (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for_moody (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for (size_t num_iterations, const std::function< void(size_t)> &func)
 
void parallel_for_range (size_t num_points, const std::function< void(size_t, size_t)> &func, size_t no_multhreading_if_less_or_equal)
 Split a loop into several loops running in parallel.
 
void parallel_for_heuristic (size_t num_points, const std::function< void(size_t, size_t, size_t)> &func, size_t heuristic_cost)
 Split a loop into several loops running in parallel based on operations in 1 iteration.
 
MultithreadData calculate_thread_data (size_t num_iterations, size_t min_iterations_per_thread=DEFAULT_MIN_ITERS_PER_THREAD)
 Calculates number of threads and index bounds for each thread.
 
size_t calculate_num_threads (size_t num_iterations, size_t min_iterations_per_thread)
 calculates number of threads to create based on minimum iterations per thread
 
size_t calculate_num_threads_pow2 (size_t num_iterations, size_t min_iterations_per_thread)
 calculates number of threads to create based on minimum iterations per thread, guaranteed power of 2
 
size_t get_num_cpus ()
 
size_t get_num_cpus_pow2 ()
 
template<typename Func >
requires std::invocable<Func, std::size_t>
void parallel_for_heuristic (size_t num_points, const Func &func, size_t heuristic_cost)
 
template<typename Func , typename Accum >
requires std::invocable<Func, std::size_t, Accum&>
std::vector< Accum > parallel_for_heuristic (size_t num_points, const Accum &initial_accum, const Func &func, size_t heuristic_cost)
 parallel_for_heuristic variant that takes an accumulator initializer that is allocated in a vector, one accumulator per thread/chunk. This allows for thread-safe accumulation, see sum() or sum_pairs() in container.hpp for an easy way to combine the thread/chunk contributions into a final result.
 
 TYPED_TEST_SUITE (BatchedAffineAdditionTests, Curves)
 
 TYPED_TEST (BatchedAffineAdditionTests, Reduce)
 
template<typename B , typename base_field , typename Params >
void read (B &it, field2< base_field, Params > &value)
 
template<typename B , typename base_field , typename Params >
void write (B &buf, field2< base_field, Params > const &value)
 
template<typename B , typename Params >
void read (B &it, field< Params > &value)
 
template<typename B , typename Params >
void write (B &buf, field< Params > const &value)
 
template<typename Group , detail::DomainSeparator domain_separator, std::size_t num_generators, std::size_t starting_index = 0>
constexpr std::span< const typename Group::affine_element > get_precomputed_generators ()
 
template<typename Group , detail::DomainSeparator domain_separator, std::size_t num_generators, std::size_t starting_index = 0>
bool check_precomputed_generators ()
 
auto get_unshifted_then_shifted (const auto &all_entities)
 
template<typename Tuple >
constexpr size_t compute_max_partial_relation_length ()
 Utility function to find max PARTIAL_RELATION_LENGTH tuples of Relations.
 
template<typename Tuple >
constexpr size_t compute_max_total_relation_length ()
 Utility function to find max TOTAL_RELATION_LENGTH among tuples of Relations.
 
template<typename Tuple >
constexpr size_t compute_number_of_subrelations ()
 Utility function to find the number of subrelations.
 
template<typename Tuple , size_t NUM_KEYS, bool optimized = false>
constexpr auto create_protogalaxy_tuple_of_tuples_of_univariates ()
 Utility function to construct a container for the subrelation accumulators of Protogalaxy folding.
 
template<typename RelationsTuple >
constexpr auto create_sumcheck_tuple_of_tuples_of_univariates ()
 Utility function to construct a container for the subrelation accumulators of sumcheck proving.
 
template<typename RelationsTuple >
constexpr auto create_tuple_of_arrays_of_values ()
 Construct tuple of arrays.
 
template<typename Container , typename Element >
std::string flavor_get_label (Container &&container, const Element &element)
 
template<typename Builder >
void generate_sha256_test_circuit (Builder &builder, size_t num_iterations)
 
template<typename Flavor >
void construct_lookup_table_polynomials (const RefArray< typename Flavor::Polynomial, 4 > &table_polynomials, const typename Flavor::CircuitBuilder &circuit, const size_t dyadic_circuit_size, const size_t additional_offset=0)
 
template<typename Flavor >
void construct_lookup_read_counts (typename Flavor::Polynomial &read_counts, typename Flavor::Polynomial &read_tags, typename Flavor::CircuitBuilder &circuit, const size_t dyadic_circuit_size)
 Construct polynomial whose value at index i is the number of times the table entry at that index has been read.
 
template<typename Flavor >
void compute_permutation_argument_polynomials (const typename Flavor::CircuitBuilder &circuit, typename Flavor::ProverPolynomials &polynomials, const std::vector< CyclicPermutation > &copy_cycles, ActiveRegionData &active_region_data)
 Compute Honk style generalized permutation sigmas and ids and add to proving_key.
 
template<typename B , typename FF >
void read (B &buf, poly_triple_< FF > &constraint)
 
template<typename B , typename FF >
void write (B &buf, poly_triple_< FF > const &constraint)
 
template<typename Flavor >
Flavor::FF compute_public_input_delta (std::span< const typename Flavor::FF > public_inputs, const typename Flavor::FF &beta, const typename Flavor::FF &gamma, const typename Flavor::FF &offset=0)
 Compute the correction term for the permutation argument.
 
template<typename Flavor , typename GrandProdRelation >
void compute_grand_product (typename Flavor::ProverPolynomials &full_polynomials, bb::RelationParameters< typename Flavor::FF > &relation_parameters, size_t size_override=0, const ActiveRegionData &active_region_data=ActiveRegionData{})
 Compute a permutation grand product polynomial Z_perm(X)
 
template<typename Flavor >
void compute_grand_products (typename Flavor::ProverPolynomials &full_polynomials, bb::RelationParameters< typename Flavor::FF > &relation_parameters, const size_t size_override=0)
 Compute the grand product corresponding to each grand-product relation defined in the Flavor.
 
template<typename FF , typename Relation , typename Polynomials , bool UseMultithreading = false>
void compute_logderivative_inverse (Polynomials &polynomials, auto &relation_parameters, const size_t circuit_size)
 Compute the inverse polynomial I(X) required for logderivative lookups

  • details Inverse may be defined in terms of its values on X_i = 0,1,...,n-1 as Z_perm[0] = 1 and for i = 1:n-1 1 1 Inverse[i] = ∏ -----------------------— * ∏' -----------------------— relation::read_term(j) relation::write_term(j)

 
template<typename FF , typename Relation , typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
void accumulate_logderivative_lookup_subrelation_contributions (ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
 Compute generic log-derivative lookup subrelation accumulation.
 
template<typename FF , typename Relation , typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
void accumulate_logderivative_permutation_subrelation_contributions (ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
 Compute generic log-derivative set permutation subrelation accumulation.
 
template<typename Flavor >
Flavor::ProverPolynomials get_sequential_prover_polynomials (const size_t log_circuit_size, const size_t starting_value)
 Get a ProverPolynomials instance initialized to sequential values starting at 0.
 
template<typename Flavor >
Flavor::ProverPolynomials get_zero_prover_polynomials (const size_t log_circuit_size)
 
template<typename Fr >
SharedShiftedVirtualZeroesArray< Fr_clone (const SharedShiftedVirtualZeroesArray< Fr > &array, size_t right_expansion=0, size_t left_expansion=0)
 
template<typename Fr >
std::shared_ptr< Fr[]> _allocate_aligned_memory (size_t n_elements)
 
template<typename Fr_ >
Fr_ _evaluate_mle (std::span< const Fr_ > evaluation_points, const SharedShiftedVirtualZeroesArray< Fr_ > &coefficients, bool shift)
 Internal implementation to support both native and stdlib circuit field types.
 
template<typename Fr_ >
Fr_ generic_evaluate_mle (std::span< const Fr_ > evaluation_points, const SharedShiftedVirtualZeroesArray< Fr_ > &coefficients)
 Static exposed implementation to support both native and stdlib circuit field types.
 
template<typename Fr >
std::ostream & operator<< (std::ostream &os, const Polynomial< Fr > &p)
 
template<typename Poly , typename... Polys>
auto zip_polys (Poly &&poly, Polys &&... polys)
 
template<typename B , class Fr , size_t domain_end, size_t domain_start = 0>
void read (B &it, Univariate< Fr, domain_end, domain_start > &univariate)
 
template<typename B , class Fr , size_t domain_end, size_t domain_start = 0>
void write (B &it, Univariate< Fr, domain_end, domain_start > const &univariate)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator+ (const Fr &ff, const Univariate< Fr, domain_end, domain_start, skip_count > &uv)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator- (const Fr &ff, const Univariate< Fr, domain_end, domain_start, skip_count > &uv)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator* (const Fr &ff, const Univariate< Fr, domain_end, domain_start, skip_count > &uv)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator+ (const Fr &ff, const UnivariateView< Fr, domain_end, domain_start, skip_count > &uv)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator- (const Fr &ff, const UnivariateView< Fr, domain_end, domain_start, skip_count > &uv)
 
template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > operator* (const Fr &ff, const UnivariateView< Fr, domain_end, domain_start, skip_count > &uv)
 
template<typename T , typename U , std::size_t N, std::size_t... Is>
std::array< T, sizeof...(Is)> array_to_array_aux (const std::array< U, N > &elements, std::index_sequence< Is... >)
 Create a sub-array of elements at the indices given in the template pack Is, converting them to the new type T.
 
template<typename T , typename U , std::size_t N>
std::array< T, N > array_to_array (const std::array< U, N > &elements)
 Given an std::array<U,N>, returns an std::array<T,N>, by calling the (explicit) constructor T(U).
 
template<typename B , class Fr , size_t domain_end, bool has_a0_plus_a1>
void read (B &it, UnivariateCoefficientBasis< Fr, domain_end, has_a0_plus_a1 > &univariate)
 
template<typename B , class Fr , size_t domain_end, bool has_a0_plus_a1>
void write (B &it, UnivariateCoefficientBasis< Fr, domain_end, has_a0_plus_a1 > const &univariate)
 
template<typename FF , size_t NUM>
std::tuple< FF, std::vector< FF > > compute_vanishing_polynomial_and_lagrange_evaluations (const FF &combiner_challenge)
 
template<typename FF >
std::vector< FFupdate_gate_challenges (const FF &perturbator_challenge, const std::vector< FF > &gate_challenges, const std::vector< FF > &init_challenges)
 Compute the gate challenges used in the combiner calculation.
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMBoolsRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMLookupRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMMSMRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMPointTableRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMSetRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_PERMUTATION_CLASS (ECCVMSetRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMTranscriptRelationImpl, ECCVMFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (ECCVMWnafRelationImpl, ECCVMFlavor)
 
template<typename Relation , size_t subrelation_index>
constexpr bool subrelation_is_linearly_independent ()
 Check whether a given subrelation is linearly independent from the other subrelations.
 
template<typename RelationImpl >
consteval std::array< size_t, RelationImpl::SUBRELATION_PARTIAL_LENGTHS.size()> compute_total_subrelation_lengths ()
 Compute the total subrelation lengths, i.e., the lengths when regarding the challenges as variables.
 
template<size_t NUM_KEYS, size_t NUM_SUBRELATIONS>
consteval std::array< size_t, NUM_SUBRELATIONS > compute_composed_subrelation_partial_lengths (std::array< size_t, NUM_SUBRELATIONS > SUBRELATION_PARTIAL_LENGTHS)
 Get the subrelation accumulators for the Protogalaxy combiner calculation.
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorDeltaRangeConstraintRelationImpl, TranslatorFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorOpcodeConstraintRelationImpl, TranslatorFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorAccumulatorTransferRelationImpl, TranslatorFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorZeroConstraintsRelationImpl, TranslatorFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorNonNativeFieldRelationImpl, TranslatorFlavor)
 
 DEFINE_SUMCHECK_RELATION_CLASS (TranslatorPermutationRelationImpl, TranslatorFlavor)
 
std::vector< g1::affine_elementget_bn254_g1_data (const std::filesystem::path &path, size_t num_points, bool allow_download)
 
g2::affine_element get_bn254_g2_data (const std::filesystem::path &path, bool allow_download)
 
std::vector< curve::Grumpkin::AffineElementget_grumpkin_g1_data (const std::filesystem::path &path, size_t num_points, bool allow_download)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMBoolsRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMLookupRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMMSMRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMPointTableRelationImpl, ECCVMRecursiveFlavor)
 
 TEST_F (EccRelationsConsistency, RecursiveToNativeConsistency)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMSetRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_PERMUTATION_CLASS (ECCVMSetRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMTranscriptRelationImpl, ECCVMRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (ECCVMWnafRelationImpl, ECCVMRecursiveFlavor)
 
 TEST_F (ECCVMRecursiveTests, SingleRecursiveVerification)
 
 TEST_F (ECCVMRecursiveTests, SingleRecursiveVerificationFailure)
 
 TEST_F (ECCVMRecursiveTests, SingleRecursiveVerificationFailureTamperedProof)
 
 TEST_F (ECCVMRecursiveTests, IndependentVKHash)
 
 TYPED_TEST_SUITE (RecursiveVeriferCommitmentKeyTest, Curves)
 
 TYPED_TEST (RecursiveVeriferCommitmentKeyTest, EqualityTest)
 
template<typename InnerProver , typename InnerFlavor , typename ProofType >
void tamper_with_proof (InnerProver &inner_prover, ProofType &inner_proof, TamperType type)
 Test method that provides several ways to tamper with a proof. TODO(https://github.com/AztecProtocol/barretenberg/issues/1298): Currently, several tests are failing due to challenges not being re-computed after tampering. We need to extend this tool to allow for more elaborate tampering.
 
template<typename InnerProver , typename InnerFlavor , typename ProofType >
void tamper_with_proof (ProofType &inner_proof, bool end_of_proof)
 Tamper with a proof by finding the first non-zero value and incrementing it by 1 and by modifying the last commitment.
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorDecompositionRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorDeltaRangeConstraintRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorOpcodeConstraintRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorAccumulatorTransferRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorZeroConstraintsRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorNonNativeFieldRelationImpl, TranslatorRecursiveFlavor)
 
 DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS (TranslatorPermutationRelationImpl, TranslatorRecursiveFlavor)
 
 TEST_F (TranslatorRecursiveTests, SingleRecursiveVerification)
 
 TEST_F (TranslatorRecursiveTests, IndependentVKHash)
 
template<typename FF , size_t N>
std::array< FF, N > initialize_relation_separator (const FF &alpha)
 
void check_child_tags (const uint256_t &tag_a, const uint256_t &tag_b)
 Detect if two elements from the same transcript are performing a suspicious interaction.
 
std::ostream & operator<< (std::ostream &os, OriginTag const &v)
 
bb::fr keccak_hash_uint256 (std::vector< uint256_t > const &data)
 

Variables

const char *const BB_VERSION_PLACEHOLDER = "00000000.00000000.00000000"
 
constexpr size_t MIN_LOG_NUM_POINTS = 16
 
constexpr size_t MAX_LOG_NUM_POINTS = 20
 
constexpr size_t MAX_NUM_POINTS = 1 << MAX_LOG_NUM_POINTS
 
constexpr size_t SPARSE_NUM_NONZERO = 100
 
constexpr size_t MIN_LOG_NUM_GRUMPKIN_POINTS = 12
 
constexpr size_t MAX_LOG_NUM_GRUMPKIN_POINTS = 16
 
constexpr size_t MAX_NUM_GRUMPKIN_POINTS = 1 << MAX_LOG_NUM_GRUMPKIN_POINTS
 
constexpr size_t COMMITMENT_TEST_NUM_BN254_POINTS = 4096
 
constexpr size_t COMMITMENT_TEST_NUM_GRUMPKIN_POINTS = 1 << CONST_ECCVM_LOG_N
 
constexpr size_t COMMITMENT_TEST_NUM_POINTS = 32
 
CommitmentKey< Curveck
 
VerifierCommitmentKey< Curvevk
 
const size_t DEFAULT_MIN_ITERS_PER_THREAD = 1 << 4
 
constexpr uint32_t PERMUTATION_ARGUMENT_VALUE_SEPARATOR = 1 << 28
 
const size_t INTERNAL_STATE_SIZE = 32
 Constant defining the number of elements in the VM's internal state.
 
const size_t SETTINGS_SIZE = sizeof(VMSettings)
 
const size_t INSTRUCTION_HEADER_SIZE = 1
 Size of instruction header in bytes.
 
const size_t INDEX_SIZE = 1
 Size of index field in bytes.
 
const size_t SET_VALUE_SIZE
 Size of SET_VALUE instruction.
 
const size_t ADD_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3
 Size of ADD instruction.
 
const size_t ADD_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of ADD_ASSIGN instruction.
 
const size_t INCREMENT_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE
 Size of INCREMENT instruction.
 
const size_t MUL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3
 Size of MUL instruction.
 
const size_t MUL_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of MUL_ASSIGN instruction.
 
const size_t SUB_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3
 Size of SUB instruction.
 
const size_t SUB_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of SUB_ASSIGN instruction.
 
const size_t DIV_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3
 Size of DIV instruction.
 
const size_t DIV_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of DIV_ASSIGN instruction.
 
const size_t INV_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of INV instruction.
 
const size_t NEG_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of NEG instruction.
 
const size_t SQR_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of SQR instruction.
 
const size_t SQR_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE
 Size of SQR_ASSIGN instruction.
 
const size_t POW_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3 + sizeof(uint64_t)
 Size of POW instruction.
 
const size_t SQRT_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of SQRT instruction.
 
const size_t IS_ZERO_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE
 Size of IS_ZERO instruction.
 
const size_t EQUAL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of EQUAL instruction.
 
const size_t NOT_EQUAL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of NOT_EQUAL instruction.
 
const size_t TO_MONTGOMERY_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of TO_MONTGOMERY instruction.
 
const size_t FROM_MONTGOMERY_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of FROM_MONTGOMERY instruction.
 
const size_t REDUCE_ONCE_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2
 Size of REDUCE_ONCE instruction.
 
const size_t SELF_REDUCE_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE
 Size of SELF_REDUCE instruction.
 
const size_t BATCH_INVERT_SIZE
 Size of BATCH_INVERT instruction.
 
template<typename T >
constexpr bool is_field_type_v = is_field_type<T>::value
 
constexpr uint32_t NUM_DATABUS_COMMITMENTS = 2
 
constexpr uint32_t PROPAGATED_DATABUS_COMMITMENT_SIZE = 8
 
constexpr uint32_t PROPAGATED_DATABUS_COMMITMENTS_SIZE = PROPAGATED_DATABUS_COMMITMENT_SIZE * NUM_DATABUS_COMMITMENTS
 
template<typename T >
constexpr bool is_iterable_v = is_iterable<T>::value
 
std::atomic< size_t > unique_transcript_index { 0 }
 

Detailed Description

Entry point for Barretenberg command-line interface.

Defines particular circuit builder types expected to be used for circuit construction in stdlib and contains macros for explicit instantiation.

Note, this file contains the definitions. of field2 class. Declarations are in field2_declarations.hpp. Include ordering ensures linter/language server has knowledge of declarations when parsing definitions.

Provides interfaces for different PCS 'VerificationKey' classes.

Reduces multiple claims about commitments, each opened at a single point into a single claim for a single polynomial opened at a single point.

Protocol for opening several multi-linear polynomials at the same point.

Provides interfaces for different 'CommitmentKey' classes.

This function encapsulates the CLI parsing and command execution logic that would typically be in main.cpp, but as a standalone function. This design allows the CLI functionality to be tested by other modules without having to execute the program through its actual main() function.

The function sets up all available commands and options, parses the provided arguments, and executes the appropriate command based on the user's input. It handles all supported operations including circuit checking, proving, verification, and various utility functions.

Parameters
argcThe argument count
argvThe argument values array
Returns
int Status code: 0 for success, non-zero for errors or verification failure

TODO(#218)(Mara): This class should handle any modification to the SRS (e.g compute pippenger point table) to simplify the codebase.

m = number of variables n = 2ᵐ u = (u₀,...,uₘ₋₁) f₀, …, fₖ₋₁ = multilinear polynomials, g₀, …, gₕ₋₁ = shifted multilinear polynomial, Each gⱼ is the left-shift of some f↺ᵢ, and gⱼ points to the same memory location as fᵢ. v₀, …, vₖ₋₁, v↺₀, …, v↺ₕ₋₁ = multilinear evalutions s.t. fⱼ(u) = vⱼ, and gⱼ(u) = f↺ⱼ(u) = v↺ⱼ

We use a challenge ρ to create a random linear combination of all fⱼ, and actually define A₀ = F + G↺, where F = ∑ⱼ ρʲ fⱼ G = ∑ⱼ ρᵏ⁺ʲ gⱼ, G↺ = is the shift of G where fⱼ is normal, and gⱼ is shifted. The evaluations are also batched, and v = ∑ ρʲ⋅vⱼ + ∑ ρᵏ⁺ʲ⋅v↺ⱼ = F(u) + G↺(u)

The prover then creates the folded polynomials A₀, ..., Aₘ₋₁, and opens them at different points, as univariates.

We open A₀ as univariate at r and -r. Since A₀ = F + G↺, but the verifier only has commitments to the gⱼs, we need to partially evaluate A₀ at both evaluation points. As univariate, we have A₀(X) = F(X) + G↺(X) = F(X) + G(X)/X So we define

  • A₀₊(X) = F(X) + G(X)/r
  • A₀₋(X) = F(X) − G(X)/r So that A₀₊(r) = A₀(r) and A₀₋(-r) = A₀(-r). The verifier is able to compute the simulated commitments to A₀₊(X) and A₀₋(X) since they are linear-combinations of the commitments [fⱼ] and [gⱼ].

m = number of variables n = 2ᵐ u = (u₀,...,uₘ₋₁) f₀, …, fₖ₋₁ = multilinear polynomials, g₀, …, gₕ₋₁ = shifted multilinear polynomial, Each gⱼ is the left-shift of some f↺ᵢ, and gⱼ points to the same memory location as fᵢ. v₀, …, vₖ₋₁, v↺₀, …, v↺ₕ₋₁ = multilinear evalutions s.t. fⱼ(u) = vⱼ, and gⱼ(u) = f↺ⱼ(u) = v↺ⱼ

We use a challenge ρ to create a random linear combination of all fⱼ, and actually define A₀ = F + G↺, where F = ∑ⱼ ρʲ fⱼ G = ∑ⱼ ρᵏ⁺ʲ gⱼ, G↺ = is the shift of G where fⱼ is normal, and gⱼ is shifted. The evaluations are also batched, and v = ∑ ρʲ⋅vⱼ + ∑ ρᵏ⁺ʲ⋅v↺ⱼ = F(u) + G↺(u)

The prover then creates the folded polynomials A₀, ..., Aₘ₋₁, and opens them at different points, as univariates.

We open A₀ as univariate at r and -r. Since A₀ = F + G↺, but the verifier only has commitments to the gⱼs, we need to partially evaluate A₀ at both evaluation points. As univariate, we have A₀(X) = F(X) + G↺(X) = F(X) + G(X)/X So we define

  • A₀₊(X) = F(X) + G(X)/r
  • A₀₋(X) = F(X) − G(X)/r So that A₀₊(r) = A₀(r) and A₀₋(-r) = A₀(-r). The verifier is able to computed the simulated commitments to A₀₊(X) and A₀₋(X) since they are linear-combinations of the commitments [fⱼ] and [gⱼ].

We use the following terminology:

  • Bₖ(X) is a random linear combination of all polynomials opened at Ωₖ we refer to it a 'merged_polynomial'.
  • Tₖ(X) is the polynomial that interpolates Bₖ(X) over Ωₖ,
  • zₖ(X) is the product of all (X-x), for x ∈ Ωₖ
  • ẑₖ(X) = 1/zₖ(X)

The challenges are ρ (batching) and r (random evaluation).

There's a lot to talk about here. To bring threading to WASM, parallel_for was written to replace the OpenMP loops we had scattered throughout our code. It provides a clean abstraction for the work division strategy we use (we used OMP's"#pragma omp parallel for</tt> everywhere). The first implementation was <tt>parallel_for_spawning</tt>. You can read a description of each implementation in the relevant source file, but parallel_for_spawning is the simplest approach imaginable. Once WASM was working, I checked its performance in native code by running it against the polynomials benchmarks. In doing so, OMP outperformed it significantly (at least for FFT algorithms). This set me on a course to try and understand why and to provide a suitable alternative. Ultimately I found solutions that compared to OMP with "moody" and "atomic_pool" solutions, although they were not <em>quite</em> as fast as OMP. However interestingly, when it comes to actual "real world" testing (with proof construction), rather than raw benchmarking, most of the solutions performed about the same, with OMP <em>actually slightly worse</em>. So maybe all this effort was a bit redundant. Remember to always do real world testing... My theory as to why OMP performs so much better in benchmarks is because it runs the tests in a very tight loop, and OMP seems well designed to handle this. It actually looks like OMP consumes more cpu time in htop, and this maybe due to aggressive spin-locking and may explain why it performs well in these scenarios. My theory as to why spawning seems to counter-intuitively perform so well, is that spawning a new thread may actually be cheaper than waking a sleeping thread. Or joining is somehow very efficient. Or it's because there's very low other overhead. Or libc++ STL does some magic. Ok, that's not much of a theory... Ultimately though the takeaway is as follows: - OMP maybe preferable when running benchmarks if you want to check for that kind of "optimal linear scaling". Although, if we want to get rid of OMP altogether, "atomic_pool" is a simple solution that seems to compare. - The simplest "spawning" is probably best used everywhere else, and frees us from needing OMP to build the lib. UPDATE!: So although spawning is simple and fast, due to unstable pthreads in wasi-sdk that causes hangs when joining threads, we use "atomic_pool" by default. We may just wish to revert to spawning once it stablises. UPDATE!: Interestingly "atomic_pool" performs worse than "mutex_pool" for some e.g. proving key construction. Haven't done deeper analysis. Defaulting to mutex_pool.

This file is designed to be included in header files to instruct the compiler that these classes exist and their instantiation will eventually take place. Given it has no dependencies, it causes no additional compilation or propagation.

Typedef Documentation

◆ ArrayOfValues

template<typename FF , auto LENGTHS>
using bb::ArrayOfValues = typedef HomogeneousTupleToArray<TupleOfValues<FF, LENGTHS> >

Definition at line 59 of file nested_containers.hpp.

◆ BarycentricData

template<class Fr , size_t domain_end, size_t num_evals, size_t domain_start = 0>
using bb::BarycentricData = typedef std::conditional_t<is_field_type_v<Fr>, BarycentricDataCompileTime<Fr, domain_end, num_evals, domain_start>, BarycentricDataRunTime<Fr, domain_end, num_evals, domain_start> >

Exposes BarycentricData with compile time arrays if the type is bberg::field and runtime arrays otherwise.

This method is also needed for stdlib field, for which the arrays are not compile time computable

Template Parameters
Fr
domain_size
num_evals

Definition at line 268 of file barycentric.hpp.

◆ CommitmentSchemeParams

using bb::CommitmentSchemeParams = typedef ::testing::Types<curve::BN254>

Definition at line 303 of file commitment_key.test.hpp.

◆ Curve

Definition at line 19 of file ipa.fuzzer.cpp.

◆ Curves

◆ CurveTypes

using bb::CurveTypes = typedef ::testing::Types<curve::BN254, curve::Grumpkin>

Definition at line 17 of file shplonk.test.cpp.

◆ CyclicPermutation

using bb::CyclicPermutation = typedef std::vector<cycle_node>

Definition at line 127 of file permutation_lib.hpp.

◆ DataBus

using bb::DataBus = typedef std::array<BusVector, 3>

The DataBus; facilitates storage of public circuit input/output.

The DataBus is designed to facilitate efficient transfer of large amounts of public data between circuits. It is expected that only a small subset of the data being passed needs to be used in any single circuit, thus we provide a read mechanism (implemented through a Builder) that results in prover work proportional to only the data that is used. (The prover must still commit to all data in each bus vector but we do not need to hash all data in-circuit as we would with public inputs).

Definition at line 76 of file databus.hpp.

◆ DatabusLookupRelation

template<typename FF >
using bb::DatabusLookupRelation = typedef Relation<DatabusLookupRelationImpl<FF> >

Definition at line 380 of file databus_lookup_relation.hpp.

◆ DeltaRangeConstraintRelation

◆ EccOpQueueRelation

template<typename FF >
using bb::EccOpQueueRelation = typedef Relation<EccOpQueueRelationImpl<FF> >

Definition at line 118 of file ecc_op_queue_relation.hpp.

◆ ECCVMBoolsRelation

template<typename FF >
using bb::ECCVMBoolsRelation = typedef Relation<ECCVMBoolsRelationImpl<FF> >

Definition at line 37 of file ecc_bools_relation.hpp.

◆ ECCVMLookupRelation

template<typename FF >
using bb::ECCVMLookupRelation = typedef Relation<ECCVMLookupRelationImpl<FF> >

Definition at line 255 of file ecc_lookup_relation.hpp.

◆ ECCVMMSMRelation

template<typename FF >
using bb::ECCVMMSMRelation = typedef Relation<ECCVMMSMRelationImpl<FF> >

Definition at line 57 of file ecc_msm_relation.hpp.

◆ EccvmOpsTable

A VM operation is represented as one row with 6 columns in the ECCVM version of the Op Queue. | OP | X | Y | z_1 | z_2 | mul_scalar_full |.

Definition at line 203 of file ecc_ops_table.hpp.

◆ ECCVMPointTableRelation

template<typename FF >
using bb::ECCVMPointTableRelation = typedef Relation<ECCVMPointTableRelationImpl<FF> >

Definition at line 37 of file ecc_point_table_relation.hpp.

◆ ECCVMSetRelation

template<typename FF >
using bb::ECCVMSetRelation = typedef Relation<ECCVMSetRelationImpl<FF> >

Definition at line 61 of file ecc_set_relation.hpp.

◆ ECCVMTranscriptRelation

template<typename FF >
using bb::ECCVMTranscriptRelation = typedef Relation<ECCVMTranscriptRelationImpl<FF> >

Definition at line 62 of file ecc_transcript_relation.hpp.

◆ ECCVMWnafRelation

template<typename FF >
using bb::ECCVMWnafRelation = typedef Relation<ECCVMWnafRelationImpl<FF> >

Definition at line 55 of file ecc_wnaf_relation.hpp.

◆ EllipticRelation

template<typename FF >
using bb::EllipticRelation = typedef Relation<EllipticRelationImpl<FF> >

Definition at line 126 of file elliptic_relation.hpp.

◆ evaluation_domain

Definition at line 76 of file evaluation_domain.hpp.

◆ ExtractValueType

template<typename ValueType , size_t , size_t , size_t >
using bb::ExtractValueType = typedef ValueType

Definition at line 42 of file nested_containers.hpp.

◆ FF

using bb::FF = typedef typename Flavor::FF

Definition at line 16 of file protogalaxy.bench.cpp.

◆ Flavor

Definition at line 15 of file protogalaxy.bench.cpp.

◆ fq

using bb::fq = typedef field<Bn254FqParams>

Definition at line 169 of file fq.hpp.

◆ fq12

using bb::fq12 = typedef field12<fq2, fq6, Bn254Fq12Params>

Definition at line 49 of file fq12.hpp.

◆ fq2

using bb::fq2 = typedef field2<fq, Bn254Fq2Params>

Definition at line 67 of file fq2.hpp.

◆ fq6

using bb::fq6 = typedef field6<fq2, Bn254Fq6Params>

Definition at line 98 of file fq6.hpp.

◆ fr

using bb::fr = typedef field<Bn254FrParams>

Definition at line 174 of file fr.hpp.

◆ g1

using bb::g1 = typedef group<fq, fr, Bn254G1Params>

Definition at line 33 of file g1.hpp.

◆ g2

using bb::g2 = typedef group<fq2, fr, Bn254G2Params>

Definition at line 39 of file g2.hpp.

◆ GenericLookup

template<typename Settings , typename FF >
using bb::GenericLookup = typedef GenericLookupRelationImpl<Settings, FF>

Definition at line 477 of file generic_lookup_relation.hpp.

◆ GenericLookupRelation

template<typename Settings , typename FF >
using bb::GenericLookupRelation = typedef Relation<GenericLookupRelationImpl<Settings, FF> >

Definition at line 475 of file generic_lookup_relation.hpp.

◆ GenericPermutation

template<typename Settings , typename FF >
using bb::GenericPermutation = typedef GenericPermutationRelationImpl<Settings, FF>

Definition at line 227 of file generic_permutation_relation.hpp.

◆ GenericPermutationRelation

template<typename Settings , typename FF >
using bb::GenericPermutationRelation = typedef Relation<GenericPermutationRelationImpl<Settings, FF> >

Definition at line 225 of file generic_permutation_relation.hpp.

◆ GetParameterView

template<typename Params , typename View >
using bb::GetParameterView = typedef std::conditional_t<IsField<typename Params::DataType>, typename Params::DataType, View>

A type to optionally extract a view of a relation parameter in a relation.

In sumcheck, challenges in relations are always field elements, but in folding we need univariate challenges. This template inspecting the underlying type of a RelationParameters instance. When this type is a field type, do nothing, otherwise apply the provided view type.

Template Parameters
Params
View
Todo:
TODO(https://github.com/AztecProtocol/barretenberg/issues/759): Optimize

Definition at line 28 of file relation_types.hpp.

◆ HomogeneousTupleToArray

template<typename Tuple >
using bb::HomogeneousTupleToArray = typedef std::array<std::tuple_element_t<0, Tuple>, std::tuple_size_v<Tuple> >

Definition at line 45 of file nested_containers.hpp.

◆ HonkProof

using bb::HonkProof = typedef std::vector<fr>

Definition at line 15 of file proof.hpp.

◆ IpaCommitmentSchemeParams

using bb::IpaCommitmentSchemeParams = typedef ::testing::Types<curve::Grumpkin>

Definition at line 304 of file commitment_key.test.hpp.

◆ KeccakTranscript

Definition at line 824 of file transcript.hpp.

◆ LogDerivLookupRelation

template<typename FF >
using bb::LogDerivLookupRelation = typedef Relation<LogDerivLookupRelationImpl<FF> >

Definition at line 300 of file logderiv_lookup_relation.hpp.

◆ MegaCircuitBuilder

◆ MegaDeciderProver

Definition at line 63 of file decider_prover.hpp.

◆ MegaDeciderVerifier

Definition at line 59 of file decider_verifier.hpp.

◆ MegaOinkProver

Definition at line 83 of file oink_prover.hpp.

◆ MegaProver

Definition at line 75 of file ultra_prover.hpp.

◆ MegaVerifier

Definition at line 63 of file ultra_verifier.hpp.

◆ MegaZKDeciderProver

Definition at line 64 of file decider_prover.hpp.

◆ MegaZKDeciderVerifier

Definition at line 60 of file decider_verifier.hpp.

◆ MegaZKProver

Definition at line 76 of file ultra_prover.hpp.

◆ MegaZKVerifier

Definition at line 64 of file ultra_verifier.hpp.

◆ MemoryRelation

template<typename FF >
using bb::MemoryRelation = typedef Relation<MemoryRelationImpl<FF> >

Definition at line 277 of file memory_relation.hpp.

◆ NativeTranscript

Definition at line 755 of file transcript.hpp.

◆ NonNativeFieldRelation

template<typename FF >
using bb::NonNativeFieldRelation = typedef Relation<NonNativeFieldRelationImpl<FF> >

Definition at line 151 of file non_native_field_relation.hpp.

◆ poly_triple

Definition at line 69 of file gate_data.hpp.

◆ Poseidon2ExternalRelation

Definition at line 128 of file poseidon2_external_relation.hpp.

◆ Poseidon2InternalRelation

Definition at line 117 of file poseidon2_internal_relation.hpp.

◆ PublicInputsVector

using bb::PublicInputsVector = typedef std::vector<fr>

Definition at line 14 of file proof.hpp.

◆ SlabVector

template<typename T >
using bb::SlabVector = typedef std::vector<T, bb::ContainerSlabAllocator<T> >

A vector that uses the slab allocator.

Definition at line 82 of file slab_allocator.hpp.

◆ StdlibPublicInputsVector

template<typename Builder >
using bb::StdlibPublicInputsVector = typedef std::vector<bb::stdlib::field_t<Builder> >

Definition at line 32 of file proof.hpp.

◆ TestFlavors

using bb::TestFlavors = typedef ::testing::Types<BN254Settings, GrumpkinSettings>

Definition at line 47 of file small_subgroup_ipa.test.cpp.

◆ TestSettings

using bb::TestSettings = typedef ::testing::Types<BN254Settings, GrumpkinSettings>

Definition at line 42 of file shplemini.test.cpp.

◆ TranslatorAccumulatorTransferRelation

◆ TranslatorDecompositionRelation

◆ TranslatorDeltaRangeConstraintRelation

◆ TranslatorNonNativeFieldRelation

◆ TranslatorOpcodeConstraintRelation

◆ TranslatorPermutationRelation

◆ TranslatorZeroConstraintsRelation

◆ TupleOfUnivariates

template<typename FF , auto LENGTHS>
using bb::TupleOfUnivariates = typedef typename TupleOfContainersOverArray<bb::Univariate, FF, LENGTHS, 0, 0>::type

Definition at line 49 of file nested_containers.hpp.

◆ TupleOfUnivariatesWithOptimisticSkipping

template<typename FF , auto LENGTHS, size_t SKIP_COUNT>
using bb::TupleOfUnivariatesWithOptimisticSkipping = typedef typename TupleOfContainersOverArray<bb::Univariate, FF, LENGTHS, 0, SKIP_COUNT>::type

Definition at line 53 of file nested_containers.hpp.

◆ TupleOfValues

template<typename FF , auto LENGTHS>
using bb::TupleOfValues = typedef typename TupleOfContainersOverArray<ExtractValueType, FF, LENGTHS>::type

Definition at line 57 of file nested_containers.hpp.

◆ UltraArithmeticRelation

template<typename FF >
using bb::UltraArithmeticRelation = typedef Relation<UltraArithmeticRelationImpl<FF> >

Definition at line 127 of file ultra_arithmetic_relation.hpp.

◆ UltraCircuitBuilder

◆ UltraDeciderProver

Definition at line 62 of file decider_prover.hpp.

◆ UltraDeciderVerifier

Definition at line 58 of file decider_verifier.hpp.

◆ UltraKeccakProver

Definition at line 69 of file ultra_prover.hpp.

◆ UltraKeccakVerifier

Definition at line 59 of file ultra_verifier.hpp.

◆ UltraKeccakZKProver

Definition at line 74 of file ultra_prover.hpp.

◆ UltraPermutationRelation

Definition at line 206 of file permutation_relation.hpp.

◆ UltraProver

Definition at line 67 of file ultra_prover.hpp.

◆ UltraRollupVerifier

Definition at line 58 of file ultra_verifier.hpp.

◆ UltraVerifier

Definition at line 57 of file ultra_verifier.hpp.

◆ UltraZKProver

Definition at line 68 of file ultra_prover.hpp.

Enumeration Type Documentation

◆ BusId

enum class bb::BusId
strong
Enumerator
CALLDATA 
SECONDARY_CALLDATA 
RETURNDATA 

Definition at line 77 of file databus.hpp.

◆ CircuitType

enum class bb::CircuitType : uint32_t
strong
Enumerator
STANDARD 
ULTRA 
UNDEFINED 

Definition at line 12 of file circuit_type.hpp.

◆ CurveType

Enumerator
BN254 
SECP256K1 
SECP256R1 
GRUMPKIN 

Definition at line 10 of file types.hpp.

◆ GenericPermutationSettingIndices

Specifies positions of elements in the tuple of entities received from methods in the Settings class.

Enumerator
INVERSE_POLYNOMIAL_INDEX 
ENABLE_INVERSE_CORRECTNESS_CHECK_POLYNOMIAL_INDEX 
FIRST_PERMUTATION_SET_ENABLE_POLYNOMIAL_INDEX 
SECOND_PERMUTATION_SET_ENABLE_POLYNOMIAL_INDEX 
PERMUTATION_SETS_START_POLYNOMIAL_INDEX 

Definition at line 28 of file generic_permutation_relation.hpp.

◆ Instruction

enum class bb::Instruction
strong

Enumeration of VM instructions that can be executed.

Each instruction corresponds to a specific field arithmetic operation. The VM parses these instructions from input data and executes them sequentially.

Enumerator
SET_VALUE 

Set a field element to a specific value.

ADD 

Add two field elements.

ADD_ASSIGN 

Add-assign operation.

INCREMENT 

Increment a field element by 1.

MUL 

Multiply two field elements.

MUL_ASSIGN 

Multiply-assign operation.

SUB 

Subtract two field elements.

SUB_ASSIGN 

Subtract-assign operation.

DIV 

Divide two field elements.

DIV_ASSIGN 

Divide-assign operation.

INV 

Invert a field element.

NEG 

Negate a field element.

SQR 

Square a field element.

SQR_ASSIGN 

Square-assign operation.

POW 

Raise a field element to a power.

SQRT 

Compute square root of a field element.

IS_ZERO 

Check if a field element is zero.

EQUAL 

Check if two field elements are equal.

NOT_EQUAL 

Check if two field elements are not equal.

TO_MONTGOMERY 

Convert to Montgomery form.

FROM_MONTGOMERY 

Convert from Montgomery form.

REDUCE_ONCE 

Reduce a field element once.

SELF_REDUCE 

Self-reduce a field element.

BATCH_INVERT 

Batch invert multiple field elements.

Definition at line 76 of file field.fuzzer.hpp.

◆ MergeSettings

The MergeSettings define whether an current subtable will be added at the beginning (PREPEND) or at the end (APPEND) of the EccOpQueue.

Enumerator
PREPEND 
APPEND 

Definition at line 21 of file ecc_ops_table.hpp.

◆ TamperType

enum class bb::TamperType
strong
Enumerator
MODIFY_SUMCHECK_UNIVARIATE 
MODIFY_SUMCHECK_EVAL 
MODIFY_Z_PERM_COMMITMENT 
MODIFY_GEMINI_WITNESS 
END 

Definition at line 14 of file tamper_proof.hpp.

Function Documentation

◆ _allocate_aligned_memory()

template<typename Fr >
std::shared_ptr< Fr[]> bb::_allocate_aligned_memory ( size_t  n_elements)

Definition at line 450 of file polynomial.hpp.

◆ _bench_round()

void bb::_bench_round ( ::benchmark::State &  state,
void(*)(ProtogalaxyProver_< Flavor > &)  F 
)

Definition at line 14 of file protogalaxy_rounds.bench.cpp.

◆ _clone()

template<typename Fr >
SharedShiftedVirtualZeroesArray< Fr > bb::_clone ( const SharedShiftedVirtualZeroesArray< Fr > &  array,
size_t  right_expansion = 0,
size_t  left_expansion = 0 
)

Definition at line 31 of file polynomial.cpp.

◆ _evaluate_mle()

template<typename Fr_ >
Fr_ bb::_evaluate_mle ( std::span< const Fr_ >  evaluation_points,
const SharedShiftedVirtualZeroesArray< Fr_ > &  coefficients,
bool  shift 
)

Internal implementation to support both native and stdlib circuit field types.

Instantiation with circuit field type is always called with shift == false

Definition at line 461 of file polynomial.hpp.

◆ accumulate_and_prove_ivc_with_precomputed_vks()

std::pair< ClientIVC::Proof, ClientIVC::VerificationKey > bb::accumulate_and_prove_ivc_with_precomputed_vks ( size_t  num_app_circuits,
auto &  precomputed_vks,
const bool  large_first_app = true 
)

Perform a specified number of circuit accumulation rounds.

Parameters
NUM_CIRCUITSNumber of circuits to accumulate (apps + kernels)

Definition at line 38 of file test_bench_shared.hpp.

◆ accumulate_logderivative_lookup_subrelation_contributions()

template<typename FF , typename Relation , typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
void bb::accumulate_logderivative_lookup_subrelation_contributions ( ContainerOverSubrelations &  accumulator,
const AllEntities &  in,
const Parameters &  params,
const FF scaling_factor 
)

Compute generic log-derivative lookup subrelation accumulation.

The generic log-derivative lookup relation consistes of two subrelations. The first demonstrates that the inverse polynomial I, defined via I_i = 1/[(read_term_i) * (write_term_i)], has been computed correctly. The second establishes the correctness of the lookups themselves based on the log-derivative lookup argument. Note that the latter subrelation is "linearly dependent" in the sense that it establishes that a sum across all rows of the exectution trace is zero, rather than that some expression holds independently at each row. Accordingly, this subrelation is not multiplied by a scaling factor at each accumulation step. The subrelation expressions are respectively:

I_i * (read_term_i) * (write_term_i) - 1 = 0

\sum_{i=0}^{n-1} [q_{logderiv_lookup} * I_i * write_term_i + read_count_i * I_i * read_term_i] = 0

The explicit expressions for read_term and write_term are dependent upon the particular structure of the lookup being performed and methods for computing them must be defined in the corresponding relation class.

Template Parameters
FF
Relation
ContainerOverSubrelations
AllEntities
Parameters
Parameters
accumulator
in
params
scaling_factor

Definition at line 119 of file logderivative_library.hpp.

◆ accumulate_logderivative_permutation_subrelation_contributions()

template<typename FF , typename Relation , typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
void bb::accumulate_logderivative_permutation_subrelation_contributions ( ContainerOverSubrelations &  accumulator,
const AllEntities &  in,
const Parameters &  params,
const FF scaling_factor 
)

Compute generic log-derivative set permutation subrelation accumulation.

The generic log-derivative lookup relation consistes of two subrelations. The first demonstrates that the inverse polynomial I, defined via I = 1/[(read_term) * (write_term)], has been computed correctly. The second establishes the correctness of the permutation itself based on the log-derivative argument. Note that the latter subrelation is "linearly dependent" in the sense that it establishes that a sum across all rows of the execution trace is zero, rather than that some expression holds independently at each row. Accordingly, this subrelation is not multiplied by a scaling factor at each accumulation step. The subrelation expressions are respectively:

I * (read_term) * (write_term) - q_{permutation_enabler} = 0

\sum_{i=0}^{n-1} [q_{write_enabler} * I * write_term + q_{read_enabler} * I * read_term] = 0

The explicit expressions for read_term and write_term are dependent upon the particular structure of the permutation being performed and methods for computing them must be defined in the corresponding relation class. The entities which are used to determine the use of permutation (is it enabled, is the first "read" set enabled, is the second "write" set enabled) must be defined in the relation class.

Template Parameters
FF
Relation
ContainerOverSubrelations
AllEntities
Parameters
Parameters
accumulator
in
params
scaling_factor

Definition at line 215 of file logderivative_library.hpp.

◆ add_variables()

std::vector< uint32_t > bb::add_variables ( UltraCircuitBuilder builder,
std::vector< fr variables 
)

Definition at line 314 of file ultra_circuit_builder.test.cpp.

◆ array_to_array()

template<typename T , typename U , std::size_t N>
std::array< T, N > bb::array_to_array ( const std::array< U, N > &  elements)

Given an std::array<U,N>, returns an std::array<T,N>, by calling the (explicit) constructor T(U).

https://stackoverflow.com/a/32175958 The main use case is to convert an array of Univariate into UnivariateView. The main use case would be to let Sumcheck decide the required degree of the relation evaluation, rather than hardcoding it inside the relation. The _aux version could also be used to create an array of only the polynomials required by the relation, and it could help us implement the optimization where we extend each edge only up to the maximum degree that is required over all relations (for example, L_LAST only needs degree 3).

Template Parameters
TOutput type
UInput type (deduced from elements)
NCommon array size (deduced from elements)
Parameters
elementsarray to be converted
Returns
std::array<T, N> result s.t. result[i] = T(elements[i])

Definition at line 839 of file univariate.hpp.

◆ array_to_array_aux()

template<typename T , typename U , std::size_t N, std::size_t... Is>
std::array< T, sizeof...(Is)> bb::array_to_array_aux ( const std::array< U, N > &  elements,
std::index_sequence< Is... >   
)

Create a sub-array of elements at the indices given in the template pack Is, converting them to the new type T.

Template Parameters
Ttype to convert to
Utype to convert from
Nnumber (deduced by elements)
Islist of indices we want in the returned array. When the second argument is called with std::make_index_sequence<N>, these will be 0, 1, ..., N-1.
Parameters
elementsarray to convert from
Returns
std::array<T, sizeof...(Is)> result array s.t. result[i] = T(elements[Is[i]]). By default, Is[i] = i when called with std::make_index_sequence<N>.

Definition at line 817 of file univariate.hpp.

◆ avm_check_circuit()

void bb::avm_check_circuit ( const std::filesystem::path &  inputs_path)

Definition at line 50 of file api_avm.cpp.

◆ avm_prove()

void bb::avm_prove ( const std::filesystem::path &  inputs_path,
const std::filesystem::path &  output_path 
)

Writes an avm proof and corresponding (incomplete) verification key to files.

Communication:

  • Filesystem: The proof and vk are written to the paths output_path/proof and output_path/vk
Parameters
inputs_pathPath to the file containing the serialised avm public inputs and hints
output_pathPath (directory) to write the output proof and verification keys

Definition at line 27 of file api_avm.cpp.

◆ avm_verify()

bool bb::avm_verify ( const std::filesystem::path &  proof_path,
const std::filesystem::path &  public_inputs_path,
const std::filesystem::path &  vk_path 
)

Verifies an avm proof and writes the result to stdout.

Communication:

  • proc_exit: A boolean value is returned indicating whether the proof is valid. an exit code of 0 will be returned for success and 1 for failure.
Parameters
proof_pathPath to the file containing the serialized proof
vk_pathPath to the file containing the serialized verification key
Returns
true If the proof is valid
false If the proof is invalid

Definition at line 62 of file api_avm.cpp.

◆ bench_commit_mock_z_perm()

template<typename Curve >
void bb::bench_commit_mock_z_perm ( ::benchmark::State &  state)

Definition at line 231 of file commit.bench.cpp.

◆ bench_commit_mock_z_perm_preprocessed()

template<typename Curve >
void bb::bench_commit_mock_z_perm_preprocessed ( ::benchmark::State &  state)

Definition at line 244 of file commit.bench.cpp.

◆ bench_commit_random()

template<typename Curve >
void bb::bench_commit_random ( ::benchmark::State &  state)

Definition at line 178 of file commit.bench.cpp.

◆ bench_commit_random_non_power_of_2()

template<typename Curve >
void bb::bench_commit_random_non_power_of_2 ( ::benchmark::State &  state)

Definition at line 192 of file commit.bench.cpp.

◆ bench_commit_sparse()

template<typename Curve >
void bb::bench_commit_sparse ( ::benchmark::State &  state)

Definition at line 108 of file commit.bench.cpp.

◆ bench_commit_sparse_preprocessed()

template<typename Curve >
void bb::bench_commit_sparse_preprocessed ( ::benchmark::State &  state)

Definition at line 127 of file commit.bench.cpp.

◆ bench_commit_sparse_random()

template<typename Curve >
void bb::bench_commit_sparse_random ( ::benchmark::State &  state)

Definition at line 146 of file commit.bench.cpp.

◆ bench_commit_sparse_random_preprocessed()

template<typename Curve >
void bb::bench_commit_sparse_random_preprocessed ( ::benchmark::State &  state)

Definition at line 162 of file commit.bench.cpp.

◆ bench_commit_structured_random_poly()

template<typename Curve >
void bb::bench_commit_structured_random_poly ( ::benchmark::State &  state)

Definition at line 205 of file commit.bench.cpp.

◆ bench_commit_structured_random_poly_preprocessed()

template<typename Curve >
void bb::bench_commit_structured_random_poly_preprocessed ( ::benchmark::State &  state)

Definition at line 218 of file commit.bench.cpp.

◆ bench_commit_zero()

template<typename Curve >
void bb::bench_commit_zero ( ::benchmark::State &  state)

Definition at line 96 of file commit.bench.cpp.

◆ bench_pippenger_without_endomorphism_basis_points()

template<typename Curve >
void bb::bench_pippenger_without_endomorphism_basis_points ( ::benchmark::State &  state)

Benchmark pippenger_without_endomorphism_basis_points function, which is used notably in the IPA verifier.

Template Parameters
Curve
Parameters
state

Definition at line 266 of file commit.bench.cpp.

◆ bench_round_mega()

void bb::bench_round_mega ( ::benchmark::State &  state,
void(*)(ProtogalaxyProver_< MegaFlavor > &)  F 
)

Definition at line 56 of file protogalaxy_rounds.bench.cpp.

◆ BENCHMARK() [1/7]

bb::BENCHMARK ( bench_commit_mock_z_perm< curve::BN254 ) -> Unit(benchmark::kMillisecond)

◆ BENCHMARK() [2/7]

bb::BENCHMARK ( bench_commit_mock_z_perm_preprocessed< curve::BN254 ) -> Unit(benchmark::kMillisecond)

◆ BENCHMARK() [3/7]

bb::BENCHMARK ( bench_commit_structured_random_poly< curve::BN254 ) -> Unit(benchmark::kMillisecond)

◆ BENCHMARK() [4/7]

bb::BENCHMARK ( bench_commit_structured_random_poly_preprocessed< curve::BN254 ) -> Unit(benchmark::kMillisecond)

◆ BENCHMARK() [5/7]

bb::BENCHMARK ( compute_row_evaluations  ) -> DenseRange(15, 21) ->Unit(kMillisecond)

◆ BENCHMARK() [6/7]

bb::BENCHMARK ( fold_k  ) -> DenseRange(14, 20) ->Unit(kMillisecond)

◆ BENCHMARK() [7/7]

bb::BENCHMARK ( vector_of_evaluations  ) -> DenseRange(15, 21) ->Unit(kMillisecond) ->Iterations(1)

◆ BENCHMARK_CAPTURE() [1/4]

bb::BENCHMARK_CAPTURE ( bench_round_mega  ,
combiner_quotient  ,
[] (auto &prover) { prover.combiner_quotient_round(prover.accumulator->gate_challenges, prover.deltas, prover.keys_to_fold);}   
) -> DenseRange(14, 20) -> Unit(kMillisecond)

◆ BENCHMARK_CAPTURE() [2/4]

bb::BENCHMARK_CAPTURE ( bench_round_mega  ,
fold  ,
[] (auto &prover) { prover.update_target_sum_and_fold(prover.keys_to_fold, prover.combiner_quotient, prover.alphas, prover.relation_parameters, prover.perturbator_evaluation);}   
) -> DenseRange(14, 20) -> Unit(kMillisecond)

◆ BENCHMARK_CAPTURE() [3/4]

bb::BENCHMARK_CAPTURE ( bench_round_mega  ,
oink  ,
[] (auto &prover) { prover.run_oink_prover_on_each_incomplete_key();}   
) -> DenseRange(14, 20) -> Unit(kMillisecond)

◆ BENCHMARK_CAPTURE() [4/4]

bb::BENCHMARK_CAPTURE ( bench_round_mega  ,
perturbator  ,
[] (auto &prover) { prover.perturbator_round(prover.accumulator);}   
) -> DenseRange(14, 20) -> Unit(kMillisecond)

◆ calculate_num_threads()

size_t bb::calculate_num_threads ( size_t  num_iterations,
size_t  min_iterations_per_thread 
)

calculates number of threads to create based on minimum iterations per thread

Finds the number of cpus with get_num_cpus(), and calculates desired_num_threads Returns the min of desired_num_threads and max_num_threads. Note that it will not calculate a power of 2 necessarily, use calculate_num_threads_pow2 instead

Parameters
num_iterations
min_iterations_per_thread
Returns
size_t

Finds the number of cpus with get_num_cpus(), and calculates desired_num_threads Returns the min of desired_num_threads and max_num_theads. Note that it will not calculate a power of 2 necessarily, use calculate_num_threads_pow2 instead

Parameters
num_iterations
min_iterations_per_thread
Returns
size_t

Definition at line 199 of file thread.cpp.

◆ calculate_num_threads_pow2()

size_t bb::calculate_num_threads_pow2 ( size_t  num_iterations,
size_t  min_iterations_per_thread 
)

calculates number of threads to create based on minimum iterations per thread, guaranteed power of 2

Same functionality as calculate_num_threads but guaranteed power of 2

Parameters
num_iterations
min_iterations_per_thread
Returns
size_t

Definition at line 215 of file thread.cpp.

◆ calculate_thread_data()

MultithreadData bb::calculate_thread_data ( size_t  num_iterations,
size_t  min_iterations_per_thread = DEFAULT_MIN_ITERS_PER_THREAD 
)

Calculates number of threads and index bounds for each thread.

Finds the number of cpus with calculate_num_threads() then divides domain evenly amongst threads

Parameters
num_iterations
min_iterations_per_thread
Returns
size_t

Definition at line 173 of file thread.cpp.

◆ check_child_tags()

void bb::check_child_tags ( const uint256_t tag_a,
const uint256_t tag_b 
)

Detect if two elements from the same transcript are performing a suspicious interaction.

For now this detects that 2 elements from 2 different round can't mingle without a challenge in between

Parameters
tag_a
tag_b

Definition at line 23 of file origin_tag.cpp.

◆ check_precomputed_generators()

template<typename Group , detail::DomainSeparator domain_separator, std::size_t num_generators, std::size_t starting_index = 0>
bool bb::check_precomputed_generators ( )
inline

Definition at line 63 of file precomputed_generators.hpp.

◆ compress()

std::vector< uint8_t > bb::compress ( const std::vector< uint8_t > &  input)
protected

Definition at line 8 of file private_execution_steps.cpp.

◆ compute_composed_subrelation_partial_lengths()

template<size_t NUM_KEYS, size_t NUM_SUBRELATIONS>
consteval std::array< size_t, NUM_SUBRELATIONS > bb::compute_composed_subrelation_partial_lengths ( std::array< size_t, NUM_SUBRELATIONS >  SUBRELATION_PARTIAL_LENGTHS)

Get the subrelation accumulators for the Protogalaxy combiner calculation.

A subrelation of degree D, when evaluated on polynomials of degree N, gives a polynomial of degree D

  • N. In the context of Protogalaxy, N = NUM_KEYS-1. Hence, given a subrelation of length x, its evaluation on such polynomials will have degree (x-1) * (NUM_KEYS-1), and the length of this evaluation will be one greater than this.
    Template Parameters
    NUM_KEYS
    NUM_SUBRELATIONS
    Parameters
    SUBRELATION_PARTIAL_LENGTHSThe array of subrelation lengths supplied by a relation.
    Returns
    The transformed subrelation lenths

Definition at line 86 of file relation_types.hpp.

◆ compute_eccvm_challenge_coeffs()

template<typename Curve >
std::vector< typename Curve::ScalarField > bb::compute_eccvm_challenge_coeffs ( const typename Curve::ScalarField evaluation_challenge_x,
const typename Curve::ScalarField batching_challenge_v 
)

Denote \( M = \text{NUM_DISABLED_ROWS_IN_SUMCHECK} \) and \( N = NUM_SMALL_IPA_EVALUTIONS\). Given an evaluation challenge \( x \) and a batching challenge \(v\), compute the polynomial whose coefficients are given by the vector \( (1, x , x^2 , \ldots, x^{M - 1 }, v\cdot x, \ldots, v^{N-1} \cdot x^{M-2}, v^{N-1}, \cdot x^{M-1}, 0, \ldots, 0)\) in the Lagrange basis over the Small Subgroup.

Template Parameters
FF
Parameters
evaluation_challenge_x
batching_challenge_v
subgroup_size
Returns
std::vector<FF>

Definition at line 486 of file small_subgroup_ipa.hpp.

◆ compute_evaluation_points()

template<typename FF >
std::array< FF, NUM_SMALL_IPA_EVALUATIONS > bb::compute_evaluation_points ( const FF small_ipa_evaluation_challenge,
const FF subgroup_generator 
)
inline

The verification of Grand Sum Identity requires the evaluations G(r), A(g * r), A(r), Q(r). Shared by Prover and Verifier.

Definition at line 33 of file small_subgroup_ipa_utils.hpp.

◆ compute_grand_product()

template<typename Flavor , typename GrandProdRelation >
void bb::compute_grand_product ( typename Flavor::ProverPolynomials full_polynomials,
bb::RelationParameters< typename Flavor::FF > &  relation_parameters,
size_t  size_override = 0,
const ActiveRegionData active_region_data = ActiveRegionData{} 
)

Compute a permutation grand product polynomial Z_perm(X)

Z_perm may be defined in terms of its values on X_i = 0,1,...,n-1 as Z_perm[0] = 1 and for i = 1:n-1 relation::numerator(j) Z_perm[i] = ∏ -----------------------------------------------------------------------------— relation::denominator(j)

where ∏ := ∏_{j=0:i-1}

The specific algebraic relation used by Z_perm is defined by Flavor::GrandProductRelations

For example, in Flavor::Standard the relation describes:

             (w_1(j) + β⋅id_1(j) + γ) ⋅ (w_2(j) + β⋅id_2(j) + γ) ⋅ (w_3(j) + β⋅id_3(j) + γ)

Z_perm[i] = ∏ -----------------------------------------------------------------------------— (w_1(j) + β⋅σ_1(j) + γ) ⋅ (w_2(j) + β⋅σ_2(j) + γ) ⋅ (w_3(j) + β⋅σ_3(j) + γ) where ∏ := ∏_{j=0:i-1} and id_i(X) = id(X) + n*(i-1)

For Flavor::Ultra both the UltraPermutation and Lookup grand products are computed by this method.

The grand product is constructed over the course of three steps.

For expositional simplicity, write Z_perm[i] as

           A(j)

Z_perm[i] = ∏ -----------------------— B(h)

Step 1) Compute 2 length-n polynomials A, B Step 2) Compute 2 length-n polynomials numerator = ∏ A(j), nenominator = ∏ B(j) Step 3) Compute Z_perm[i + 1] = numerator[i] / denominator[i] (recall: Z_perm[0] = 1)

Note: Step (3) utilizes Montgomery batch inversion to replace n-many inversions with

Note
This method makes use of the fact that there are at most as many unique entries in the grand product as active rows in the execution trace to efficiently compute the grand product when a structured trace is in use. I.e. the computation peformed herein is proportional to the number of active rows in the trace and the constant values in the inactive regions are simply populated from known values on the last step.
Template Parameters
Flavor
GrandProdRelation
Parameters
full_polynomials
relation_parameters
size_overrideoptional size of the domain; otherwise based on dyadic polynomial domain
active_region_dataoptional specification of active region of execution trace

Definition at line 72 of file grand_product_library.hpp.

◆ compute_grand_products()

template<typename Flavor >
void bb::compute_grand_products ( typename Flavor::ProverPolynomials full_polynomials,
bb::RelationParameters< typename Flavor::FF > &  relation_parameters,
const size_t  size_override = 0 
)

Compute the grand product corresponding to each grand-product relation defined in the Flavor.

Definition at line 231 of file grand_product_library.hpp.

◆ compute_logderivative_inverse()

template<typename FF , typename Relation , typename Polynomials , bool UseMultithreading = false>
void bb::compute_logderivative_inverse ( Polynomials &  polynomials,
auto &  relation_parameters,
const size_t  circuit_size 
)

Compute the inverse polynomial I(X) required for logderivative lookups

  • details Inverse may be defined in terms of its values on X_i = 0,1,...,n-1 as Z_perm[0] = 1 and for i = 1:n-1 1 1 Inverse[i] = ∏ -----------------------— * ∏' -----------------------— relation::read_term(j) relation::write_term(j)

where ∏ := ∏_{j=0:relation::NUM_READ_TERMS-1} and ∏' := ∏'_{j=0:relation::NUM_WRITE_TERMS-1}

If row [i] does not contain a lookup read gate or a write gate, Inverse[i] = 0 N.B. by "write gate" we mean; do the lookup table polynomials contain nonzero values at this row? (in the ECCVM, the lookup table is not precomputed, so we have a concept of a "write gate", unlike when precomputed lookup tables are used)

The specific algebraic relations that define read terms and write terms are defined in Flavor::LookupRelation

Note: tparam UseMultithreading exists because the AVM calls this fn in a multithreaded loop (no nested multithreading allowed) but the ECCVM benefits from multithreading this fn

Definition at line 40 of file logderivative_library.hpp.

◆ compute_max_partial_relation_length()

template<typename Tuple >
constexpr size_t bb::compute_max_partial_relation_length ( )
constexpr

Utility function to find max PARTIAL_RELATION_LENGTH tuples of Relations.

The "partial length" of a relation is 1 + the degree of the relation, where any challenges used in the relation are as constants, not as variables..

Definition at line 359 of file flavor.hpp.

◆ compute_max_total_relation_length()

template<typename Tuple >
constexpr size_t bb::compute_max_total_relation_length ( )
constexpr

Utility function to find max TOTAL_RELATION_LENGTH among tuples of Relations.

The "total length" of a relation is 1 + the degree of the relation, where any challenges used in the relation are regarded as variables.

Definition at line 372 of file flavor.hpp.

◆ compute_number_of_subrelations()

template<typename Tuple >
constexpr size_t bb::compute_number_of_subrelations ( )
constexpr

Utility function to find the number of subrelations.

Definition at line 383 of file flavor.hpp.

◆ compute_permutation_argument_polynomials()

template<typename Flavor >
void bb::compute_permutation_argument_polynomials ( const typename Flavor::CircuitBuilder circuit,
typename Flavor::ProverPolynomials polynomials,
const std::vector< CyclicPermutation > &  copy_cycles,
ActiveRegionData active_region_data 
)

Compute Honk style generalized permutation sigmas and ids and add to proving_key.

Parameters
circuit
proving_key
copy_cyclespre-computed sets of wire addresses whose values should be copy constrained

Definition at line 287 of file permutation_lib.hpp.

◆ compute_public_input_delta()

template<typename Flavor >
Flavor::FF bb::compute_public_input_delta ( std::span< const typename Flavor::FF public_inputs,
const typename Flavor::FF beta,
const typename Flavor::FF gamma,
const typename Flavor::FF offset = 0 
)

Compute the correction term for the permutation argument.

Template Parameters
Field
Parameters
public_inputsx₀, ..., xₘ₋₁ public inputs to the circuit
betarandom linear-combination term to combine both (wʲ, IDʲ) and (wʲ, σʲ)
gammaSchwartz-Zippel random evaluation to ensure ∏ᵢ (γ + Sᵢ) = ∏ᵢ (γ + Tᵢ)
domain_sizeTotal number of rows required for the circuit (power of 2)
offsetExtent to which PI are offset from the 0th index in the wire polynomials, for example, due to inclusion of a leading zero row or Goblin style ECC op gates at the top of the execution trace.
Returns
Field Public input Δ

Definition at line 26 of file grand_product_delta.hpp.

◆ compute_row_evaluations()

void bb::compute_row_evaluations ( State &  state)
noexcept

Definition at line 28 of file protogalaxy.bench.cpp.

◆ compute_total_subrelation_lengths()

template<typename RelationImpl >
consteval std::array< size_t, RelationImpl::SUBRELATION_PARTIAL_LENGTHS.size()> bb::compute_total_subrelation_lengths ( )

Compute the total subrelation lengths, i.e., the lengths when regarding the challenges as variables.

Definition at line 60 of file relation_types.hpp.

◆ compute_vanishing_polynomial_and_lagrange_evaluations()

template<typename FF , size_t NUM>
std::tuple< FF, std::vector< FF > > bb::compute_vanishing_polynomial_and_lagrange_evaluations ( const FF combiner_challenge)

Definition at line 38 of file protogalaxy_verifier.cpp.

◆ concatenate() [1/4]

template<typename T , std::size_t... Ns>
RefArray< T,(Ns+...)> constexpr bb::concatenate ( const RefArray< T, Ns > &...  ref_arrays)
constexpr

Concatenates multiple RefArray objects into a single RefArray.

This function takes multiple RefArray objects as input and concatenates them into a single RefArray.

Template Parameters
TThe type of elements in the RefArray.
NsThe sizes of the input RefArrays.
Parameters
ref_arraysThe RefArray objects to be concatenated.
Returns
RefArray object containing all elements from the input arrays.

Definition at line 158 of file ref_array.hpp.

◆ concatenate() [2/4]

template<typename T >
RefVector< T > bb::concatenate ( const RefVector< T > &  ref_vector,
const auto &...  ref_vectors 
)

Concatenates multiple RefVector objects into a single RefVector.

This function takes multiple RefVector objects as input and concatenates them into a single RefVector.

Template Parameters
TThe type of elements in the RefVector.
Parameters
ref_vectorsThe RefVector objects to be concatenated.
Returns
RefVector object containing all elements from the input vectors.

Definition at line 136 of file ref_vector.hpp.

◆ concatenate() [3/4]

template<typename T , std::size_t... Ns>
std::array< T,(Ns+...)> bb::concatenate ( const std::array< T, Ns > &...  arrays)

Concatenates multiple std::array objects into a single array.

This function template takes a variadic number of std::array objects and concatenates their elements into a single std::array. The size of the resulting array is the sum of the sizes of the input arrays.

Template Parameters
TThe type of elements stored in the arrays.
NsThe sizes of the input arrays. This is a variadic template parameter pack representing the sizes of each input array.
Parameters
arraysVariadic number of std::array objects to concatenate. Each array can have a different size but must contain the same type of elements.
Returns
std::array<T, (Ns + ...)> A new std::array containing all elements from the input arrays concatenated in the order they were passed.

Example usage: std::array<int, 2> a = {1, 2}; std::array<int, 3> b = {3, 4, 5}; auto result = concatenate(a, b); // result is std::array<int, 5>{1, 2, 3, 4, 5}

Definition at line 26 of file std_array.hpp.

◆ concatenate() [4/4]

template<typename T >
std::vector< T > bb::concatenate ( const std::vector< T > &  vector,
const auto &...  vectors 
)

Concatenates multiple std::vector objects into a single std::vector.

Template Parameters
TThe type of elements in the std::vector.
Parameters
vectorsThe std::vector objects to be concatenated.
Returns
std::vector object containing all elements from the input vectors.

Definition at line 12 of file std_vector.hpp.

◆ constexpr_for()

template<size_t Start, size_t End, size_t Inc, class F >
constexpr void bb::constexpr_for ( F &&  f)
constexpr

Implements a loop using a compile-time iterator. Requires c++20. Implementation (and description) from https://artificial-mind.net/blog/2020/10/31/constexpr-for.

Template Parameters
Startthe loop start value
Endthe loop end value
Inchow much the iterator increases by per iteration
Fa Lambda function that is executed once per loop
Parameters
fAn rvalue reference to the lambda

Implements a for loop where the iterator is a constexpr variable. Use this when you need to evaluate if constexpr statements on the iterator (or apply other constexpr expressions) Outside of this use-case avoid using this fn as it gives negligible performance increases vs regular loops.

N.B. A side-effect of this method is that all loops will be unrolled (each loop iteration uses different iterator template parameters => unique constexpr_for implementation per iteration) Do not use this for large (~100+) loops!

EXAMPLE USE OF constexpr_for

constexpr_for<0, 10, 1>([&]<size_t i>(){ if constexpr (i & 1 == 0) { foo[i] = even_container[i >> 1]; } else { foo[i] = odd_container[i >> 1]; } });

In the above example we are iterating from i = 0 to i < 10. The provided lambda function has captured everything in its surrounding scope (via [&]), which is where foo, even_container and odd_container have come from.

We do not need to explicitly define the class F parameter as the compiler derives it from our provided input argument F&& f (i.e. the lambda function)

In the loop itself we're evaluating a constexpr if statement that defines which code path is taken.

The above example benefits from constexpr_for because a run-time if statement has been reduced to a compile-time if statement. N.B. this would only give measurable improvements if the constexpr_for statement is itself in a hot loop that's iterated over many (>thousands) times

Definition at line 71 of file constexpr_utils.hpp.

◆ construct_lookup_read_counts()

template<typename Flavor >
void bb::construct_lookup_read_counts ( typename Flavor::Polynomial read_counts,
typename Flavor::Polynomial read_tags,
typename Flavor::CircuitBuilder circuit,
const size_t  dyadic_circuit_size 
)

Construct polynomial whose value at index i is the number of times the table entry at that index has been read.

Read counts are needed for the log derivative lookup argument. The table polynomials are constructed as a concatenation of basic 3-column tables. Similarly, the read counts polynomial is constructed as the concatenation of read counts for the individual tables.

Definition at line 56 of file composer_lib.hpp.

◆ construct_lookup_table_polynomials()

template<typename Flavor >
void bb::construct_lookup_table_polynomials ( const RefArray< typename Flavor::Polynomial, 4 > &  table_polynomials,
const typename Flavor::CircuitBuilder circuit,
const size_t  dyadic_circuit_size,
const size_t  additional_offset = 0 
)

Definition at line 18 of file composer_lib.hpp.

◆ create_commitment_key() [1/2]

template<typename Curve >
CommitmentKey< Curve > bb::create_commitment_key ( const size_t  num_points)

Definition at line 16 of file commit.bench.cpp.

◆ create_commitment_key() [2/2]

template<class CK >
CK bb::create_commitment_key ( const size_t  num_points = 0)
inline

Definition at line 100 of file commitment_key.test.hpp.

◆ create_commitment_key< CommitmentKey< curve::BN254 > >()

template<>
CommitmentKey< curve::BN254 > bb::create_commitment_key< CommitmentKey< curve::BN254 > > ( const size_t  num_points)
inline

Definition at line 78 of file commitment_key.test.hpp.

◆ create_commitment_key< CommitmentKey< curve::Grumpkin > >()

template<>
CommitmentKey< curve::Grumpkin > bb::create_commitment_key< CommitmentKey< curve::Grumpkin > > ( const size_t  num_points)
inline

Definition at line 78 of file commitment_key.test.hpp.

◆ create_protogalaxy_tuple_of_tuples_of_univariates()

template<typename Tuple , size_t NUM_KEYS, bool optimized = false>
constexpr auto bb::create_protogalaxy_tuple_of_tuples_of_univariates ( )
constexpr

Utility function to construct a container for the subrelation accumulators of Protogalaxy folding.

The size of the outer tuple is equal to the number of relations. Each relation contributes an inner tuple of univariates whose size is equal to the number of subrelations of the relation. The length of a univariate in an inner tuple is determined by the corresponding subrelation length and the number of keys to be folded.

Template Parameters
optimizedEnable optimized version with skipping some of the computation

Definition at line 400 of file flavor.hpp.

◆ create_sumcheck_tuple_of_tuples_of_univariates()

template<typename RelationsTuple >
constexpr auto bb::create_sumcheck_tuple_of_tuples_of_univariates ( )
constexpr

Utility function to construct a container for the subrelation accumulators of sumcheck proving.

The size of the outer tuple is equal to the number of relations. Each relation contributes an inner tuple of univariates whose size is equal to the number of subrelations of the relation. The length of a univariate in an inner tuple is determined by the corresponding subrelation length.

Definition at line 422 of file flavor.hpp.

◆ create_tuple_of_arrays_of_values()

template<typename RelationsTuple >
constexpr auto bb::create_tuple_of_arrays_of_values ( )
constexpr

Construct tuple of arrays.

Container for storing value of each identity in each relation. Each Relation contributes an array of length num-identities.

Definition at line 436 of file flavor.hpp.

◆ create_verifier_commitment_key()

template<class VK >
VK bb::create_verifier_commitment_key ( )
inline

Definition at line 120 of file commitment_key.test.hpp.

◆ create_verifier_commitment_key< VerifierCommitmentKey< curve::BN254 > >()

◆ create_verifier_commitment_key< VerifierCommitmentKey< curve::Grumpkin > >()

◆ decompress()

std::vector< uint8_t > bb::decompress ( const void *  bytes,
size_t  size 
)

Definition at line 29 of file private_execution_steps.cpp.

◆ DEFINE_SUMCHECK_PERMUTATION_CLASS()

bb::DEFINE_SUMCHECK_PERMUTATION_CLASS ( ECCVMSetRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [1/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMBoolsRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [2/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMLookupRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [3/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMMSMRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [4/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMPointTableRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [5/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMSetRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [6/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMTranscriptRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [7/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( ECCVMWnafRelationImpl  ,
ECCVMFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [8/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorAccumulatorTransferRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [9/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorDeltaRangeConstraintRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [10/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorNonNativeFieldRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [11/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorOpcodeConstraintRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [12/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorPermutationRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_RELATION_CLASS() [13/13]

bb::DEFINE_SUMCHECK_RELATION_CLASS ( TranslatorZeroConstraintsRelationImpl  ,
TranslatorFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_PERMUTATION_CLASS()

bb::DEFINE_SUMCHECK_VERIFIER_PERMUTATION_CLASS ( ECCVMSetRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [1/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMBoolsRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [2/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMLookupRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [3/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMMSMRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [4/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMPointTableRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [5/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMSetRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [6/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMTranscriptRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [7/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( ECCVMWnafRelationImpl  ,
ECCVMRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [8/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorAccumulatorTransferRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [9/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorDecompositionRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [10/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorDeltaRangeConstraintRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [11/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorNonNativeFieldRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [12/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorOpcodeConstraintRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [13/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorPermutationRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS() [14/14]

bb::DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS ( TranslatorZeroConstraintsRelationImpl  ,
TranslatorRecursiveFlavor   
)

◆ DenseRange() [1/2]

bb::DenseRange ( MIN_LOG_NUM_GRUMPKIN_POINTS  ,
MAX_LOG_NUM_GRUMPKIN_POINTS   
) -> Unit(benchmark::kMillisecond)

◆ DenseRange() [2/2]

bb::DenseRange ( MIN_LOG_NUM_POINTS  ,
MAX_LOG_NUM_POINTS   
) -> Unit(benchmark::kMillisecond)

◆ exec_pipe()

std::vector< uint8_t > bb::exec_pipe ( const std::string &  command)
inline

Definition at line 10 of file exec_pipe.hpp.

◆ execute_msgpack_run()

int bb::execute_msgpack_run ( const std::string &  msgpack_input_file)
inline

Execute msgpack run command.

This function handles the msgpack run subcommand, reading commands from either stdin or a specified file and processing them through the msgpack API.

Parameters
msgpack_input_filePath to input file (empty string means use stdin)
Returns
int Status code: 0 for success, non-zero for errors

Definition at line 105 of file api_msgpack.hpp.

◆ field_elements_to_json()

template<typename Fr >
std::string bb::field_elements_to_json ( const std::vector< Fr > &  fields)
inline

Definition at line 90 of file file_io.hpp.

◆ find_deepest_subcommand()

CLI::App * bb::find_deepest_subcommand ( CLI::App *  app)

Definition at line 58 of file cli.cpp.

◆ flatten()

template<template< typename, typename... > typename Cont, typename InnerCont , typename... Args>
InnerCont bb::flatten ( Cont< InnerCont, Args... > const &  in)

Definition at line 47 of file container.hpp.

◆ flavor_get_label()

template<typename Container , typename Element >
std::string bb::flavor_get_label ( Container &&  container,
const Element element 
)
inline

Definition at line 66 of file flavor_concepts.hpp.

◆ fold_k()

void bb::fold_k ( State &  state)
noexcept

Definition at line 48 of file protogalaxy.bench.cpp.

◆ free_mem_slab_raw()

void bb::free_mem_slab_raw ( void *  p)
private

Definition at line 228 of file slab_allocator.cpp.

◆ gate_count_for_ivc()

void bb::gate_count_for_ivc ( const std::string &  bytecode_path,
bool  include_gates_per_opcode 
)

Definition at line 227 of file api_client_ivc.cpp.

◆ generate_sha256_test_circuit()

template<typename Builder >
void bb::generate_sha256_test_circuit ( Builder builder,
size_t  num_iterations 
)

Definition at line 27 of file mock_circuits.hpp.

◆ generic_evaluate_mle()

template<typename Fr_ >
Fr_ bb::generic_evaluate_mle ( std::span< const Fr_ >  evaluation_points,
const SharedShiftedVirtualZeroesArray< Fr_ > &  coefficients 
)

Static exposed implementation to support both native and stdlib circuit field types.

Definition at line 532 of file polynomial.hpp.

◆ get_bn254_g1_data()

std::vector< g1::affine_element > bb::get_bn254_g1_data ( const std::filesystem::path &  path,
size_t  num_points,
bool  allow_download 
)

Definition at line 35 of file get_bn254_crs.cpp.

◆ get_bn254_g2_data()

g2::affine_element bb::get_bn254_g2_data ( const std::filesystem::path &  path,
bool  allow_download 
)

Definition at line 76 of file get_bn254_crs.cpp.

◆ get_constraint_system()

acir_format::AcirFormat bb::get_constraint_system ( std::string const &  bytecode_path)

Definition at line 14 of file acir_format_getters.cpp.

◆ get_constraint_systems()

std::vector< acir_format::AcirFormat > bb::get_constraint_systems ( std::string const &  bytecode_path)

Definition at line 26 of file acir_format_getters.cpp.

◆ get_evaluation_labels()

std::array< std::string, NUM_SMALL_IPA_EVALUATIONS > bb::get_evaluation_labels ( const std::string &  label_prefix)
inline

Shared by Prover and Verifier. label_prefix is either Libra: or Translation:.

Definition at line 20 of file small_subgroup_ipa_utils.hpp.

◆ get_file_size()

size_t bb::get_file_size ( std::string const &  filename)
inline

Definition at line 17 of file file_io.hpp.

◆ get_grumpkin_g1_data()

std::vector< curve::Grumpkin::AffineElement > bb::get_grumpkin_g1_data ( const std::filesystem::path &  path,
size_t  num_points,
bool  allow_download 
)

Definition at line 27 of file get_grumpkin_crs.cpp.

◆ get_mem_slab()

std::shared_ptr< void > bb::get_mem_slab ( size_t  size)
private

Returns a slab from the preallocated pool of slabs, or fallback to a new heap allocation (32 byte aligned). Ref counted result so no need to manually free.

Definition at line 213 of file slab_allocator.cpp.

◆ get_mem_slab_raw()

void * bb::get_mem_slab_raw ( size_t  size)
private

Sometimes you want a raw pointer to a slab so you can manage when it's released manually (e.g. c_binds, containers). This still gets a slab with a shared_ptr, but holds the shared_ptr internally until free_mem_slab_raw is called.

Definition at line 218 of file slab_allocator.cpp.

◆ get_num_cpus()

size_t bb::get_num_cpus ( )
inline

Definition at line 12 of file thread.hpp.

◆ get_num_cpus_pow2()

size_t bb::get_num_cpus_pow2 ( )
inline

Definition at line 18 of file thread.hpp.

◆ get_precomputed_generators()

template<typename Group , detail::DomainSeparator domain_separator, std::size_t num_generators, std::size_t starting_index = 0>
constexpr std::span< const typename Group::affine_element > bb::get_precomputed_generators ( )
constexpr

Definition at line 51 of file precomputed_generators.hpp.

◆ get_sequential_prover_polynomials()

template<typename Flavor >
Flavor::ProverPolynomials bb::get_sequential_prover_polynomials ( const size_t  log_circuit_size,
const size_t  starting_value 
)

Get a ProverPolynomials instance initialized to sequential values starting at 0.

Values are assigned according to the order specified in the underlying array of the flavor class. The function returns an array of data pointed to by the ProverPolynomials.

Definition at line 17 of file testing.hpp.

◆ get_unshifted_then_shifted()

auto bb::get_unshifted_then_shifted ( const auto &  all_entities)

Definition at line 349 of file flavor.hpp.

◆ get_witness()

acir_format::WitnessVector bb::get_witness ( std::string const &  witness_path)

Definition at line 8 of file acir_format_getters.cpp.

◆ get_witness_stack()

acir_format::WitnessVectorStack bb::get_witness_stack ( std::string const &  witness_path)

Definition at line 20 of file acir_format_getters.cpp.

◆ get_zero_prover_polynomials()

template<typename Flavor >
Flavor::ProverPolynomials bb::get_zero_prover_polynomials ( const size_t  log_circuit_size)

Definition at line 35 of file testing.hpp.

◆ index_of()

template<typename T >
int64_t bb::index_of ( std::vector< T > const &  vec,
T const &  item 
)

Definition at line 58 of file container.hpp.

◆ init_slab_allocator()

void bb::init_slab_allocator ( size_t  circuit_subgroup_size)
private

Allocates a bunch of memory slabs sized to serve an UltraPLONK proof construction. If you want normal memory allocator behavior, just don't call this init function.

WARNING: If client code is still holding onto slabs from previous use, when those slabs are released they'll end up back in the allocator. That's probably not desired as presumably those slabs are now too small, so they're effectively leaked. But good client code should be releasing it's resources promptly anyway. It's not considered "proper use" to call init, take slab, and call init again, before releasing the slab.

TODO: Take a composer type and allocate slabs according to those requirements? TODO: De-globalise. Init the allocator and pass around. Use a PolynomialFactory (PolynomialStore?). TODO: Consider removing, but once due-dilligence has been done that we no longer have memory limitations.

Definition at line 208 of file slab_allocator.cpp.

◆ initialize_relation_separator()

template<typename FF , size_t N>
std::array< FF, N > bb::initialize_relation_separator ( const FF alpha)

Definition at line 925 of file sumcheck.hpp.

◆ join() [1/2]

template<typename C >
C bb::join ( std::initializer_list< C to_join)

Definition at line 26 of file container.hpp.

◆ join() [2/2]

std::string bb::join ( std::vector< std::string > const &  to_join,
std::string const &  with = "," 
)
inline

Definition at line 35 of file container.hpp.

◆ keccak_hash_uint256()

bb::fr bb::keccak_hash_uint256 ( std::vector< uint256_t > const &  data)
inline

Definition at line 762 of file transcript.hpp.

◆ msgpack_to_json()

std::string bb::msgpack_to_json ( msgpack::object const &  o,
size_t  max_chars 
)

Definition at line 6 of file msgpack_to_json.cpp.

◆ NamedUnion()

template<typename... Types>
bb::NamedUnion ( std::variant< Types... >  ) -> NamedUnion< Types... >

◆ operator*() [1/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator* ( const Fr ff,
const Univariate< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 634 of file univariate.hpp.

◆ operator*() [2/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator* ( const Fr ff,
const UnivariateView< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 797 of file univariate.hpp.

◆ operator+() [1/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator+ ( const Fr ff,
const Univariate< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 620 of file univariate.hpp.

◆ operator+() [2/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator+ ( const Fr ff,
const UnivariateView< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 783 of file univariate.hpp.

◆ operator-() [1/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator- ( const Fr ff,
const Univariate< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 627 of file univariate.hpp.

◆ operator-() [2/2]

template<class Fr , size_t domain_end, size_t domain_start = 0, size_t skip_count = 0>
Univariate< Fr, domain_end, domain_start, skip_count > bb::operator- ( const Fr ff,
const UnivariateView< Fr, domain_end, domain_start, skip_count > &  uv 
)

Definition at line 790 of file univariate.hpp.

◆ operator<<() [1/2]

template<typename Fr >
std::ostream & bb::operator<< ( std::ostream &  os,
const Polynomial< Fr > &  p 
)
inline

Definition at line 538 of file polynomial.hpp.

◆ operator<<() [2/2]

std::ostream & bb::operator<< ( std::ostream &  os,
OriginTag const &  v 
)
inline

Definition at line 172 of file origin_tag.hpp.

◆ parallel_for()

void bb::parallel_for ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)

Creates a thread pool and runs the function in parallel.

Parameters
num_iterationsNumber of iterations
funcFunction to run in parallel Observe that num_iterations is NOT the thread pool size. The size will be chosen based on the hardware concurrency (i.e., env or cpus).

Definition at line 72 of file thread.cpp.

◆ parallel_for_atomic_pool()

void bb::parallel_for_atomic_pool ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)
private

A thread pooled strategy that uses atomics to prevent needing constantly lock on a queue. The main thread acts as a worker also, and when it completes, it spins until thread workers are done.

Definition at line 109 of file parallel_for_atomic_pool.cpp.

◆ parallel_for_heuristic() [1/3]

template<typename Func , typename Accum >
requires std::invocable<Func, std::size_t, Accum&>
std::vector< Accum > bb::parallel_for_heuristic ( size_t  num_points,
const Accum &  initial_accum,
const Func &  func,
size_t  heuristic_cost 
)

parallel_for_heuristic variant that takes an accumulator initializer that is allocated in a vector, one accumulator per thread/chunk. This allows for thread-safe accumulation, see sum() or sum_pairs() in container.hpp for an easy way to combine the thread/chunk contributions into a final result.

Definition at line 71 of file thread.hpp.

◆ parallel_for_heuristic() [2/3]

template<typename Func >
requires std::invocable<Func, std::size_t>
void bb::parallel_for_heuristic ( size_t  num_points,
const Func &  func,
size_t  heuristic_cost 
)

Definition at line 51 of file thread.hpp.

◆ parallel_for_heuristic() [3/3]

void bb::parallel_for_heuristic ( size_t  num_points,
const std::function< void(size_t, size_t, size_t)> &  func,
size_t  heuristic_cost 
)

Split a loop into several loops running in parallel based on operations in 1 iteration.

Splits the num_points into appropriate number of chunks to do parallel processing on and calls the function that should contain the work loop, but only if it's worth it

Parameters
num_pointsTotal number of elements
funcA function or lambda expression with a for loop inside, for example: [&](size_t start, size_t end, size_t thread_index){for (size_t i=start; i<end; i++){ ... work ... }
heuristic_costthe estimated cost of the operation, see namespace thread_heuristics below

Definition at line 132 of file thread.cpp.

◆ parallel_for_moody()

void bb::parallel_for_moody ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)

◆ parallel_for_mutex_pool()

void bb::parallel_for_mutex_pool ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)
private

A thread pooled strategy that uses std::mutex for protection. Each worker increments the "iteration" and processes. The main thread acts as a worker also, and when it completes, it spins until thread workers are done.

Definition at line 125 of file parallel_for_mutex_pool.cpp.

◆ parallel_for_omp()

void bb::parallel_for_omp ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)

◆ parallel_for_queued()

void bb::parallel_for_queued ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)

A thread pooled strategey that assumed that thread pools would be more efficient than spawning threads. Every iteration becomes a task in a queue. That's probably not very efficient. A normal mutex and condition variables are used to distribute tasks and notify.

Definition at line 19 of file parallel_for_queued.cpp.

◆ parallel_for_range()

void bb::parallel_for_range ( size_t  num_points,
const std::function< void(size_t, size_t)> &  func,
size_t  no_multhreading_if_less_or_equal 
)

Split a loop into several loops running in parallel.

Splits the num_points into appropriate number of chunks to do parallel processing on and calls the function that should contain the work loop

Parameters
num_pointsTotal number of elements
funcA function or lambda expression with a for loop inside, for example: [](size_t start, size_t end){for (size_t i=start; i<end; i++){(void)i;}}
no_multhreading_if_less_or_equalIf num points is less or equal to this value, run without parallelization

Definition at line 102 of file thread.cpp.

◆ parallel_for_spawning()

void bb::parallel_for_spawning ( size_t  num_iterations,
const std::function< void(size_t)> &  func 
)

A very simple strategy. Spawn a worker thread for every iteration (but no more than num cores). Worker threads tight-loop incrementing an atomic variable from 0-num_iterations, until num_iterations reached. Main thread waits on all worker threads by joining.

Definition at line 11 of file parallel_for_spawning.cpp.

◆ parse_and_run_cli_command()

int bb::parse_and_run_cli_command ( int  argc,
char *  argv[] 
)

Parse command line arguments and run the corresponding command.

This function encapsulates the entire CLI parsing and command execution logic that is used in the main function. It's designed as a standalone function to support multiple entry points:

  1. Used by main.cpp as the primary command-line interface for the bb executable
  2. Used by main.bench.cpp for benchmark testing with the same command structure

The function utilizes CLI11 for argument parsing and creates a hierarchy of commands and subcommands with appropriate options. This encapsulation allows the CLI functionality to be tested and benchmarked without duplicating the command structure across multiple files.

Parameters
argcNumber of command-line arguments
argvArray of command-line argument strings
Returns
int Status code: 0 for success, non-zero for errors or verification failure

Definition at line 104 of file cli.cpp.

◆ precompute_vks()

std::vector< std::shared_ptr< typename MegaFlavor::VerificationKey > > bb::precompute_vks ( const size_t  num_app_circuits,
const bool  large_first_app = true 
)

Definition at line 60 of file test_bench_shared.hpp.

◆ print_active_subcommands()

void bb::print_active_subcommands ( const CLI::App &  app,
const std::string &  prefix = "bb command: " 
)

Definition at line 44 of file cli.cpp.

◆ print_subcommand_options()

void bb::print_subcommand_options ( const CLI::App *  sub)

Definition at line 73 of file cli.cpp.

◆ process_msgpack_commands()

int bb::process_msgpack_commands ( std::istream &  input_stream)
inline

Process msgpack API commands from an input stream.

This function reads length-encoded msgpack buffers from the provided input stream, deserializes them into Command objects, executes them via the bbapi interface, and writes length-encoded responses back to stdout.

The format for each message is:

  • 4-byte length prefix (little-endian)
  • msgpack buffer of the specified length
Parameters
input_streamThe input stream to read msgpack commands from (stdin or file)
Returns
int Status code: 0 for success, non-zero for errors

Definition at line 28 of file api_msgpack.hpp.

◆ prove_tube()

void bb::prove_tube ( const std::string &  output_path,
const std::string &  vk_path 
)

Creates a Honk Proof for the Tube circuit responsible for recursively verifying a ClientIVC proof.

Parameters
output_paththe working directory from which the proof and verification data are read
num_unused_public_inputs
output_paththe working directory from which the proof is read and output is written
vk_paththe path to the verification key data to use when proving (this is the one of two ClientIVC VKs, public or private tail)

Definition at line 15 of file prove_tube.cpp.

◆ read() [1/5]

template<typename B , typename FF >
void bb::read ( B &  buf,
poly_triple_< FF > &  constraint 
)
inline

Definition at line 81 of file gate_data.hpp.

◆ read() [2/5]

template<typename B , typename base_field , typename Params >
void bb::read ( B &  it,
field2< base_field, Params > &  value 
)

Definition at line 149 of file field2_declarations.hpp.

◆ read() [3/5]

template<typename B , typename Params >
void bb::read ( B &  it,
field< Params > &  value 
)

Definition at line 721 of file field_declarations.hpp.

◆ read() [4/5]

template<typename B , class Fr , size_t domain_end, size_t domain_start = 0>
void bb::read ( B &  it,
Univariate< Fr, domain_end, domain_start > &  univariate 
)
inline

Definition at line 606 of file univariate.hpp.

◆ read() [5/5]

template<typename B , class Fr , size_t domain_end, bool has_a0_plus_a1>
void bb::read ( B &  it,
UnivariateCoefficientBasis< Fr, domain_end, has_a0_plus_a1 > &  univariate 
)
inline

Definition at line 339 of file univariate_coefficient_basis.hpp.

◆ read_file()

std::vector< uint8_t > bb::read_file ( const std::string &  filename,
size_t  bytes = 0 
)
inline

Definition at line 29 of file file_io.hpp.

◆ RefArray()

template<typename T , typename... Ts>
bb::RefArray ( T &  ,
Ts &  ... 
) -> RefArray< T, 1+sizeof...(Ts)>

Deduction guide for the RefArray class. Allows for RefArray {a, b, c} without explicit template params.

◆ RefVector()

template<typename T , typename... Ts>
bb::RefVector ( T &  ,
Ts &  ... 
) -> RefVector< T >

Deduction guide for the RefVector class. Allows for RefVector {a, b, c} without explicit template params.

◆ slice() [1/2]

template<typename C >
C bb::slice ( C const &  container,
size_t  start 
)

Definition at line 9 of file container.hpp.

◆ slice() [2/2]

template<typename C >
C bb::slice ( C const &  container,
size_t  start,
size_t  end 
)

Definition at line 17 of file container.hpp.

◆ sparse_random_poly()

template<typename FF >
Polynomial< FF > bb::sparse_random_poly ( const size_t  size,
const size_t  num_nonzero 
)

Definition at line 24 of file commit.bench.cpp.

◆ structured_random_poly()

template<typename FF >
PolyData< FF > bb::structured_random_poly ( bool  non_zero_complement = false)

Definition at line 44 of file commit.bench.cpp.

◆ subrelation_is_linearly_independent()

template<typename Relation , size_t subrelation_index>
constexpr bool bb::subrelation_is_linearly_independent ( )
constexpr

Check whether a given subrelation is linearly independent from the other subrelations.

More often than not, we want multiply each subrelation contribution by a power of the relation separator challenge. In cases where we wish to define a subrelation that merges into another, we encode this in a boolean array SUBRELATION_LINEARLY_INDEPENDENT in the relation. If no such array is defined, then the default case where all subrelations are independent is engaged.

Definition at line 46 of file relation_types.hpp.

◆ sum()

template<template< typename, typename... > typename Cont, typename Inner , typename... Args>
Inner bb::sum ( Cont< Inner, Args... > const &  in)

Definition at line 70 of file container.hpp.

◆ sum_pairs()

template<template< typename, typename... > typename Cont, typename Left , typename Right , typename... Args>
std::pair< Left, Right > bb::sum_pairs ( Cont< std::pair< Left, Right >, Args... > const &  in)

Definition at line 81 of file container.hpp.

◆ tamper_with_proof() [1/2]

template<typename InnerProver , typename InnerFlavor , typename ProofType >
void bb::tamper_with_proof ( InnerProver &  inner_prover,
ProofType &  inner_proof,
TamperType  type 
)

Test method that provides several ways to tamper with a proof. TODO(https://github.com/AztecProtocol/barretenberg/issues/1298): Currently, several tests are failing due to challenges not being re-computed after tampering. We need to extend this tool to allow for more elaborate tampering.

Template Parameters
InnerProver
InnerFlavor
ProofType
Parameters
inner_prover
inner_proof
type

Definition at line 35 of file tamper_proof.hpp.

◆ tamper_with_proof() [2/2]

template<typename InnerProver , typename InnerFlavor , typename ProofType >
void bb::tamper_with_proof ( ProofType &  inner_proof,
bool  end_of_proof 
)

Tamper with a proof by finding the first non-zero value and incrementing it by 1 and by modifying the last commitment.

Definition at line 107 of file tamper_proof.hpp.

◆ TEST() [1/30]

bb::TEST ( MegaCircuitBuilder  ,
BaseCase   
)

Definition at line 53 of file mega_circuit_builder.test.cpp.

◆ TEST() [2/30]

bb::TEST ( MegaCircuitBuilder  ,
CompleteSelectorPartitioningCheck   
)

Check that the selector partitioning is correct for the mega circuit builder.

We check that for the arithmetic, delta_range, elliptic, memory, nnf, lookup, busread, poseidon2_external, poseidon2_internal blocks, and the other selectors are zero on that block.

Definition at line 170 of file mega_circuit_builder.test.cpp.

◆ TEST() [3/30]

bb::TEST ( MegaCircuitBuilder  ,
CopyConstructor   
)

Definition at line 14 of file mega_circuit_builder.test.cpp.

◆ TEST() [4/30]

bb::TEST ( MegaCircuitBuilder  ,
GoblinEccOpQueueUltraOps   
)

Check that the ultra ops are recorded correctly in the EccOpQueue.

Definition at line 136 of file mega_circuit_builder.test.cpp.

◆ TEST() [5/30]

bb::TEST ( MegaCircuitBuilder  ,
GoblinSimple   
)

Test the queueing of simple ecc ops via the Goblin builder.

There are two things to check here: 1) When ecc ops are queued by the builder, the corresponding native operations are performed correctly by the internal ecc op queue, and 2) The ecc op gate operands are correctly encoded in the op_wires, i.e. the operands can be reconstructed as expected.

Definition at line 69 of file mega_circuit_builder.test.cpp.

◆ TEST() [6/30]

bb::TEST ( UltraCircuitBuilder  ,
BadLookupFailure   
)

Definition at line 105 of file ultra_circuit_builder.test.cpp.

◆ TEST() [7/30]

bb::TEST ( UltraCircuitBuilder  ,
BadTagPermutation   
)

Definition at line 267 of file ultra_circuit_builder.test.cpp.

◆ TEST() [8/30]

bb::TEST ( UltraCircuitBuilder  ,
BaseCase   
)

Definition at line 121 of file ultra_circuit_builder.test.cpp.

◆ TEST() [9/30]

bb::TEST ( UltraCircuitBuilder  ,
CheckCircuitShowcase   
)

Definition at line 883 of file ultra_circuit_builder.test.cpp.

◆ TEST() [10/30]

bb::TEST ( UltraCircuitBuilder  ,
ComposedRangeConstraint   
)

Definition at line 557 of file ultra_circuit_builder.test.cpp.

◆ TEST() [11/30]

bb::TEST ( UltraCircuitBuilder  ,
CopyConstructor   
)

Definition at line 16 of file ultra_circuit_builder.test.cpp.

◆ TEST() [12/30]

bb::TEST ( UltraCircuitBuilder  ,
CreateGatesFromPlookupAccumulators   
)

Definition at line 43 of file ultra_circuit_builder.test.cpp.

◆ TEST() [13/30]

bb::TEST ( UltraCircuitBuilder  ,
NonNativeFieldMultiplication   
)

Definition at line 580 of file ultra_circuit_builder.test.cpp.

◆ TEST() [14/30]

bb::TEST ( UltraCircuitBuilder  ,
NonNativeFieldMultiplicationSortCheck   
)

Test that the nnf block only contains nnf gates.

Definition at line 638 of file ultra_circuit_builder.test.cpp.

◆ TEST() [15/30]

bb::TEST ( UltraCircuitBuilder  ,
NonTrivialTagPermutation   
)

Definition at line 199 of file ultra_circuit_builder.test.cpp.

◆ TEST() [16/30]

bb::TEST ( UltraCircuitBuilder  ,
NonTrivialTagPermutationAndCycles   
)

Definition at line 229 of file ultra_circuit_builder.test.cpp.

◆ TEST() [17/30]

bb::TEST ( UltraCircuitBuilder  ,
Ram   
)

Definition at line 778 of file ultra_circuit_builder.test.cpp.

◆ TEST() [18/30]

bb::TEST ( UltraCircuitBuilder  ,
RamSimple   
)

A simple-as-possible RAM read test, for easier debugging.

Definition at line 748 of file ultra_circuit_builder.test.cpp.

◆ TEST() [19/30]

bb::TEST ( UltraCircuitBuilder  ,
RangeChecksOnDuplicates   
)

Definition at line 848 of file ultra_circuit_builder.test.cpp.

◆ TEST() [20/30]

bb::TEST ( UltraCircuitBuilder  ,
RangeConstraint   
)

Definition at line 411 of file ultra_circuit_builder.test.cpp.

◆ TEST() [21/30]

bb::TEST ( UltraCircuitBuilder  ,
RangeWithGates   
)

Definition at line 480 of file ultra_circuit_builder.test.cpp.

◆ TEST() [22/30]

bb::TEST ( UltraCircuitBuilder  ,
RangeWithGatesWhereRangeIsNotAPowerOfTwo   
)

Definition at line 496 of file ultra_circuit_builder.test.cpp.

◆ TEST() [23/30]

bb::TEST ( UltraCircuitBuilder  ,
Rom   
)

Definition at line 703 of file ultra_circuit_builder.test.cpp.

◆ TEST() [24/30]

bb::TEST ( UltraCircuitBuilder  ,
SortWidget   
)

Definition at line 296 of file ultra_circuit_builder.test.cpp.

◆ TEST() [25/30]

bb::TEST ( UltraCircuitBuilder  ,
SortWidgetComplex   
)

Definition at line 512 of file ultra_circuit_builder.test.cpp.

◆ TEST() [26/30]

bb::TEST ( UltraCircuitBuilder  ,
SortWidgetNeg   
)

Definition at line 539 of file ultra_circuit_builder.test.cpp.

◆ TEST() [27/30]

bb::TEST ( UltraCircuitBuilder  ,
SortWithEdgesGate   
)

Definition at line 322 of file ultra_circuit_builder.test.cpp.

◆ TEST() [28/30]

bb::TEST ( UltraCircuitBuilder  ,
TestEllipticDoubleGate   
)

Definition at line 179 of file ultra_circuit_builder.test.cpp.

◆ TEST() [29/30]

bb::TEST ( UltraCircuitBuilder  ,
TestEllipticGate   
)

Definition at line 151 of file ultra_circuit_builder.test.cpp.

◆ TEST() [30/30]

bb::TEST ( UltraCircuitBuilder  ,
TestNoLookupProof   
)

Definition at line 129 of file ultra_circuit_builder.test.cpp.

◆ TEST_F() [1/19]

bb::TEST_F ( EccRelationsConsistency  ,
RecursiveToNativeConsistency   
)

Definition at line 49 of file ecc_relation_consistency.test.cpp.

◆ TEST_F() [2/19]

bb::TEST_F ( ECCVMRecursiveTests  ,
IndependentVKHash   
)

Definition at line 257 of file eccvm_recursive_verifier.test.cpp.

◆ TEST_F() [3/19]

bb::TEST_F ( ECCVMRecursiveTests  ,
SingleRecursiveVerification   
)

Definition at line 242 of file eccvm_recursive_verifier.test.cpp.

◆ TEST_F() [4/19]

bb::TEST_F ( ECCVMRecursiveTests  ,
SingleRecursiveVerificationFailure   
)

Definition at line 247 of file eccvm_recursive_verifier.test.cpp.

◆ TEST_F() [5/19]

bb::TEST_F ( ECCVMRecursiveTests  ,
SingleRecursiveVerificationFailureTamperedProof   
)

Definition at line 252 of file eccvm_recursive_verifier.test.cpp.

◆ TEST_F() [6/19]

bb::TEST_F ( IPATest  ,
AIsZeroAfterOneRound   
)

Definition at line 167 of file ipa.test.cpp.

◆ TEST_F() [7/19]

bb::TEST_F ( IPATest  ,
ChallengesAreZero   
)

Definition at line 123 of file ipa.test.cpp.

◆ TEST_F() [8/19]

bb::TEST_F ( KZGTest  ,
ConstantPolynomial   
)

Definition at line 96 of file kzg.test.cpp.

◆ TEST_F() [9/19]

bb::TEST_F ( KZGTest  ,
EmptyPolynomial   
)

Definition at line 105 of file kzg.test.cpp.

◆ TEST_F() [10/19]

bb::TEST_F ( KZGTest  ,
GeminiShplonkKzgWithShift   
)

Test full PCS protocol: Gemini, Shplonk, KZG and pairing check.

Demonstrates the full PCS protocol as it is used in the construction and verification of a single Honk proof. (Expository comments included throughout).

Definition at line 153 of file kzg.test.cpp.

◆ TEST_F() [11/19]

bb::TEST_F ( KZGTest  ,
ShpleminiKzgShiftsRemoval   
)

Definition at line 320 of file kzg.test.cpp.

◆ TEST_F() [12/19]

bb::TEST_F ( KZGTest  ,
ShpleminiKzgWithShift   
)

Definition at line 208 of file kzg.test.cpp.

◆ TEST_F() [13/19]

bb::TEST_F ( KZGTest  ,
ShpleminiKzgWithShiftAndInterleaving   
)

Definition at line 261 of file kzg.test.cpp.

◆ TEST_F() [14/19]

bb::TEST_F ( KZGTest  ,
Single   
)

Definition at line 56 of file kzg.test.cpp.

◆ TEST_F() [15/19]

bb::TEST_F ( KZGTest  ,
SingleInLagrangeBasis   
)

Test opening proof of a polynomial given by its evaluations at \( i = 0, \ldots, n \). Should only be used for small values of \( n \).

Definition at line 119 of file kzg.test.cpp.

◆ TEST_F() [16/19]

bb::TEST_F ( KZGTest  ,
ZeroEvaluation   
)

Definition at line 66 of file kzg.test.cpp.

◆ TEST_F() [17/19]

bb::TEST_F ( KZGTest  ,
ZeroPolynomial   
)

Definition at line 79 of file kzg.test.cpp.

◆ TEST_F() [18/19]

bb::TEST_F ( TranslatorRecursiveTests  ,
IndependentVKHash   
)

Definition at line 201 of file translator_recursive_verifier.test.cpp.

◆ TEST_F() [19/19]

bb::TEST_F ( TranslatorRecursiveTests  ,
SingleRecursiveVerification   
)

Definition at line 196 of file translator_recursive_verifier.test.cpp.

◆ TYPED_TEST() [1/21]

bb::TYPED_TEST ( BatchedAffineAdditionTests  ,
Reduce   
)

Definition at line 28 of file batched_affine_addition.test.cpp.

◆ TYPED_TEST() [2/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitFull   
)

Definition at line 98 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [3/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitFullMedium   
)

Definition at line 126 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [4/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitSRSCheck   
)

Definition at line 154 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [5/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitStructuredMaskedWire   
)

Test commit_structured on polynomial with blocks of non-zero values that resembles masked structured witness.

Definition at line 219 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [6/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitStructuredNonzeroComplement   
)

Test the method for committing to structured polynomials with a constant nonzero complement (i.e. the permutation grand product polynomial z_perm in the structured trace setting).

Definition at line 256 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [7/21]

bb::TYPED_TEST ( CommitmentKeyTest  ,
CommitStructuredWire   
)

Test commit_structured on polynomial with blocks of non-zero values (like wires when using structured trace)

Definition at line 185 of file sparse_commitment.test.cpp.

◆ TYPED_TEST() [8/21]

bb::TYPED_TEST ( RecursiveVeriferCommitmentKeyTest  ,
EqualityTest   
)

Definition at line 40 of file verifier_commitment_key.test.cpp.

◆ TYPED_TEST() [9/21]

bb::TYPED_TEST ( ShpleminiTest  ,
CorrectnessOfGeminiClaimBatching   
)

Definition at line 152 of file shplemini.test.cpp.

◆ TYPED_TEST() [10/21]

bb::TYPED_TEST ( ShpleminiTest  ,
CorrectnessOfMultivariateClaimBatching   
)

Definition at line 47 of file shplemini.test.cpp.

◆ TYPED_TEST() [11/21]

bb::TYPED_TEST ( ShpleminiTest  ,
ShpleminiZKNoSumcheckOpenings   
)

Test Shplemini with ZK data consisting of a hiding polynomial generated by GeminiProver and Libra polynomials used to mask Sumcheck Round Univariates. This abstracts the PCS step in each ZK Flavor running over BN254.

Definition at line 271 of file shplemini.test.cpp.

◆ TYPED_TEST() [12/21]

bb::TYPED_TEST ( ShpleminiTest  ,
ShpleminiZKWithSumcheckOpenings   
)

Test Shplemini with ZK data consisting of a hiding polynomial generated by GeminiProver, Libra polynomials used to mask Sumcheck Round Univariates and prove/verify the claimed evaluations of committed sumcheck round univariates. This test abstracts the PCS step in each ZK Flavor running over Grumpkin.

Definition at line 385 of file shplemini.test.cpp.

◆ TYPED_TEST() [13/21]

bb::TYPED_TEST ( ShplonkTest  ,
ExportBatchClaimAndVerify   
)

Definition at line 92 of file shplonk.test.cpp.

◆ TYPED_TEST() [14/21]

bb::TYPED_TEST ( ShplonkTest  ,
ShplonkLinearlyDependent   
)

Definition at line 50 of file shplonk.test.cpp.

◆ TYPED_TEST() [15/21]

bb::TYPED_TEST ( ShplonkTest  ,
ShplonkSimple   
)

Definition at line 21 of file shplonk.test.cpp.

◆ TYPED_TEST() [16/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
LibraEvaluationsConsistency   
)

Definition at line 173 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST() [17/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
LibraEvaluationsConsistencyFailure   
)

Definition at line 210 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST() [18/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
ProverComputationsCorrectness   
)

Definition at line 52 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST() [19/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
TranslationMaskingTermConsistency   
)

Definition at line 255 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST() [20/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
TranslationMaskingTermConsistencyFailure   
)

Definition at line 307 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST() [21/21]

bb::TYPED_TEST ( SmallSubgroupIPATest  ,
VerifierEvaluations   
)

Definition at line 123 of file small_subgroup_ipa.test.cpp.

◆ TYPED_TEST_SUITE() [1/6]

bb::TYPED_TEST_SUITE ( BatchedAffineAdditionTests  ,
Curves   
)

◆ TYPED_TEST_SUITE() [2/6]

bb::TYPED_TEST_SUITE ( CommitmentKeyTest  ,
Curves   
)

◆ TYPED_TEST_SUITE() [3/6]

bb::TYPED_TEST_SUITE ( RecursiveVeriferCommitmentKeyTest  ,
Curves   
)

◆ TYPED_TEST_SUITE() [4/6]

bb::TYPED_TEST_SUITE ( ShpleminiTest  ,
TestSettings   
)

◆ TYPED_TEST_SUITE() [5/6]

bb::TYPED_TEST_SUITE ( ShplonkTest  ,
CurveTypes   
)

◆ TYPED_TEST_SUITE() [6/6]

bb::TYPED_TEST_SUITE ( SmallSubgroupIPATest  ,
TestFlavors   
)

◆ UltraCircuitChecker::check< MegaCircuitBuilder_< bb::fr > >()

◆ UltraCircuitChecker::init_empty_values< MegaCircuitBuilder_< bb::fr > >()

◆ UltraCircuitChecker::prepare_circuit< MegaCircuitBuilder_< bb::fr > >()

◆ unpack_from_file()

template<typename T >
T bb::unpack_from_file ( const std::filesystem::path &  filename)

Definition at line 55 of file private_execution_steps.cpp.

◆ update_gate_challenges()

template<typename FF >
std::vector< FF > bb::update_gate_challenges ( const FF perturbator_challenge,
const std::vector< FF > &  gate_challenges,
const std::vector< FF > &  init_challenges 
)

Compute the gate challenges used in the combiner calculation.

This is Step 8 of the protocol as written in the paper.

Definition at line 16 of file prover_verifier_shared.hpp.

◆ vector_of_evaluations()

void bb::vector_of_evaluations ( State &  state)
noexcept

Definition at line 18 of file protogalaxy.bench.cpp.

◆ verify_ivc()

bool bb::verify_ivc ( ClientIVC::Proof proof,
ClientIVC ivc 
)

Verify an IVC proof.

Definition at line 20 of file test_bench_shared.hpp.

◆ write() [1/5]

template<typename B , typename base_field , typename Params >
void bb::write ( B &  buf,
field2< base_field, Params > const &  value 
)

Definition at line 155 of file field2_declarations.hpp.

◆ write() [2/5]

template<typename B , typename Params >
void bb::write ( B &  buf,
field< Params > const &  value 
)

Definition at line 731 of file field_declarations.hpp.

◆ write() [3/5]

template<typename B , typename FF >
void bb::write ( B &  buf,
poly_triple_< FF > const &  constraint 
)
inline

Definition at line 93 of file gate_data.hpp.

◆ write() [4/5]

template<typename B , class Fr , size_t domain_end, size_t domain_start = 0>
void bb::write ( B &  it,
Univariate< Fr, domain_end, domain_start > const &  univariate 
)
inline

Definition at line 613 of file univariate.hpp.

◆ write() [5/5]

template<typename B , class Fr , size_t domain_end, bool has_a0_plus_a1>
void bb::write ( B &  it,
UnivariateCoefficientBasis< Fr, domain_end, has_a0_plus_a1 > const &  univariate 
)
inline

Definition at line 346 of file univariate_coefficient_basis.hpp.

◆ write_arbitrary_valid_client_ivc_proof_and_vk_to_file()

void bb::write_arbitrary_valid_client_ivc_proof_and_vk_to_file ( const std::filesystem::path &  output_dir)

Definition at line 261 of file api_client_ivc.cpp.

◆ write_file()

void bb::write_file ( const std::string &  filename,
std::vector< uint8_t > const &  data 
)
inline

Definition at line 58 of file file_io.hpp.

◆ write_recursion_inputs_ultra_honk()

template<typename Flavor >
void bb::write_recursion_inputs_ultra_honk ( const std::string &  bytecode_path,
const std::string &  witness_path,
const std::string &  output_path 
)

◆ write_recursion_inputs_ultra_honk< UltraFlavor >()

template void bb::write_recursion_inputs_ultra_honk< UltraFlavor > ( const std::string &  bytecode_path,
const std::string &  witness_path,
const std::string &  output_path 
)
extern

◆ write_recursion_inputs_ultra_honk< UltraRollupFlavor >()

template void bb::write_recursion_inputs_ultra_honk< UltraRollupFlavor > ( const std::string &  bytecode_path,
const std::string &  witness_path,
const std::string &  output_path 
)
extern

◆ zip_polys()

template<typename Poly , typename... Polys>
auto bb::zip_polys ( Poly &&  poly,
Polys &&...  polys 
)

Definition at line 555 of file polynomial.hpp.

Variable Documentation

◆ ADD_ASSIGN_SIZE

const size_t bb::ADD_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of ADD_ASSIGN instruction.

Definition at line 112 of file field.fuzzer.hpp.

◆ ADD_SIZE

const size_t bb::ADD_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3

Size of ADD instruction.

Definition at line 111 of file field.fuzzer.hpp.

◆ BATCH_INVERT_SIZE

const size_t bb::BATCH_INVERT_SIZE
Initial value:
=
INSTRUCTION_HEADER_SIZE + INDEX_SIZE + sizeof(uint8_t)
const size_t INSTRUCTION_HEADER_SIZE
Size of instruction header in bytes.
const size_t INDEX_SIZE
Size of index field in bytes.

Size of BATCH_INVERT instruction.

Definition at line 133 of file field.fuzzer.hpp.

◆ BB_VERSION_PLACEHOLDER

const char* const bb::BB_VERSION_PLACEHOLDER = "00000000.00000000.00000000"

Definition at line 38 of file cli.cpp.

◆ ck

Definition at line 20 of file ipa.fuzzer.cpp.

◆ COMMITMENT_TEST_NUM_BN254_POINTS

constexpr size_t bb::COMMITMENT_TEST_NUM_BN254_POINTS = 4096
constexpr

Definition at line 20 of file commitment_key.test.hpp.

◆ COMMITMENT_TEST_NUM_GRUMPKIN_POINTS

constexpr size_t bb::COMMITMENT_TEST_NUM_GRUMPKIN_POINTS = 1 << CONST_ECCVM_LOG_N
constexpr

Definition at line 21 of file commitment_key.test.hpp.

◆ COMMITMENT_TEST_NUM_POINTS

constexpr size_t bb::COMMITMENT_TEST_NUM_POINTS = 32
constexpr

Definition at line 18 of file ipa.fuzzer.cpp.

◆ DEFAULT_MIN_ITERS_PER_THREAD

const size_t bb::DEFAULT_MIN_ITERS_PER_THREAD = 1 << 4

Definition at line 89 of file thread.hpp.

◆ DIV_ASSIGN_SIZE

const size_t bb::DIV_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of DIV_ASSIGN instruction.

Definition at line 119 of file field.fuzzer.hpp.

◆ DIV_SIZE

const size_t bb::DIV_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3

Size of DIV instruction.

Definition at line 118 of file field.fuzzer.hpp.

◆ EQUAL_SIZE

const size_t bb::EQUAL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of EQUAL instruction.

Definition at line 127 of file field.fuzzer.hpp.

◆ FROM_MONTGOMERY_SIZE

const size_t bb::FROM_MONTGOMERY_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of FROM_MONTGOMERY instruction.

Definition at line 130 of file field.fuzzer.hpp.

◆ INCREMENT_SIZE

const size_t bb::INCREMENT_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE

Size of INCREMENT instruction.

Definition at line 113 of file field.fuzzer.hpp.

◆ INDEX_SIZE

const size_t bb::INDEX_SIZE = 1

Size of index field in bytes.

Definition at line 104 of file field.fuzzer.hpp.

◆ INSTRUCTION_HEADER_SIZE

const size_t bb::INSTRUCTION_HEADER_SIZE = 1

Size of instruction header in bytes.

Definition at line 103 of file field.fuzzer.hpp.

◆ INTERNAL_STATE_SIZE

const size_t bb::INTERNAL_STATE_SIZE = 32

Constant defining the number of elements in the VM's internal state.

Definition at line 30 of file field.fuzzer.hpp.

◆ INV_SIZE

const size_t bb::INV_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of INV instruction.

Definition at line 120 of file field.fuzzer.hpp.

◆ is_field_type_v

template<typename T >
constexpr bool bb::is_field_type_v = is_field_type<T>::value
inlineconstexpr

Definition at line 258 of file barycentric.hpp.

◆ is_iterable_v

template<typename T >
constexpr bool bb::is_iterable_v = is_iterable<T>::value
constexpr

Definition at line 143 of file transcript.hpp.

◆ IS_ZERO_SIZE

const size_t bb::IS_ZERO_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE

Size of IS_ZERO instruction.

Definition at line 126 of file field.fuzzer.hpp.

◆ MAX_LOG_NUM_GRUMPKIN_POINTS

constexpr size_t bb::MAX_LOG_NUM_GRUMPKIN_POINTS = 16
constexpr

Definition at line 257 of file commit.bench.cpp.

◆ MAX_LOG_NUM_POINTS

constexpr size_t bb::MAX_LOG_NUM_POINTS = 20
constexpr

Definition at line 91 of file commit.bench.cpp.

◆ MAX_NUM_GRUMPKIN_POINTS

constexpr size_t bb::MAX_NUM_GRUMPKIN_POINTS = 1 << MAX_LOG_NUM_GRUMPKIN_POINTS
constexpr

Definition at line 258 of file commit.bench.cpp.

◆ MAX_NUM_POINTS

constexpr size_t bb::MAX_NUM_POINTS = 1 << MAX_LOG_NUM_POINTS
constexpr

Definition at line 92 of file commit.bench.cpp.

◆ MIN_LOG_NUM_GRUMPKIN_POINTS

constexpr size_t bb::MIN_LOG_NUM_GRUMPKIN_POINTS = 12
constexpr

Definition at line 256 of file commit.bench.cpp.

◆ MIN_LOG_NUM_POINTS

constexpr size_t bb::MIN_LOG_NUM_POINTS = 16
constexpr

Definition at line 90 of file commit.bench.cpp.

◆ MUL_ASSIGN_SIZE

const size_t bb::MUL_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of MUL_ASSIGN instruction.

Definition at line 115 of file field.fuzzer.hpp.

◆ MUL_SIZE

const size_t bb::MUL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3

Size of MUL instruction.

Definition at line 114 of file field.fuzzer.hpp.

◆ NEG_SIZE

const size_t bb::NEG_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of NEG instruction.

Definition at line 121 of file field.fuzzer.hpp.

◆ NOT_EQUAL_SIZE

const size_t bb::NOT_EQUAL_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of NOT_EQUAL instruction.

Definition at line 128 of file field.fuzzer.hpp.

◆ NUM_DATABUS_COMMITMENTS

constexpr uint32_t bb::NUM_DATABUS_COMMITMENTS = 2
constexpr

Definition at line 16 of file databus.hpp.

◆ PERMUTATION_ARGUMENT_VALUE_SEPARATOR

constexpr uint32_t bb::PERMUTATION_ARGUMENT_VALUE_SEPARATOR = 1 << 28
constexpr

Definition at line 9 of file constants.hpp.

◆ POW_SIZE

const size_t bb::POW_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3 + sizeof(uint64_t)

Size of POW instruction.

Definition at line 124 of file field.fuzzer.hpp.

◆ PROPAGATED_DATABUS_COMMITMENT_SIZE

constexpr uint32_t bb::PROPAGATED_DATABUS_COMMITMENT_SIZE = 8
constexpr

Definition at line 17 of file databus.hpp.

◆ PROPAGATED_DATABUS_COMMITMENTS_SIZE

constexpr uint32_t bb::PROPAGATED_DATABUS_COMMITMENTS_SIZE = PROPAGATED_DATABUS_COMMITMENT_SIZE * NUM_DATABUS_COMMITMENTS
constexpr

Definition at line 18 of file databus.hpp.

◆ REDUCE_ONCE_SIZE

const size_t bb::REDUCE_ONCE_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of REDUCE_ONCE instruction.

Definition at line 131 of file field.fuzzer.hpp.

◆ SELF_REDUCE_SIZE

const size_t bb::SELF_REDUCE_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE

Size of SELF_REDUCE instruction.

Definition at line 132 of file field.fuzzer.hpp.

◆ SET_VALUE_SIZE

const size_t bb::SET_VALUE_SIZE
Initial value:
=
INSTRUCTION_HEADER_SIZE + INDEX_SIZE + sizeof(numeric::uint256_t)

Size of SET_VALUE instruction.

Definition at line 109 of file field.fuzzer.hpp.

◆ SETTINGS_SIZE

const size_t bb::SETTINGS_SIZE = sizeof(VMSettings)

Definition at line 68 of file field.fuzzer.hpp.

◆ SPARSE_NUM_NONZERO

constexpr size_t bb::SPARSE_NUM_NONZERO = 100
constexpr

Definition at line 93 of file commit.bench.cpp.

◆ SQR_ASSIGN_SIZE

const size_t bb::SQR_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE

Size of SQR_ASSIGN instruction.

Definition at line 123 of file field.fuzzer.hpp.

◆ SQR_SIZE

const size_t bb::SQR_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of SQR instruction.

Definition at line 122 of file field.fuzzer.hpp.

◆ SQRT_SIZE

const size_t bb::SQRT_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of SQRT instruction.

Definition at line 125 of file field.fuzzer.hpp.

◆ SUB_ASSIGN_SIZE

const size_t bb::SUB_ASSIGN_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of SUB_ASSIGN instruction.

Definition at line 117 of file field.fuzzer.hpp.

◆ SUB_SIZE

const size_t bb::SUB_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 3

Size of SUB instruction.

Definition at line 116 of file field.fuzzer.hpp.

◆ TO_MONTGOMERY_SIZE

const size_t bb::TO_MONTGOMERY_SIZE = INSTRUCTION_HEADER_SIZE + INDEX_SIZE * 2

Size of TO_MONTGOMERY instruction.

Definition at line 129 of file field.fuzzer.hpp.

◆ unique_transcript_index

std::atomic<size_t> bb::unique_transcript_index { 0 }
inline

Definition at line 149 of file transcript.hpp.

◆ vk

Definition at line 21 of file ipa.fuzzer.cpp.