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

Classes

struct  AcirFormat
 Barretenberg's representation of ACIR constraints. More...
 
struct  AcirFormatOriginalOpcodeIndices
 Indices of the original opcode that originated each constraint in AcirFormat. More...
 
struct  AcirProgram
 Struct containing both the constraints to be added to the circuit and the witness vector. More...
 
struct  AES128Constraint
 
struct  AES128Input
 
class  BigQuadConstraint
 Constraint representing a polynomial of degree 1 or 2 that does not fit into a standard UltraHonk arithmetic constraint of width 4. More...
 
struct  Blake2sConstraint
 
struct  Blake2sInput
 
struct  Blake3Constraint
 
struct  Blake3Input
 
struct  BlockConstraint
 Struct holding the data required to add memory constraints to a circuit. More...
 
struct  EcAdd
 Constraints for addition of two points on the Grumpkin curve. More...
 
struct  EcdsaConstraint
 ECDSA constraints. More...
 
class  GateCounter
 Utility class for tracking the gate count of acir constraints. More...
 
struct  HonkRecursionConstraintsOutput
 Container for the output of multiple recursive verifications. More...
 
struct  is_std_vector
 
struct  is_std_vector< std::vector< T, Alloc > >
 
struct  Keccakf1600
 
struct  LogicConstraint
 Logic constraint representation in ACIR format. More...
 
struct  MemOp
 Memory operation. Index and value store the index of the memory location, and value is the value to be read or written. More...
 
struct  MsmInputs
 
struct  MultiScalarMul
 
struct  Poseidon2Constraint
 
struct  Predicate
 
struct  ProgramMetadata
 Metadata required to create a circuit. More...
 
struct  RangeConstraint
 
struct  RecursionConstraint
 RecursionConstraint struct contains information required to recursively verify a proof. More...
 
struct  Sha256Compression
 
class  TestClass
 
class  TestClassWithPredicate
 Test class for ACIR constraints that contain a predicate. More...
 
struct  WitnessOrConstant
 

Concepts

concept  TestBase
 Concept defining the requirements for the Base template parameter of TestClass.
 
concept  TestBaseWithPredicate
 Concept defining the requirements for the Base template parameter of TestClassWithPredicate.
 

Typedefs

using WitnessVector = std::vector< bb::fr >
 
using QuadConstraint = mul_quad_< bb::fr >
 Standard UltraHonk arithmetic constraint of width 4.
 
template<typename Builder >
using HonkRecursionConstraintOutput = bb::stdlib::recursion::honk::UltraRecursiveVerifierOutput< Builder >
 Alias for the result of recursively verifying a proof.
 

Enumerations

enum  AccessType : std::uint8_t { Read = 0 , Write = 1 }
 
enum  CallDataType : std::uint8_t { None = 0 , Primary = 1 , Secondary = 2 }
 
enum  BlockType : std::uint8_t { ROM = 0 , RAM = 1 , CallData = 2 , ReturnData = 3 }
 
enum  PROOF_TYPE : uint8_t {
  HONK , OINK , HN , AVM ,
  ROLLUP_HONK , ROOT_ROLLUP_HONK , HONK_ZK , HN_FINAL ,
  HN_TAIL , CHONK
}
 
enum class  PredicateTestCase : uint8_t { ConstantTrue , WitnessTrue , WitnessFalse }
 

Functions

template<typename Builder >
void build_constraints (Builder &builder, AcirFormat &constraints, const ProgramMetadata &metadata)
 Add to the builder the constraints contained in an AcirFormat instance.
 
template<>
UltraCircuitBuilder create_circuit (AcirProgram &program, const ProgramMetadata &metadata)
 Specialization for creating an Ultra circuit from an acir program.
 
template<>
MegaCircuitBuilder create_circuit (AcirProgram &program, const ProgramMetadata &metadata)
 Specialization for creating a Mega circuit from an acir program.
 
template void build_constraints< UltraCircuitBuilder > (UltraCircuitBuilder &, AcirFormat &, const ProgramMetadata &)
 
template void build_constraints< MegaCircuitBuilder > (MegaCircuitBuilder &, AcirFormat &, const ProgramMetadata &)
 
template<typename Builder >
Builder create_circuit (AcirProgram &program, const ProgramMetadata &metadata=ProgramMetadata{})
 Create a circuit out of an ACIR program and metadata.
 
bb::fr from_buffer_with_bound_checks (const std::vector< uint8_t > &buffer)
 ========= HELPERS ========= ///
 
WitnessOrConstant< bb::frparse_input (const Acir::FunctionInput &input)
 Parse an Acir::FunctionInput (which can either be a witness or a constant) into a WitnessOrConstant.
 
uint32_t get_witness_from_function_input (const Acir::FunctionInput &input)
 Extract the witness index from an Acir::FunctionInput representing a witness.
 
void update_max_witness_index (const uint32_t witness_idx, AcirFormat &af)
 Update the max_witness_index.
 
void update_max_witness_index_from_expression (Acir::Expression const &expr, AcirFormat &af)
 Update max_witness_index by processing all witnesses in an Acir::Expression.
 
void update_max_witness_index_from_opcode (Acir::Opcode const &opcode, AcirFormat &af)
 Update the max witness index by processing all the witness indices contained in the Acir::Opcode.
 
template<typename T >
deserialize_any_format (std::vector< uint8_t > &&buf, std::function< T(msgpack::object const &)> decode_msgpack, std::function< T(std::vector< uint8_t >)> decode_bincode)
 ========= BYTES TO BARRETENBERG'S REPRESENTATION ========= ///
 
AcirFormat circuit_serde_to_acir_format (Acir::Circuit const &circuit)
 Convert an Acir::Circuit into an AcirFormat by processing all the opcodes.
 
AcirFormat circuit_buf_to_acir_format (std::vector< uint8_t > &&buf)
 Convert a buffer representing a circuit into Barretenberg's internal AcirFormat representation.
 
WitnessVector witness_buf_to_witness_vector (std::vector< uint8_t > &&buf)
 Convert a buffer representing a witness vector into Barretenberg's internal WitnessVector format.
 
WitnessVector witness_map_to_witness_vector (Witnesses::WitnessMap const &witness_map)
 Convert from the ACIR-native WitnessMap format to Barretenberg's internal WitnessVector format.
 
std::vector< mul_quad_< fr > > split_into_mul_quad_gates (Acir::Expression const &arg, std::map< uint32_t, bb::fr > &linear_terms)
 ========= ACIR OPCODE HANDLERS ========= ///
 
void assert_zero_to_quad_constraints (Acir::Opcode::AssertZero const &arg, AcirFormat &af, size_t opcode_index)
 Single entrypoint for processing arithmetic (AssertZero) opcodes.
 
void add_blackbox_func_call_to_acir_format (Acir::Opcode::BlackBoxFuncCall const &arg, AcirFormat &af, size_t opcode_index)
 
BlockConstraint memory_init_to_block_constraint (Acir::Opcode::MemoryInit const &mem_init)
 ========= MEMORY OPERATIONS ========== ///
 
void add_memory_op_to_block_constraint (Acir::Opcode::MemoryOp const &mem_op, BlockConstraint &block)
 Process memory operation, either read or write, and update the BlockConstraint type accordingly.
 
bool is_single_arithmetic_gate (Acir::Expression const &arg, const std::map< uint32_t, bb::fr > &linear_terms)
 Given an Acir::Expression and its processed linear terms, determine whether it can be represented by a single width-4 arithmetic gate.
 
std::map< uint32_t, bb::frprocess_linear_terms (Acir::Expression const &expr)
 ========= ACIR OPCODE HANDLERS ========= ///
 
template<typename Builder >
void create_aes128_constraints (Builder &builder, const AES128Constraint &constraint)
 
template void create_aes128_constraints< UltraCircuitBuilder > (UltraCircuitBuilder &builder, const AES128Constraint &constraint)
 
template void create_aes128_constraints< MegaCircuitBuilder > (MegaCircuitBuilder &builder, const AES128Constraint &constraint)
 
template<typename Builder >
void set_zero_idx (const Builder &builder, QuadConstraint &mul_quad)
 Replace indices which are set to IS_CONSTANT with the zero index of the builder.
 
template<typename Builder >
void check_mul_add_gate (Builder &builder, const QuadConstraint &mul_quad, const typename Builder::FF next_wire_w4=Builder::FF::zero())
 Check if a mul add gate is valid.
 
template<typename Builder >
void create_quad_constraint (Builder &builder, QuadConstraint &mul_quad)
 Create a simple width-4 Ultra arithmetic gate constraint representing the equation.
 
template<typename Builder >
void create_big_quad_constraint (Builder &builder, BigQuadConstraint &big_constraint)
 
template void set_zero_idx< UltraCircuitBuilder > (const UltraCircuitBuilder &, QuadConstraint &)
 
template void set_zero_idx< MegaCircuitBuilder > (const MegaCircuitBuilder &, QuadConstraint &)
 
template void check_mul_add_gate< UltraCircuitBuilder > (UltraCircuitBuilder &, const QuadConstraint &, const typename UltraCircuitBuilder::FF)
 
template void check_mul_add_gate< MegaCircuitBuilder > (MegaCircuitBuilder &, const QuadConstraint &, const typename MegaCircuitBuilder::FF)
 
template void create_quad_constraint< UltraCircuitBuilder > (UltraCircuitBuilder &builder, QuadConstraint &constraint)
 
template void create_quad_constraint< MegaCircuitBuilder > (MegaCircuitBuilder &builder, QuadConstraint &constraint)
 
template void create_big_quad_constraint< UltraCircuitBuilder > (UltraCircuitBuilder &builder, BigQuadConstraint &big_constraint)
 
template void create_big_quad_constraint< MegaCircuitBuilder > (MegaCircuitBuilder &builder, BigQuadConstraint &big_constraint)
 
HonkRecursionConstraintOutput< bb::UltraCircuitBuildercreate_avm2_recursion_constraints_goblin ( UltraCircuitBuilder &builder, const RecursionConstraint &input)
 Stub implementation for AVM2 recursion constraints.
 
template<typename Builder >
void create_blake2s_constraints (Builder &builder, const Blake2sConstraint &constraint)
 
template void create_blake2s_constraints< UltraCircuitBuilder > (UltraCircuitBuilder &builder, const Blake2sConstraint &constraint)
 
template void create_blake2s_constraints< MegaCircuitBuilder > (MegaCircuitBuilder &builder, const Blake2sConstraint &constraint)
 
template<typename Builder >
void create_blake3_constraints (Builder &builder, const Blake3Constraint &constraint)
 
template void create_blake3_constraints< bb::UltraCircuitBuilder > (bb::UltraCircuitBuilder &builder, const Blake3Constraint &constraint)
 
template void create_blake3_constraints< bb::MegaCircuitBuilder > (bb::MegaCircuitBuilder &builder, const Blake3Constraint &constraint)
 
template<>
void create_block_constraints (UltraCircuitBuilder &builder, const BlockConstraint &constraint)
 Create block constraints; Specialization for Ultra arithmetization.
 
template<>
void create_block_constraints (MegaCircuitBuilder &builder, const BlockConstraint &constraint)
 Create block constraints; Specialization for Mega arithmetization.
 
template<typename Builder >
void process_ROM_operations (Builder &builder, const BlockConstraint &constraint, std::vector< bb::stdlib::field_t< Builder > > &init)
 
template<typename Builder >
void process_RAM_operations (Builder &builder, const BlockConstraint &constraint, std::vector< bb::stdlib::field_t< Builder > > &init)
 
template<typename Builder >
void process_call_data_operations (Builder &builder, const BlockConstraint &constraint, std::vector< bb::stdlib::field_t< Builder > > &init)
 
template<typename Builder >
void process_return_data_operations (Builder &builder, const BlockConstraint &constraint, std::vector< bb::stdlib::field_t< Builder > > &init)
 
template<typename Builder >
void create_block_constraints (Builder &builder, const BlockConstraint &constraint)
 
void create_dummy_vkey_and_proof (UltraCircuitBuilder &builder, size_t proof_size, size_t public_inputs_size, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &key_fields, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &proof_fields)
 Creates a dummy vkey and proof object.
 
HonkRecursionConstraintOutput< bb::UltraCircuitBuildercreate_chonk_recursion_constraints (bb::UltraCircuitBuilder &builder, const RecursionConstraint &input)
 Add constraints associated with recursive verification of a Chonk proof.
 
template<typename Builder >
void create_ec_add_constraint (Builder &builder, const EcAdd &input)
 Create constraints for addition of two points on the Grumpkin curve.
 
template void create_ec_add_constraint< bb::UltraCircuitBuilder > (bb::UltraCircuitBuilder &builder, const EcAdd &input)
 
template void create_ec_add_constraint< bb::MegaCircuitBuilder > (bb::MegaCircuitBuilder &builder, const EcAdd &input)
 
template<typename Curve >
void create_ecdsa_verify_constraints (typename Curve::Builder &builder, const EcdsaConstraint &input)
 Create constraints to verify an ECDSA signature.
 
template<typename Curve >
void create_dummy_ecdsa_constraint (typename Curve::Builder &builder, const std::vector< stdlib::field_t< typename Curve::Builder > > &hashed_message_fields, const std::vector< stdlib::field_t< typename Curve::Builder > > &r_fields, const std::vector< stdlib::field_t< typename Curve::Builder > > &s_fields, const std::vector< stdlib::field_t< typename Curve::Builder > > &pub_x_fields, const std::vector< stdlib::field_t< typename Curve::Builder > > &pub_y_fields, const stdlib::field_t< typename Curve::Builder > &result_field)
 Generate dummy ECDSA constraints when the builder doesn't have witnesses.
 
template void create_ecdsa_verify_constraints< stdlib::secp256k1< UltraCircuitBuilder > > (UltraCircuitBuilder &builder, const EcdsaConstraint &input)
 
template void create_ecdsa_verify_constraints< stdlib::secp256k1< MegaCircuitBuilder > > (MegaCircuitBuilder &builder, const EcdsaConstraint &input)
 
template void create_ecdsa_verify_constraints< stdlib::secp256r1< UltraCircuitBuilder > > (UltraCircuitBuilder &builder, const EcdsaConstraint &input)
 
template void create_ecdsa_verify_constraints< stdlib::secp256r1< MegaCircuitBuilder > > (MegaCircuitBuilder &builder, const EcdsaConstraint &input)
 
template void create_dummy_ecdsa_constraint< stdlib::secp256k1< UltraCircuitBuilder > > (UltraCircuitBuilder &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const stdlib::field_t< UltraCircuitBuilder > &)
 
template void create_dummy_ecdsa_constraint< stdlib::secp256r1< UltraCircuitBuilder > > (UltraCircuitBuilder &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const std::vector< stdlib::field_t< UltraCircuitBuilder > > &, const stdlib::field_t< UltraCircuitBuilder > &)
 
template<typename RecursiveFlavor >
constexpr std::tuple< size_t, size_t > HONK_RECURSION_CONSTANTS (const PredicateTestCase &mode=PredicateTestCase::ConstantTrue)
 
template<typename Flavor >
requires (IsRecursiveFlavor<Flavor> && IsUltraHonk<typename Flavor::NativeFlavor>)
HonkRecursionConstraintOutput< typename Flavor::CircuitBuildercreate_honk_recursion_constraints (typename Flavor::CircuitBuilder &builder, const RecursionConstraint &input)
 Add to the builder the constraints to recursively verify a Honk proof.
 
template<typename Flavor >
void native_verification_debug (const std::shared_ptr< typename Flavor::VerificationKey > vkey, const typename Flavor::NativeFlavor::FF vkey_hash, const bb::stdlib::Proof< typename Flavor::CircuitBuilder > &proof_fields)
 Natively verify the stdlib proof for debugging.
 
std::shared_ptr< Chonkcreate_mock_chonk_from_constraints (const std::vector< RecursionConstraint > &constraints)
 Create an IVC object with mocked state corresponding to a set of IVC recursion constraints.
 
Chonk::VerifierInputs create_mock_verification_queue_entry (const Chonk::QUEUE_TYPE verification_type, const bool is_kernel)
 Create a mock verification queue entry with proof and VK that have the correct structure but are not necessarily valid.
 
void mock_chonk_accumulation (const std::shared_ptr< Chonk > &ivc, Chonk::QUEUE_TYPE type, const bool is_kernel)
 Populate an IVC instance with data that mimics the state after a single IVC accumulation.
 
void populate_dummy_vk_in_constraint (MegaCircuitBuilder &builder, const std::shared_ptr< MegaFlavor::VerificationKey > &mock_verification_key, const std::vector< uint32_t > &key_witness_indices)
 Populate VK witness fields from a recursion constraint from a provided VerificationKey.
 
template<typename Builder >
void create_keccak_permutations_constraints (Builder &builder, const Keccakf1600 &constraint)
 
template void create_keccak_permutations_constraints< bb::UltraCircuitBuilder > (bb::UltraCircuitBuilder &builder, const Keccakf1600 &constraint)
 
template void create_keccak_permutations_constraints< bb::MegaCircuitBuilder > (bb::MegaCircuitBuilder &builder, const Keccakf1600 &constraint)
 
template<typename Builder >
void create_logic_gate (Builder &builder, const WitnessOrConstant< bb::fr > a, const WitnessOrConstant< bb::fr > b, const uint32_t result, const size_t num_bits, const bool is_xor_gate)
 
template void create_logic_gate< bb::MegaCircuitBuilder > (bb::MegaCircuitBuilder &builder, const WitnessOrConstant< bb::fr > a, const WitnessOrConstant< bb::fr > b, const uint32_t result, const size_t num_bits, const bool is_xor_gate)
 
template void create_logic_gate< bb::UltraCircuitBuilder > (bb::UltraCircuitBuilder &builder, const WitnessOrConstant< bb::fr > a, const WitnessOrConstant< bb::fr > b, const uint32_t result, const size_t num_bits, const bool is_xor_gate)
 
template<typename Builder >
void create_logic_gate (Builder &builder, WitnessOrConstant< fr > a, WitnessOrConstant< fr > b, uint32_t result, std::size_t num_bits, bool is_xor_gate)
 
void xor_gate (UltraCircuitBuilder &builder, WitnessOrConstant< fr > a, WitnessOrConstant< fr > b, uint32_t result)
 
void and_gate (UltraCircuitBuilder &builder, WitnessOrConstant< fr > a, WitnessOrConstant< fr > b, uint32_t result)
 
template<class Curve >
void populate_field_elements_for_mock_commitments (std::vector< bb::fr > &fields, const size_t &num_commitments)
 Helper to populate a field buffer with fields corresponding to some number of mock commitment values.
 
template<class FF >
void populate_field_elements (std::vector< bb::fr > &fields, const size_t &num_elements, std::optional< FF > value=std::nullopt)
 Helper to populate a field buffer with some number of field elements.
 
template<typename Flavor , class PublicInputs >
HonkProof create_mock_oink_proof (const size_t acir_public_inputs_size)
 Create a mock oink proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
HonkProof create_mock_sumcheck_proof ()
 Create a mock sumcheck proof that has the correct structure but is not in general valid.
 
HonkProof create_mock_multilinear_batch_proof ()
 Create a mock multilinear batching sumcheck proof that has the correct structure but is not in general valid.
 
template<typename Flavor , class PublicInputs >
HonkProof create_mock_hyper_nova_proof (bool include_fold)
 Create a mock Hypernova proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
HonkProof create_mock_pcs_proof ()
 Create a mock PCS proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
HonkProof create_mock_decider_proof ()
 Create a mock decider proof that has the correct structure but is not in general valid.
 
template<typename Flavor , class PublicInputs >
HonkProof create_mock_honk_proof (const size_t acir_public_inputs_size)
 Create a mock honk proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
std::pair< HonkProof, std::shared_ptr< typename Flavor::VerificationKey > > construct_arbitrary_valid_honk_proof_and_vk (const size_t acir_public_inputs_size)
 Create a valid honk proof and vk for a circuit with a single big add gate. Adds random public inputs to match num_public_inputs provided.
 
Goblin::MergeProof create_mock_merge_proof ()
 Create a mock merge proof which has the correct structure but is not necessarily valid.
 
HonkProof create_mock_eccvm_proof ()
 Create a mock pre-ipa proof which has the correct structure but is not necessarily valid.
 
HonkProof create_mock_ipa_proof ()
 Create a mock ipa proof which has the correct structure but is not necessarily valid.
 
HonkProof create_mock_translator_proof ()
 Create a mock Translator proof which has the correct structure but is not necessarily valid.
 
template<typename Builder >
HonkProof create_mock_chonk_proof (const size_t acir_public_inputs_size)
 Create a mock Chonk proof which has the correct structure but is not necessarily valid.
 
template<typename Flavor , class PublicInputs >
std::shared_ptr< typename Flavor::VerificationKeycreate_mock_honk_vk (const size_t dyadic_size, const size_t pub_inputs_offset, const size_t acir_public_inputs_size=0)
 Create a mock VK that has the correct structure.
 
template HonkProof create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::AppIO > (const size_t)
 
template HonkProof create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > (const size_t)
 
template HonkProof create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_oink_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > (const size_t)
 
template HonkProof create_mock_pcs_proof< MegaFlavor > ()
 
template HonkProof create_mock_decider_proof< MegaFlavor > ()
 
template HonkProof create_mock_decider_proof< UltraFlavor > ()
 
template HonkProof create_mock_decider_proof< UltraZKFlavor > ()
 
template HonkProof create_mock_decider_proof< UltraRollupFlavor > ()
 
template HonkProof create_mock_decider_proof< TranslatorFlavor > ()
 
template HonkProof create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::AppIO > (const size_t)
 
template HonkProof create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > (const size_t)
 
template HonkProof create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t)
 
template HonkProof create_mock_honk_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > (const size_t)
 
template std::pair< HonkProof, std::shared_ptr< UltraFlavor::VerificationKey > > construct_arbitrary_valid_honk_proof_and_vk< UltraFlavor > (const size_t)
 
template std::pair< HonkProof, std::shared_ptr< UltraZKFlavor::VerificationKey > > construct_arbitrary_valid_honk_proof_and_vk< UltraZKFlavor > (const size_t)
 
template std::pair< HonkProof, std::shared_ptr< UltraRollupFlavor::VerificationKey > > construct_arbitrary_valid_honk_proof_and_vk< UltraRollupFlavor > (const size_t)
 
template HonkProof create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::AppIO > (bool)
 
template HonkProof create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > (bool)
 
template HonkProof create_mock_chonk_proof< UltraCircuitBuilder > (const size_t)
 
template HonkProof create_mock_chonk_proof< MegaCircuitBuilder > (const size_t)
 
template std::shared_ptr< MegaFlavor::VerificationKeycreate_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::AppIO > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< MegaFlavor::VerificationKeycreate_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::KernelIO > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< MegaFlavor::VerificationKeycreate_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< MegaZKFlavor::VerificationKey > create_mock_honk_vk< MegaZKFlavor, stdlib::recursion::honk::HidingKernelIO< UltraCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< UltraFlavor::VerificationKeycreate_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< UltraZKFlavor::VerificationKey > create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< UltraFlavor::VerificationKeycreate_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< UltraZKFlavor::VerificationKey > create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > (const size_t, const size_t, const size_t)
 
template std::shared_ptr< UltraRollupFlavor::VerificationKey > create_mock_honk_vk< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > (const size_t, const size_t, const size_t)
 
template<typename Flavor , class PublicInputs >
bb::HonkProof create_mock_oink_proof (const size_t acir_public_inputs_size=0)
 Create a mock oink proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
bb::HonkProof create_mock_sumcheck_proof ()
 Create a mock sumcheck proof that has the correct structure but is not in general valid.
 
template<typename Flavor , class PublicInputs >
bb::HonkProof create_mock_hyper_nova_proof (bool include_fold=false)
 Create a mock Hypernova proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
bb::HonkProof create_mock_pcs_proof ()
 Create a mock PCS proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
bb::HonkProof create_mock_decider_proof ()
 Create a mock decider proof that has the correct structure but is not in general valid.
 
template<typename Flavor , class PublicInputs >
bb::HonkProof create_mock_honk_proof (const size_t acir_public_inputs_size=0)
 Create a mock honk proof that has the correct structure but is not in general valid.
 
template<typename Flavor >
std::pair< bb::HonkProof, std::shared_ptr< typename Flavor::VerificationKey > > construct_arbitrary_valid_honk_proof_and_vk (size_t acir_public_inputs_size)
 Create a valid honk proof and vk for a circuit with a single big add gate. Adds random public inputs to match num_public_inputs provided.
 
template<typename Builder >
bb::HonkProof create_mock_chonk_proof (const size_t acir_public_inputs_size=0)
 Create a mock Chonk proof which has the correct structure but is not necessarily valid.
 
template<typename Builder >
void create_multi_scalar_mul_constraint (Builder &builder, const MultiScalarMul &constraint_input)
 Create constraints for multi-scalar multiplication on the Grumpkin curve.
 
template void create_multi_scalar_mul_constraint< UltraCircuitBuilder > (UltraCircuitBuilder &builder, const MultiScalarMul &input)
 
template void create_multi_scalar_mul_constraint< MegaCircuitBuilder > (MegaCircuitBuilder &builder, const MultiScalarMul &input)
 
template<typename Builder >
void create_poseidon2_permutations_constraints (Builder &builder, const Poseidon2Constraint &constraint)
 
template void create_poseidon2_permutations_constraints< UltraCircuitBuilder > (UltraCircuitBuilder &builder, const Poseidon2Constraint &constraint)
 
template void create_poseidon2_permutations_constraints< MegaCircuitBuilder > (MegaCircuitBuilder &builder, const Poseidon2Constraint &constraint)
 
template<>
HonkRecursionConstraintsOutput< MegaCircuitBuildercreate_recursion_constraints (MegaCircuitBuilder &builder, GateCounter< MegaCircuitBuilder > &gate_counter, std::vector< size_t > &gates_per_opcode, const std::shared_ptr< IVCBase > &ivc_base, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &honk_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &avm_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &hn_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &chonk_recursion_data)
 
template<>
HonkRecursionConstraintsOutput< UltraCircuitBuildercreate_recursion_constraints (UltraCircuitBuilder &builder, GateCounter< UltraCircuitBuilder > &gate_counter, std::vector< size_t > &gates_per_opcode, const std::shared_ptr< IVCBase > &ivc_base, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &honk_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &avm_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &hn_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &chonk_recursion_data)
 
void process_hn_recursion_constraints (MegaCircuitBuilder &builder, GateCounter< MegaCircuitBuilder > &gate_counter, std::vector< size_t > &gates_per_opcode, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &hn_recursion_data, const std::shared_ptr< IVCBase > &ivc_base)
 Process HyperNova recursion constraints and complete kernel logic.
 
template<typename Builder >
HonkRecursionConstraintsOutput< Buildercreate_recursion_constraints (Builder &builder, GateCounter< Builder > &gate_counter, std::vector< size_t > &gates_per_opcode, const std::shared_ptr< IVCBase > &ivc_base, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &honk_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &avm_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &hn_recursion_data, const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &chonk_recursion_data)
 Single entrypoint to process recursion constraints.
 
template<typename Builder >
void create_sha256_compression_constraints (Builder &builder, const Sha256Compression &constraint)
 
template void create_sha256_compression_constraints< bb::UltraCircuitBuilder > (bb::UltraCircuitBuilder &builder, const Sha256Compression &constraint)
 
template void create_sha256_compression_constraints< bb::MegaCircuitBuilder > (bb::MegaCircuitBuilder &builder, const Sha256Compression &constraint)
 
Acir::FunctionInput witness_or_constant_to_function_input (const WitnessOrConstant< bb::fr > &input)
 Convert a WitnessOrConstant back to an Acir::FunctionInput.
 
Acir::FunctionInput witness_to_function_input (uint32_t witness_index)
 Convert a witness index to an Acir::FunctionInput (witness variant).
 
Acir::Expression witness_or_constant_to_expression (const WitnessOrConstant< bb::fr > &input)
 Convert a WitnessOrConstant to an Acir::Expression.
 
Acir::Expression access_type_to_expression (AccessType access_type)
 Convert an AccessType to an Acir::Expression representing the operation type.
 
Acir::MemOp mem_op_to_acir_mem_op (const MemOp &mem_op)
 Convert an acir_format::MemOp to an Acir::MemOp.
 
Acir::BlockType block_type_to_acir_block_type (BlockType type, CallDataType calldata_id)
 Convert an acir_format::BlockType to an Acir::BlockType.
 
std::vector< Acir::Opcodeblock_constraint_to_acir_opcodes (const BlockConstraint &constraint, uint32_t block_id=0)
 Convert a BlockConstraint to a vector of Acir::Opcodes.
 
void add_terms_to_expression (Acir::Expression &expr, const QuadConstraint &mul_quad)
 Add terms for a QuadConstraint to an Acir::Expression.
 
template<typename ConstraintType >
std::vector< Acir::Opcodeconstraint_to_acir_opcode (const ConstraintType &constraint)
 Convert a constraint to a vector of Acir::Opcodes.
 
Acir::Circuit build_acir_circuit (const std::vector< Acir::Opcode > &opcodes, uint32_t max_witness_index)
 Build an Acir::Circuit from opcodes and witness count.
 
template<typename ConstraintType >
AcirFormat constraint_to_acir_format (const ConstraintType &constraint, uint32_t varnum)
 Convert an AcirConstraint (single or vector) to AcirFormat by going through the full ACIR serde flow.
 
template<typename Builder >
std::vector< field_t< Builder > > fields_from_witnesses (Builder &builder, std::span< const uint32_t > witness_indices)
 ========== ACIR TO BARRETENBERG ========== ///
 
template<typename Builder >
byte_array< Builderfields_to_bytes (Builder &builder, std::vector< field_t< Builder > > &fields)
 Convert a vector of field_t elements to a byte_array enforcing each element to fit in one byte.
 
std::vector< uint32_t > add_public_inputs_to_proof (const std::vector< uint32_t > &proof_in, const std::vector< uint32_t > &public_inputs)
 Reconstruct a barretenberg style proof from an ACIR style proof + public inputs.
 
RecursionConstraint recursion_data_to_recursion_constraint (std::vector< bb::fr > &witness, const std::vector< bb::fr > &proof, const std::vector< bb::fr > &key, const bb::fr &key_hash, const bb::fr &predicate, const size_t num_public_inputs_to_extract, const uint32_t proof_type)
 ========== TESTING UTILITIES ========== ///
 
template<typename Builder >
void populate_fields (Builder &builder, const std::vector< field_t< Builder > > &fields, const std::vector< bb::fr > &values)
 ========== WRITE_VK UTILITIES ========== ///
 
template std::vector< field_t< UltraCircuitBuilder > > fields_from_witnesses< UltraCircuitBuilder > (UltraCircuitBuilder &, std::span< const uint32_t >)
 
template std::vector< field_t< MegaCircuitBuilder > > fields_from_witnesses< MegaCircuitBuilder > (MegaCircuitBuilder &, std::span< const uint32_t >)
 
template byte_array< UltraCircuitBuilderfields_to_bytes< UltraCircuitBuilder > (UltraCircuitBuilder &, std::vector< field_t< UltraCircuitBuilder > > &)
 
template byte_array< MegaCircuitBuilderfields_to_bytes< MegaCircuitBuilder > (MegaCircuitBuilder &, std::vector< field_t< MegaCircuitBuilder > > &)
 
template void populate_fields< UltraCircuitBuilder > (UltraCircuitBuilder &, const std::vector< field_t< UltraCircuitBuilder > > &, const std::vector< bb::fr > &)
 
template void populate_fields< MegaCircuitBuilder > (MegaCircuitBuilder &, const std::vector< field_t< MegaCircuitBuilder > > &, const std::vector< bb::fr > &)
 
template<typename T >
std::vector< uint32_t > add_to_witness_and_track_indices (std::vector< bb::fr > &witness, const T &input)
 Append values to a witness vector and track their indices.
 
uint32_t add_to_witness_and_track_indices (std::vector< bb::fr > &witness, const bb::fr &input)
 Add a single value to the witness vector and track its index.
 
template<typename T , size_t N>
std::array< uint32_t, N > add_to_witness_and_track_indices (std::vector< bb::fr > &witness, const T &input)
 Add values to the witness and track their indices, returning them as a fixed-size array.
 
template<typename Builder >
bb::stdlib::cycle_group< Builderto_grumpkin_point (const WitnessOrConstant< typename Builder::FF > &input_x, const WitnessOrConstant< typename Builder::FF > &input_y, const WitnessOrConstant< typename Builder::FF > &input_infinite, const bb::stdlib::bool_t< Builder > &predicate, Builder &builder)
 Convert inputs representing a Grumpkin point into a cycle_group element.
 
template bb::stdlib::cycle_group< UltraCircuitBuilderto_grumpkin_point (const WitnessOrConstant< UltraCircuitBuilder::FF > &input_x, const WitnessOrConstant< UltraCircuitBuilder::FF > &input_y, const WitnessOrConstant< UltraCircuitBuilder::FF > &input_infinite, const bb::stdlib::bool_t< UltraCircuitBuilder > &predicate, UltraCircuitBuilder &builder)
 
template bb::stdlib::cycle_group< MegaCircuitBuilderto_grumpkin_point (const WitnessOrConstant< MegaCircuitBuilder::FF > &input_x, const WitnessOrConstant< MegaCircuitBuilder::FF > &input_y, const WitnessOrConstant< MegaCircuitBuilder::FF > &input_infinite, const bb::stdlib::bool_t< MegaCircuitBuilder > &predicate, MegaCircuitBuilder &builder)
 
template<typename Builder >
bb::stdlib::cycle_group< Builder >::cycle_scalar to_grumpkin_scalar (const WitnessOrConstant< typename Builder::FF > &scalar_lo, const WitnessOrConstant< typename Builder::FF > &scalar_hi, const bb::stdlib::bool_t< Builder > &predicate, Builder &builder)
 Convert inputs representing a Grumpkin scalar into a cycle_scalar element.
 
template bb::stdlib::cycle_group< UltraCircuitBuilder >::cycle_scalar to_grumpkin_scalar (const WitnessOrConstant< UltraCircuitBuilder::FF > &scalar_lo, const WitnessOrConstant< UltraCircuitBuilder::FF > &scalar_hi, const bb::stdlib::bool_t< UltraCircuitBuilder > &predicate, UltraCircuitBuilder &builder)
 
template bb::stdlib::cycle_group< MegaCircuitBuilder >::cycle_scalar to_grumpkin_scalar (const WitnessOrConstant< MegaCircuitBuilder::FF > &scalar_lo, const WitnessOrConstant< MegaCircuitBuilder::FF > &scalar_hi, const bb::stdlib::bool_t< MegaCircuitBuilder > &predicate, MegaCircuitBuilder &builder)
 
template<typename Builder >
bb::stdlib::field_t< Builderto_field_ct (const WitnessOrConstant< typename Builder::FF > &input, Builder &builder)
 
HonkRecursionConstraintOutput< Buildercreate_avm2_recursion_constraints_goblin (Builder &builder, const RecursionConstraint &input)
 Add constraints associated with recursive verification of an AVM2 proof using Goblin.
 

Variables

template<typename Builder >
constexpr size_t MEGA_OFFSET = IsMegaBuilder<Builder> ? 3 : 0
 
constexpr size_t ZERO_GATE = 1
 
template<typename Builder >
constexpr size_t ARITHMETIC_TRIPLE = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t QUAD = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BIG_QUAD = 2 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t LOGIC_XOR_32 = 6 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t LOGIC_AND_32 = 6 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t RANGE_32 = 2744 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t SHA256_COMPRESSION = 6679 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t AES128_ENCRYPTION = 1432 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t ECDSA_SECP256K1 = 41994 + ZERO_GATE
 
template<typename Builder >
constexpr size_t ECDSA_SECP256R1 = 72209 + ZERO_GATE + (IsMegaBuilder<Builder> ? 2 : 0)
 
template<typename Builder >
constexpr size_t BLAKE2S = 2952 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLAKE3 = 2158 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t KECCAK_PERMUTATION = 17387 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t POSEIDON2_PERMUTATION = 73 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t MULTI_SCALAR_MUL = 3550 + ZERO_GATE
 
template<typename Builder >
constexpr size_t EC_ADD = 66 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLOCK_ROM_READ = 9 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLOCK_RAM_READ = 18 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLOCK_RAM_WRITE = 18 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLOCK_CALLDATA = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t BLOCK_RETURNDATA = 23 + ZERO_GATE + MEGA_OFFSET<Builder>
 
template<typename Builder >
constexpr size_t ASSERT_EQUALITY = ZERO_GATE + MEGA_OFFSET<Builder>
 
constexpr size_t ROOT_ROLLUP_GATE_COUNT = 12986977
 
constexpr size_t CHONK_RECURSION_GATES = 2368439
 
constexpr size_t MSM_ROWS_OFFSET = 2
 
constexpr size_t INIT_KERNEL_GATE_COUNT = 26036
 
constexpr size_t INIT_KERNEL_ECC_ROWS = 881 + MSM_ROWS_OFFSET
 
constexpr size_t INIT_KERNEL_ULTRA_OPS = 89
 
constexpr size_t INNER_KERNEL_GATE_COUNT_HN = 61018
 
constexpr size_t INNER_KERNEL_ECC_ROWS = 1700 + MSM_ROWS_OFFSET
 
constexpr size_t INNER_KERNEL_ULTRA_OPS = 179
 
constexpr size_t TAIL_KERNEL_GATE_COUNT = 33966
 
constexpr size_t TAIL_KERNEL_ECC_ROWS = 914 + MSM_ROWS_OFFSET
 
constexpr size_t TAIL_KERNEL_ULTRA_OPS = 96
 
constexpr size_t HIDING_KERNEL_GATE_COUNT = 37106
 
constexpr size_t HIDING_KERNEL_ECC_ROWS = 1341 + MSM_ROWS_OFFSET
 
constexpr size_t HIDING_KERNEL_ULTRA_OPS = 124
 
constexpr size_t ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 214950
 
constexpr size_t GOBLIN_AVM_GATE_COUNT = 3325906
 
constexpr size_t FINALIZED_GOBLIN_AVM_GATE_COUNT = 3325922
 
template<typename T >
constexpr bool is_std_vector_v = is_std_vector<T>::value
 

Typedef Documentation

◆ HonkRecursionConstraintOutput

Alias for the result of recursively verifying a proof.

Definition at line 25 of file recursion_constraint_output.hpp.

◆ QuadConstraint

Standard UltraHonk arithmetic constraint of width 4.

Definition at line 24 of file arithmetic_constraints.hpp.

◆ WitnessVector

using acir_format::WitnessVector = typedef std::vector<bb::fr>

Definition at line 35 of file acir_format.hpp.

Enumeration Type Documentation

◆ AccessType

Enumerator
Read 
Write 

Definition at line 15 of file block_constraint.hpp.

◆ BlockType

Enumerator
ROM 
RAM 
CallData 
ReturnData 

Definition at line 36 of file block_constraint.hpp.

◆ CallDataType

Enumerator
None 
Primary 
Secondary 

Definition at line 20 of file block_constraint.hpp.

◆ PredicateTestCase

enum class acir_format::PredicateTestCase : uint8_t
strong

NOTE: A predicate can either be a constant or a witness. When it is a constant, the code doesn't take into account the value held in the predicate struct, it always behaves as if the predicate is a constant holding the value true. Thus, there are only three cases we need to test.

Enumerator
ConstantTrue 
WitnessTrue 
WitnessFalse 

Definition at line 19 of file test_class_predicate.hpp.

◆ PROOF_TYPE

enum acir_format::PROOF_TYPE : uint8_t
Enumerator
HONK 
OINK 
HN 
AVM 
ROLLUP_HONK 
ROOT_ROLLUP_HONK 
HONK_ZK 
HN_FINAL 
HN_TAIL 
CHONK 

Definition at line 33 of file recursion_constraint.hpp.

Function Documentation

◆ access_type_to_expression()

Acir::Expression acir_format::access_type_to_expression ( AccessType  access_type)
inline

Convert an AccessType to an Acir::Expression representing the operation type.

Read operations are represented by Expression with constant 0, Write operations are represented by Expression with constant 1.

Definition at line 75 of file test_class.hpp.

◆ add_blackbox_func_call_to_acir_format()

void acir_format::add_blackbox_func_call_to_acir_format ( Acir::Opcode::BlackBoxFuncCall const &  arg,
AcirFormat af,
size_t  opcode_index 
)

Definition at line 603 of file acir_to_constraint_buf.cpp.

◆ add_memory_op_to_block_constraint()

void acir_format::add_memory_op_to_block_constraint ( Acir::Opcode::MemoryOp const &  mem_op,
BlockConstraint block 
)

Process memory operation, either read or write, and update the BlockConstraint type accordingly.

Definition at line 812 of file acir_to_constraint_buf.cpp.

◆ add_public_inputs_to_proof()

std::vector< uint32_t > acir_format::add_public_inputs_to_proof ( const std::vector< uint32_t > &  proof_in,
const std::vector< uint32_t > &  public_inputs 
)

Reconstruct a barretenberg style proof from an ACIR style proof + public inputs.

In barretenberg, proofs start with the public inputs. ACIR represents proofs in the format (public_inputs, proof_without_public_inputs). This function stitches together the indices of the public inputs with those of the proof to transform ACIR-style proofs into barretenberg-style proofs.

Parameters
proof_inA proof stripped of its public inputs
public_inputsThe public inputs to be reinserted into the proof
Returns
std::vector<uint32_t> The witness indices of the complete proof

Definition at line 40 of file utils.cpp.

◆ add_terms_to_expression()

void acir_format::add_terms_to_expression ( Acir::Expression expr,
const QuadConstraint mul_quad 
)
inline

Add terms for a QuadConstraint to an Acir::Expression.

Definition at line 164 of file test_class.hpp.

◆ add_to_witness_and_track_indices() [1/3]

uint32_t acir_format::add_to_witness_and_track_indices ( std::vector< bb::fr > &  witness,
const bb::fr input 
)
inline

Add a single value to the witness vector and track its index.

Definition at line 122 of file utils.hpp.

◆ add_to_witness_and_track_indices() [2/3]

template<typename T >
std::vector< uint32_t > acir_format::add_to_witness_and_track_indices ( std::vector< bb::fr > &  witness,
const T &  input 
)

Append values to a witness vector and track their indices.

This function is useful in testing situations, when we need to add witnesses to a builder.

Template Parameters
TThe input type
Parameters
witnessThe witness vector to append to
inputThe input value(s) - either a span of values or a single special type
Returns
std::vector<uint32_t> The witness indices of the appended values

Definition at line 90 of file utils.hpp.

◆ add_to_witness_and_track_indices() [3/3]

template<typename T , size_t N>
std::array< uint32_t, N > acir_format::add_to_witness_and_track_indices ( std::vector< bb::fr > &  witness,
const T &  input 
)

Add values to the witness and track their indices, returning them as a fixed-size array.

Definition at line 134 of file utils.hpp.

◆ and_gate()

void acir_format::and_gate ( UltraCircuitBuilder builder,
WitnessOrConstant< fr a,
WitnessOrConstant< fr b,
uint32_t  result 
)

◆ assert_zero_to_quad_constraints()

void acir_format::assert_zero_to_quad_constraints ( Acir::Opcode::AssertZero const &  arg,
AcirFormat af,
size_t  opcode_index 
)

Single entrypoint for processing arithmetic (AssertZero) opcodes.

This function processes an Acir::Opcode::AssertZero by converting it into one more more mul_quad_ gates. The function asserts that all the gates produced are non-zero and that the number of gates produced is consistent with expectation (one gate if the opcode is meant to fit in one gate, more than one gate if the opcode is not meant to fit in one gate).

Definition at line 571 of file acir_to_constraint_buf.cpp.

◆ block_constraint_to_acir_opcodes()

std::vector< Acir::Opcode > acir_format::block_constraint_to_acir_opcodes ( const BlockConstraint constraint,
uint32_t  block_id = 0 
)
inline

Convert a BlockConstraint to a vector of Acir::Opcodes.

A BlockConstraint generates:

  1. One MemoryInit opcode containing the initial values and block type
  2. Multiple MemoryOp opcodes, one for each memory operation in the trace
Parameters
constraintThe BlockConstraint to convert
block_idThe block ID to use for the memory operations
Returns
std::vector<Acir::Opcode> The corresponding ACIR opcodes

Definition at line 129 of file test_class.hpp.

◆ block_type_to_acir_block_type()

Acir::BlockType acir_format::block_type_to_acir_block_type ( BlockType  type,
CallDataType  calldata_id 
)
inline

Convert an acir_format::BlockType to an Acir::BlockType.

Definition at line 100 of file test_class.hpp.

◆ build_acir_circuit()

Acir::Circuit acir_format::build_acir_circuit ( const std::vector< Acir::Opcode > &  opcodes,
uint32_t  max_witness_index 
)
inline

Build an Acir::Circuit from opcodes and witness count.

Parameters
opcodesThe ACIR opcodes to include in the circuit
max_witness_indexThe maximum witness index in the circuit
Returns
Acir::Circuit The constructed circuit
Note
max_witness_index is not used by circuit_serde_to_acir_format, but we pass it for completeness

Definition at line 478 of file test_class.hpp.

◆ build_constraints()

template<typename Builder >
void acir_format::build_constraints ( Builder builder,
AcirFormat constraints,
const ProgramMetadata metadata 
)

Add to the builder the constraints contained in an AcirFormat instance.

Definition at line 35 of file acir_format.cpp.

◆ build_constraints< MegaCircuitBuilder >()

◆ build_constraints< UltraCircuitBuilder >()

◆ check_mul_add_gate()

template<typename Builder >
void acir_format::check_mul_add_gate ( Builder builder,
const QuadConstraint mul_quad,
const typename Builder::FF  next_wire_w4 
)

Check if a mul add gate is valid.

Definition at line 32 of file arithmetic_constraints.cpp.

◆ check_mul_add_gate< MegaCircuitBuilder >()

◆ check_mul_add_gate< UltraCircuitBuilder >()

◆ circuit_buf_to_acir_format()

AcirFormat acir_format::circuit_buf_to_acir_format ( std::vector< uint8_t > &&  buf)

Convert a buffer representing a circuit into Barretenberg's internal AcirFormat representation.

Definition at line 386 of file acir_to_constraint_buf.cpp.

◆ circuit_serde_to_acir_format()

AcirFormat acir_format::circuit_serde_to_acir_format ( Acir::Circuit const &  circuit)

Convert an Acir::Circuit into an AcirFormat by processing all the opcodes.

Definition at line 322 of file acir_to_constraint_buf.cpp.

◆ constraint_to_acir_format()

template<typename ConstraintType >
AcirFormat acir_format::constraint_to_acir_format ( const ConstraintType &  constraint,
uint32_t  varnum 
)

Convert an AcirConstraint (single or vector) to AcirFormat by going through the full ACIR serde flow.

This function:

  1. Converts the constraint(s) to Acir::Opcodes
  2. Builds an Acir::Circuit with those opcodes
  3. Passes the circuit through circuit_serde_to_acir_format

When ConstraintType is a std::vector, iterates over all constraints and collects their opcodes.

Parameters
constraintThe constraint (or vector of constraints) to convert
varnumThe number of witnesses
Returns
AcirFormat The resulting AcirFormat

Definition at line 506 of file test_class.hpp.

◆ constraint_to_acir_opcode()

template<typename ConstraintType >
std::vector< Acir::Opcode > acir_format::constraint_to_acir_opcode ( const ConstraintType &  constraint)

Convert a constraint to a vector of Acir::Opcodes.

This function converts barretenberg constraint types back to their corresponding Acir::Opcode representation. This enables testing the full ACIR flow by going through circuit_serde_to_acir_format. Most constraint types produce a single opcode, but BlockConstraint produces multiple opcodes (one MemoryInit and multiple MemoryOp opcodes).

Parameters
constraintThe constraint to convert
Returns
std::vector<Acir::Opcode> The corresponding ACIR opcodes

Definition at line 204 of file test_class.hpp.

◆ construct_arbitrary_valid_honk_proof_and_vk() [1/2]

template<typename Flavor >
std::pair< HonkProof, std::shared_ptr< typename Flavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk ( size_t  acir_public_inputs_size)

Create a valid honk proof and vk for a circuit with a single big add gate. Adds random public inputs to match num_public_inputs provided.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints
make_proof_invalidIf true, the proof is an invalid proof

Definition at line 233 of file mock_verifier_inputs.cpp.

◆ construct_arbitrary_valid_honk_proof_and_vk() [2/2]

template<typename Flavor >
std::pair< bb::HonkProof, std::shared_ptr< typename Flavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk ( size_t  acir_public_inputs_size)

Create a valid honk proof and vk for a circuit with a single big add gate. Adds random public inputs to match num_public_inputs provided.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints
make_proof_invalidIf true, the proof is an invalid proof

Definition at line 233 of file mock_verifier_inputs.cpp.

◆ construct_arbitrary_valid_honk_proof_and_vk< UltraFlavor >()

◆ construct_arbitrary_valid_honk_proof_and_vk< UltraRollupFlavor >()

template std::pair< HonkProof, std::shared_ptr< UltraRollupFlavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk< UltraRollupFlavor > ( const size_t  )

◆ construct_arbitrary_valid_honk_proof_and_vk< UltraZKFlavor >()

template std::pair< HonkProof, std::shared_ptr< UltraZKFlavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk< UltraZKFlavor > ( const size_t  )

◆ create_aes128_constraints()

template<typename Builder >
void acir_format::create_aes128_constraints ( Builder builder,
const AES128Constraint constraint 
)

Definition at line 18 of file aes128_constraint.cpp.

◆ create_aes128_constraints< MegaCircuitBuilder >()

template void acir_format::create_aes128_constraints< MegaCircuitBuilder > ( MegaCircuitBuilder builder,
const AES128Constraint constraint 
)

◆ create_aes128_constraints< UltraCircuitBuilder >()

template void acir_format::create_aes128_constraints< UltraCircuitBuilder > ( UltraCircuitBuilder builder,
const AES128Constraint constraint 
)

◆ create_avm2_recursion_constraints_goblin() [1/2]

HonkRecursionConstraintOutput< UltraCircuitBuilder > acir_format::create_avm2_recursion_constraints_goblin ( bb::UltraCircuitBuilder builder,
const RecursionConstraint input 
)

Stub implementation for AVM2 recursion constraints.

This function is linked when building bb-no-avm. It throws a runtime error if AVM recursion is attempted. Users should use the full 'bb' binary for AVM support.

Definition at line 12 of file avm2_recursion_constraint.cpp.

◆ create_avm2_recursion_constraints_goblin() [2/2]

HonkRecursionConstraintOutput< Builder > acir_format::create_avm2_recursion_constraints_goblin ( Builder builder,
const RecursionConstraint input 
)

Add constraints associated with recursive verification of an AVM2 proof using Goblin.

Parameters
builder
input
input_points_accumulator_indices
has_valid_witness_assignments
Returns
HonkRecursionConstraintOutput {pairing agg object, ipa claim, ipa proof}

Definition at line 118 of file avm2_recursion_constraint.cpp.

◆ create_big_quad_constraint()

template<typename Builder >
void acir_format::create_big_quad_constraint ( Builder builder,
BigQuadConstraint big_constraint 
)

Definition at line 58 of file arithmetic_constraints.cpp.

◆ create_big_quad_constraint< MegaCircuitBuilder >()

◆ create_big_quad_constraint< UltraCircuitBuilder >()

◆ create_blake2s_constraints()

template<typename Builder >
void acir_format::create_blake2s_constraints ( Builder builder,
const Blake2sConstraint constraint 
)

Definition at line 16 of file blake2s_constraint.cpp.

◆ create_blake2s_constraints< MegaCircuitBuilder >()

template void acir_format::create_blake2s_constraints< MegaCircuitBuilder > ( MegaCircuitBuilder builder,
const Blake2sConstraint constraint 
)

◆ create_blake2s_constraints< UltraCircuitBuilder >()

◆ create_blake3_constraints()

template<typename Builder >
void acir_format::create_blake3_constraints ( Builder builder,
const Blake3Constraint constraint 
)

Definition at line 14 of file blake3_constraint.cpp.

◆ create_blake3_constraints< bb::MegaCircuitBuilder >()

◆ create_blake3_constraints< bb::UltraCircuitBuilder >()

◆ create_block_constraints() [1/3]

template<typename Builder >
void acir_format::create_block_constraints ( Builder builder,
const BlockConstraint constraint 
)

◆ create_block_constraints() [2/3]

template<>
void acir_format::create_block_constraints ( MegaCircuitBuilder builder,
const BlockConstraint constraint 
)

Create block constraints; Specialization for Mega arithmetization.

Definition at line 58 of file block_constraint.cpp.

◆ create_block_constraints() [3/3]

template<>
void acir_format::create_block_constraints ( UltraCircuitBuilder builder,
const BlockConstraint constraint 
)

Create block constraints; Specialization for Ultra arithmetization.

Ultra does not support DataBus operations

Definition at line 23 of file block_constraint.cpp.

◆ create_chonk_recursion_constraints()

HonkRecursionConstraintOutput< bb::UltraCircuitBuilder > acir_format::create_chonk_recursion_constraints ( bb::UltraCircuitBuilder builder,
const RecursionConstraint input 
)

Add constraints associated with recursive verification of a Chonk proof.

Parameters
builder
input
input_points_accumulator_indices
has_valid_witness_assignments
Returns
HonkRecursionConstraintOutput {pairing agg object, ipa claim, ipa proof}

Definition at line 70 of file chonk_recursion_constraints.cpp.

◆ create_circuit() [1/3]

template<>
UltraCircuitBuilder acir_format::create_circuit ( AcirProgram program,
const ProgramMetadata metadata 
)

Specialization for creating an Ultra circuit from an acir program.

Parameters
programconstraints and optionally a witness
metadataadditional data needed to construct the circuit

Definition at line 190 of file acir_format.cpp.

◆ create_circuit() [2/3]

template<>
MegaCircuitBuilder acir_format::create_circuit ( AcirProgram program,
const ProgramMetadata metadata 
)

Specialization for creating a Mega circuit from an acir program.

Parameters
programconstraints and optionally a witness
metadataadditional data needed to construct the circuit

Definition at line 222 of file acir_format.cpp.

◆ create_circuit() [3/3]

template<typename Builder >
Builder acir_format::create_circuit ( AcirProgram program,
const ProgramMetadata metadata = ProgramMetadata{} 
)

Create a circuit out of an ACIR program and metadata.

This function instantiates the builder, adds the required witnesses to it, and then calls build_constraints to add the required constraints to the builder.

◆ create_dummy_ecdsa_constraint()

template<typename Curve >
void acir_format::create_dummy_ecdsa_constraint ( typename Curve::Builder &  builder,
const std::vector< stdlib::field_t< typename Curve::Builder > > &  hashed_message_fields,
const std::vector< stdlib::field_t< typename Curve::Builder > > &  r_fields,
const std::vector< stdlib::field_t< typename Curve::Builder > > &  s_fields,
const std::vector< stdlib::field_t< typename Curve::Builder > > &  pub_x_fields,
const std::vector< stdlib::field_t< typename Curve::Builder > > &  pub_y_fields,
const stdlib::field_t< typename Curve::Builder > &  result_field 
)

Generate dummy ECDSA constraints when the builder doesn't have witnesses.

To avoid firing asserts, the public key must be a point on the curve

Definition at line 127 of file ecdsa_constraints.cpp.

◆ create_dummy_ecdsa_constraint< stdlib::secp256k1< UltraCircuitBuilder > >()

template void acir_format::create_dummy_ecdsa_constraint< stdlib::secp256k1< UltraCircuitBuilder > > ( UltraCircuitBuilder ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const stdlib::field_t< UltraCircuitBuilder > &   
)

◆ create_dummy_ecdsa_constraint< stdlib::secp256r1< UltraCircuitBuilder > >()

template void acir_format::create_dummy_ecdsa_constraint< stdlib::secp256r1< UltraCircuitBuilder > > ( UltraCircuitBuilder ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  ,
const stdlib::field_t< UltraCircuitBuilder > &   
)

◆ create_dummy_vkey_and_proof()

void acir_format::create_dummy_vkey_and_proof ( UltraCircuitBuilder builder,
size_t  proof_size,
size_t  public_inputs_size,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  key_fields,
const std::vector< stdlib::field_t< UltraCircuitBuilder > > &  proof_fields 
)

Creates a dummy vkey and proof object.

Populates the key and proof vectors with dummy values in the write_vk case when we don't have a valid witness. The bulk of the logic is setting up certain values correctly like the circuit size, number of public inputs, aggregation object, and commitments.

Parameters
builder
proof_sizeSize of proof with NO public inputs
public_inputs_sizeTotal size of public inputs including aggregation object
key_fields
proof_fields

Definition at line 28 of file chonk_recursion_constraints.cpp.

◆ create_ec_add_constraint()

template<typename Builder >
void acir_format::create_ec_add_constraint ( Builder builder,
const EcAdd input 
)

Create constraints for addition of two points on the Grumpkin curve.

We proceed in 2 steps:

  1. We reconstruct the Grumpkin points input1, input2 and input_result for which we must check input1 + input2 = input_result. The reconstruction handles all cases: has_valid_witness_assignments equal to false (write_vk scenario) and a witness predicate. If:
    • has_valid_witness_assignments is false, then we set input1 = input2 = input_result equal to the generator of Grumpkin
    • the predicate is witness false, we set input1 and input2 to be the generator of Grumpkin.
  2. We compute input1 + input2 and check that it agrees with input_result.
Note
We do not need to enforce in-circuit that input_result is on the curve because we check that input_result is equal to result, which we know is on the curve as it is the sum of two points on the curve. In the case of predicate equal to witness false, the constraint is supposed to be inactive, so we even if input_result is not checked to be on the curve in this case, it is OK.
Template Parameters
Builder
Parameters
builder
input
has_valid_witness_assignments

Definition at line 38 of file ec_operations.cpp.

◆ create_ec_add_constraint< bb::MegaCircuitBuilder >()

◆ create_ec_add_constraint< bb::UltraCircuitBuilder >()

◆ create_ecdsa_verify_constraints()

template<typename Curve >
void acir_format::create_ecdsa_verify_constraints ( typename Curve::Builder &  builder,
const EcdsaConstraint input 
)

Create constraints to verify an ECDSA signature.

Given an ECDSA constraint system, add to the builder constraints that verify the ECDSA signature. We perform the following operations:

  1. Reconstruct byte arrays from builder variables (we enforce that each variable fits in one byte and stack them in a vector) and the boolean result from the corresponding builder variable
  2. Reconstruct the public key from the byte representations (big-endian, 32-byte numbers) of the \(x\) and \(y\) coordinates.
  3. Conditionally select the public key, the signature, and the hash of the message when the predicate is witness false. This ensures that the circuit is satisfied when the predicate is false. We set:
    • r = s = H(m) = 1 (the hash is set to 1 to avoid failures in the byte_array constructor)
    • The public key to 2 times the generator of the curve (this is to avoid problems with lookup tables in secp265r1)
  4. Verify the signature against the public key and the hash of the message. We return a bool_t bearing witness to whether the signature verification was successfull or not.
  5. Enforce that the result of the signature verification matches the expected result.
Template Parameters
Curve
Parameters
builder
input
has_valid_witness_assignments

Definition at line 41 of file ecdsa_constraints.cpp.

◆ create_ecdsa_verify_constraints< stdlib::secp256k1< MegaCircuitBuilder > >()

◆ create_ecdsa_verify_constraints< stdlib::secp256k1< UltraCircuitBuilder > >()

◆ create_ecdsa_verify_constraints< stdlib::secp256r1< MegaCircuitBuilder > >()

◆ create_ecdsa_verify_constraints< stdlib::secp256r1< UltraCircuitBuilder > >()

◆ create_honk_recursion_constraints()

template<typename Flavor >
requires (IsRecursiveFlavor<Flavor> && IsUltraHonk<typename Flavor::NativeFlavor>)
HonkRecursionConstraintOutput< typename Flavor::CircuitBuilder > acir_format::create_honk_recursion_constraints ( typename Flavor::CircuitBuilder builder,
const RecursionConstraint input 
)

Add to the builder the constraints to recursively verify a Honk proof.

Template Parameters
FlavorThe flavor with which the proof was generated.

A recursion constraint contains the data representing a Honk proof (verification key, verification key hash, proof, public inputs), the proof type, and a predicate indicating whether the constraint should be active. If the predicate is a witness holding the value false, then the constraint should not fail even if the proof is invalid. The function works as follows:

  1. Given the witness indices contained in input, reconstruct in-circuit representations of the data required to recursively verify a proof.
  2. If we are in write_vk scenario, set the witness values in the builder to be valid elements (e.g. points on BN254) to avoid failures due to assertions present in the code. Not that the values will not necessarily represent a valid proof.
  3. If predicate is witness false, conditionally assign the values so that the recursive verifications succeeds.
  4. Perform the recursive verification.
Note
To avoid perfoming pairings in-circuit, as we do across the whole codebase, the recursive verification returns a PairingPoints object. The recursive verification was successful if the object passes the check: \((P_1, P_2)\) must satisfy \(e(P_1, [1]) e(P_2, [x]) = 1\), where \(x\) is the randomness used to generate the SRS.
If the Flavor is of Rollup type, then the recursive verification returns also an IPA claim whose validity must be verified to complete the recursive verification of the proof.

Definition at line 30 of file honk_recursion_constraint.cpp.

◆ create_keccak_permutations_constraints()

template<typename Builder >
void acir_format::create_keccak_permutations_constraints ( Builder builder,
const Keccakf1600 constraint 
)

Definition at line 13 of file keccak_constraint.cpp.

◆ create_keccak_permutations_constraints< bb::MegaCircuitBuilder >()

◆ create_keccak_permutations_constraints< bb::UltraCircuitBuilder >()

◆ create_logic_gate() [1/2]

template<typename Builder >
void acir_format::create_logic_gate ( Builder builder,
const WitnessOrConstant< bb::fr a,
const WitnessOrConstant< bb::fr b,
const uint32_t  result,
const size_t  num_bits,
const bool  is_xor_gate 
)

Definition at line 13 of file logic_constraint.cpp.

◆ create_logic_gate() [2/2]

template<typename Builder >
void acir_format::create_logic_gate ( Builder builder,
WitnessOrConstant< fr a,
WitnessOrConstant< fr b,
uint32_t  result,
std::size_t  num_bits,
bool  is_xor_gate 
)

◆ create_logic_gate< bb::MegaCircuitBuilder >()

template void acir_format::create_logic_gate< bb::MegaCircuitBuilder > ( bb::MegaCircuitBuilder builder,
const WitnessOrConstant< bb::fr a,
const WitnessOrConstant< bb::fr b,
const uint32_t  result,
const size_t  num_bits,
const bool  is_xor_gate 
)

◆ create_logic_gate< bb::UltraCircuitBuilder >()

template void acir_format::create_logic_gate< bb::UltraCircuitBuilder > ( bb::UltraCircuitBuilder builder,
const WitnessOrConstant< bb::fr a,
const WitnessOrConstant< bb::fr b,
const uint32_t  result,
const size_t  num_bits,
const bool  is_xor_gate 
)

◆ create_mock_chonk_from_constraints()

std::shared_ptr< Chonk > acir_format::create_mock_chonk_from_constraints ( const std::vector< RecursionConstraint > &  constraints)

Create an IVC object with mocked state corresponding to a set of IVC recursion constraints.

Construction of a kernel circuit requires two inputs: kernel prgram acir constraints and an IVC instance containing state needed to complete the kernel logic, e.g. proofs for input to recursive verifiers. To construct verification keys for kernel circuits without running a full IVC, we mock the IVC state corresponding to a provided set of IVC recurson constraints. For example, if the constraints contain a single HN recursive verification, we initialize an IVC with mocked data for the verifier accumulator, the folding proof, the circuit verification key, and a merge proof.

Note
There are only three valid combinations of IVC recursion constraints for a kernel program. See below for details.
Parameters
constraintsIVC recursion constraints from a kernel circuit
Returns
Chonk

Definition at line 38 of file hypernova_recursion_constraint.cpp.

◆ create_mock_chonk_proof() [1/2]

template<typename Builder >
HonkProof acir_format::create_mock_chonk_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock Chonk proof which has the correct structure but is not necessarily valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 445 of file mock_verifier_inputs.cpp.

◆ create_mock_chonk_proof() [2/2]

template<typename Builder >
bb::HonkProof acir_format::create_mock_chonk_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock Chonk proof which has the correct structure but is not necessarily valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 445 of file mock_verifier_inputs.cpp.

◆ create_mock_chonk_proof< MegaCircuitBuilder >()

◆ create_mock_chonk_proof< UltraCircuitBuilder >()

◆ create_mock_decider_proof() [1/2]

template<typename Flavor >
HonkProof acir_format::create_mock_decider_proof ( )

Create a mock decider proof that has the correct structure but is not in general valid.

Definition at line 152 of file mock_verifier_inputs.cpp.

◆ create_mock_decider_proof() [2/2]

template<typename Flavor >
bb::HonkProof acir_format::create_mock_decider_proof ( )

Create a mock decider proof that has the correct structure but is not in general valid.

Definition at line 152 of file mock_verifier_inputs.cpp.

◆ create_mock_decider_proof< MegaFlavor >()

◆ create_mock_decider_proof< TranslatorFlavor >()

◆ create_mock_decider_proof< UltraFlavor >()

◆ create_mock_decider_proof< UltraRollupFlavor >()

◆ create_mock_decider_proof< UltraZKFlavor >()

◆ create_mock_eccvm_proof()

bb::HonkProof acir_format::create_mock_eccvm_proof ( )

Create a mock pre-ipa proof which has the correct structure but is not necessarily valid.

An ECCVM proof is made of a pre-ipa proof and an ipa-proof. Here we mock the pre-ipa part.

Returns
HonkProof

An ECCVM proof is made of a pre-ipa proof and an ipa-proof. Here we mock the pre-ipa part.

Definition at line 313 of file mock_verifier_inputs.cpp.

◆ create_mock_honk_proof() [1/2]

template<typename Flavor , class PublicInputs >
HonkProof acir_format::create_mock_honk_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock honk proof that has the correct structure but is not in general valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 215 of file mock_verifier_inputs.cpp.

◆ create_mock_honk_proof() [2/2]

template<typename Flavor , class PublicInputs >
bb::HonkProof acir_format::create_mock_honk_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock honk proof that has the correct structure but is not in general valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 215 of file mock_verifier_inputs.cpp.

◆ create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::AppIO >()

◆ create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > >()

◆ create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::KernelIO >()

◆ create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

◆ create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

◆ create_mock_honk_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO >()

◆ create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

◆ create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

◆ create_mock_honk_vk()

template<typename Flavor , class PublicInputs >
std::shared_ptr< typename Flavor::VerificationKey > acir_format::create_mock_honk_vk ( const size_t  dyadic_size,
const size_t  pub_inputs_offset,
const size_t  acir_public_inputs_size = 0 
)

Create a mock VK that has the correct structure.

Parameters
dyadic_sizeDyadic size of the circuit for which we generate a vk
pub_inputs_offestIndicating whether the circuit has a first zero row
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 463 of file mock_verifier_inputs.cpp.

◆ create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::AppIO >()

template std::shared_ptr< MegaFlavor::VerificationKey > acir_format::create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::AppIO > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > >()

template std::shared_ptr< MegaFlavor::VerificationKey > acir_format::create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::KernelIO >()

template std::shared_ptr< MegaFlavor::VerificationKey > acir_format::create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::KernelIO > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< MegaZKFlavor, stdlib::recursion::honk::HidingKernelIO< UltraCircuitBuilder > >()

template std::shared_ptr< MegaZKFlavor::VerificationKey > acir_format::create_mock_honk_vk< MegaZKFlavor, stdlib::recursion::honk::HidingKernelIO< UltraCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

template std::shared_ptr< UltraFlavor::VerificationKey > acir_format::create_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

template std::shared_ptr< UltraFlavor::VerificationKey > acir_format::create_mock_honk_vk< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< UltraRollupFlavor, stdlib::recursion::honk::RollupIO >()

template std::shared_ptr< UltraRollupFlavor::VerificationKey > acir_format::create_mock_honk_vk< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

template std::shared_ptr< UltraZKFlavor::VerificationKey > acir_format::create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

template std::shared_ptr< UltraZKFlavor::VerificationKey > acir_format::create_mock_honk_vk< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > ( const size_t  ,
const size_t  ,
const size_t   
)

◆ create_mock_hyper_nova_proof() [1/2]

template<typename Flavor , class PublicInputs >
HonkProof acir_format::create_mock_hyper_nova_proof ( bool  include_fold = false)

Create a mock Hypernova proof that has the correct structure but is not in general valid.

Parameters
include_foldIf true, the proof contains a mock multilinear batching sumcheck proof

Definition at line 99 of file mock_verifier_inputs.cpp.

◆ create_mock_hyper_nova_proof() [2/2]

template<typename Flavor , class PublicInputs >
bb::HonkProof acir_format::create_mock_hyper_nova_proof ( bool  include_fold = false)

Create a mock Hypernova proof that has the correct structure but is not in general valid.

Parameters
include_foldIf true, the proof contains a mock multilinear batching sumcheck proof

Definition at line 99 of file mock_verifier_inputs.cpp.

◆ create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::AppIO >()

◆ create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::KernelIO >()

◆ create_mock_ipa_proof()

bb::HonkProof acir_format::create_mock_ipa_proof ( )

Create a mock ipa proof which has the correct structure but is not necessarily valid.

An ECCVM proof is made of a pre-ipa proof and an ipa-proof. Here we mock the ipa part.

Definition at line 405 of file mock_verifier_inputs.cpp.

◆ create_mock_merge_proof()

bb::Goblin::MergeProof acir_format::create_mock_merge_proof ( )

Create a mock merge proof which has the correct structure but is not necessarily valid.

Definition at line 279 of file mock_verifier_inputs.cpp.

◆ create_mock_multilinear_batch_proof()

bb::HonkProof acir_format::create_mock_multilinear_batch_proof ( )

Create a mock multilinear batching sumcheck proof that has the correct structure but is not in general valid.

Definition at line 76 of file mock_verifier_inputs.cpp.

◆ create_mock_oink_proof() [1/2]

template<typename Flavor , class PublicInputs >
HonkProof acir_format::create_mock_oink_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock oink proof that has the correct structure but is not in general valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 39 of file mock_verifier_inputs.cpp.

◆ create_mock_oink_proof() [2/2]

template<typename Flavor , class PublicInputs >
bb::HonkProof acir_format::create_mock_oink_proof ( const size_t  acir_public_inputs_size = 0)

Create a mock oink proof that has the correct structure but is not in general valid.

Parameters
acir_public_inputs_sizeNumber of public inputs coming from the ACIR constraints

Definition at line 39 of file mock_verifier_inputs.cpp.

◆ create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::AppIO >()

◆ create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > >()

◆ create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::KernelIO >()

◆ create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

◆ create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

◆ create_mock_oink_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO >()

◆ create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > >()

◆ create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > >()

◆ create_mock_pcs_proof() [1/2]

template<typename Flavor >
HonkProof acir_format::create_mock_pcs_proof ( )

Create a mock PCS proof that has the correct structure but is not in general valid.

Definition at line 117 of file mock_verifier_inputs.cpp.

◆ create_mock_pcs_proof() [2/2]

template<typename Flavor >
bb::HonkProof acir_format::create_mock_pcs_proof ( )

Create a mock PCS proof that has the correct structure but is not in general valid.

Definition at line 117 of file mock_verifier_inputs.cpp.

◆ create_mock_pcs_proof< MegaFlavor >()

◆ create_mock_sumcheck_proof() [1/2]

template<typename Flavor >
HonkProof acir_format::create_mock_sumcheck_proof ( )

Create a mock sumcheck proof that has the correct structure but is not in general valid.

Definition at line 61 of file mock_verifier_inputs.cpp.

◆ create_mock_sumcheck_proof() [2/2]

template<typename Flavor >
bb::HonkProof acir_format::create_mock_sumcheck_proof ( )

Create a mock sumcheck proof that has the correct structure but is not in general valid.

Definition at line 61 of file mock_verifier_inputs.cpp.

◆ create_mock_translator_proof()

bb::HonkProof acir_format::create_mock_translator_proof ( )

Create a mock Translator proof which has the correct structure but is not necessarily valid.

Definition at line 424 of file mock_verifier_inputs.cpp.

◆ create_mock_verification_queue_entry()

Chonk::VerifierInputs acir_format::create_mock_verification_queue_entry ( const Chonk::QUEUE_TYPE  verification_type,
const bool  is_kernel 
)

Create a mock verification queue entry with proof and VK that have the correct structure but are not necessarily valid.

Definition at line 89 of file hypernova_recursion_constraint.cpp.

◆ create_multi_scalar_mul_constraint()

template<typename Builder >
void acir_format::create_multi_scalar_mul_constraint ( Builder builder,
const MultiScalarMul constraint_input 
)

Create constraints for multi-scalar multiplication on the Grumpkin curve.

We proceed in 2 steps:

  1. We reconstruct the Grumpkin points, scalars, and input_result for which we must check sum(scalars[i] * points[i]) = input_result. The reconstruction handles all cases: has_valid_witness_assignments equal to false (write_vk scenario) and a witness predicate. If:
    • has_valid_witness_assignments is false, then we set all points, scalars, and input_result to dummy values (generator point and scalar 1)
    • the predicate is witness false, we set all input points and scalars to dummy values.
  2. We compute the multi-scalar multiplication and check that it agrees with input_result.
Note
We do not need to enforce in-circuit that input_result is on the curve because we check that input_result is equal to result, which we know is on the curve as it is the result of batch_mul on valid curve points. In the case of predicate equal to witness false, the constraint is supposed to be inactive, so even if input_result is not checked to be on the curve in this case, it is OK.
Template Parameters
Builder
Parameters
builder
constraint_inputThe MSM constraint containing witness indices and constants for points and scalars
has_valid_witness_assignmentsWhether valid witnesses are provided (false during VK generation)

Definition at line 49 of file multi_scalar_mul.cpp.

◆ create_multi_scalar_mul_constraint< MegaCircuitBuilder >()

◆ create_multi_scalar_mul_constraint< UltraCircuitBuilder >()

◆ create_poseidon2_permutations_constraints()

template<typename Builder >
void acir_format::create_poseidon2_permutations_constraints ( Builder builder,
const Poseidon2Constraint constraint 
)

Definition at line 19 of file poseidon2_constraint.cpp.

◆ create_poseidon2_permutations_constraints< MegaCircuitBuilder >()

◆ create_poseidon2_permutations_constraints< UltraCircuitBuilder >()

◆ create_quad_constraint()

template<typename Builder >
void acir_format::create_quad_constraint ( Builder builder,
QuadConstraint mul_quad 
)

Create a simple width-4 Ultra arithmetic gate constraint representing the equation.

\[ mul_{scaling} * (a * b) + a_{scaling} * a + b_{scaling} * b + c_{scaling} * c + d_{scaling} * d + const == 0 \]

Definition at line 48 of file arithmetic_constraints.cpp.

◆ create_quad_constraint< MegaCircuitBuilder >()

◆ create_quad_constraint< UltraCircuitBuilder >()

◆ create_recursion_constraints() [1/3]

template<typename Builder >
HonkRecursionConstraintsOutput< Builder > acir_format::create_recursion_constraints ( Builder builder,
GateCounter< Builder > &  gate_counter,
std::vector< size_t > &  gates_per_opcode,
const std::shared_ptr< IVCBase > &  ivc_base,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  honk_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  avm_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  hn_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  chonk_recursion_data 
)

Single entrypoint to process recursion constraints.

This functions processes the recursion constraints that have to be added to the builder. It has two specializations:

  • MegaCircuitBuilder: only Honk and HyperNova recursion constraints are processed. AVM and Chonk are not handled and a WARNING is output in case they are encountered. We fail if both Honk and HyperNova recursion constraints are present.
  • UltraCircuitBuilder: Honk, AVM and Chonk recursion constraints are processed. HyperNova recursion constraints are not handled and we fail if we encounter them. We handle:
    • Chonk recursion constraints (Private Base Rollup)
    • Honk + AVM recursion constraints (Public Base Rollup)
    • Honk recursion constraints
    • AVM recursion constraints However, as mock protocol circuits use Chonk + AVM (mock Public Base Rollup), instead of throwing an assert we return a vinfo for the case of Chonk + AVM
Template Parameters
Builder
Parameters
builder
gate_counter
gates_per_opcode
ivc_base
honk_recursion_datapair of (HonkRecursionConstraints, HonkRecursionConstraintsOriginalOpcodeIndices)
avm_recursion_datapair of (AvmRecursionConstraints, AvmRecursionConstraintsOriginalOpcodeIndices)
hn_recursion_datapair of (HypernovaRecursionConstraints, HypernovaRecursionConstraintsOriginalOpcodeIndices)
chonk_recursion_datapair of (ChonkRecursionConstraints, ChonkRecursionConstraintsOriginalOpcodeIndices)

◆ create_recursion_constraints() [2/3]

template<>
HonkRecursionConstraintsOutput< MegaCircuitBuilder > acir_format::create_recursion_constraints ( MegaCircuitBuilder builder,
GateCounter< MegaCircuitBuilder > &  gate_counter,
std::vector< size_t > &  gates_per_opcode,
const std::shared_ptr< IVCBase > &  ivc_base,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  honk_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  avm_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  hn_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  chonk_recursion_data 
)

Definition at line 16 of file recursion_constraint.cpp.

◆ create_recursion_constraints() [3/3]

template<>
HonkRecursionConstraintsOutput< UltraCircuitBuilder > acir_format::create_recursion_constraints ( UltraCircuitBuilder builder,
GateCounter< UltraCircuitBuilder > &  gate_counter,
std::vector< size_t > &  gates_per_opcode,
const std::shared_ptr< IVCBase > &  ivc_base,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  honk_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  avm_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  hn_recursion_data,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  chonk_recursion_data 
)

Definition at line 70 of file recursion_constraint.cpp.

◆ create_sha256_compression_constraints()

template<typename Builder >
void acir_format::create_sha256_compression_constraints ( Builder builder,
const Sha256Compression constraint 
)

Definition at line 14 of file sha256_constraint.cpp.

◆ create_sha256_compression_constraints< bb::MegaCircuitBuilder >()

◆ create_sha256_compression_constraints< bb::UltraCircuitBuilder >()

◆ deserialize_any_format()

template<typename T >
T acir_format::deserialize_any_format ( std::vector< uint8_t > &&  buf,
std::function< T(msgpack::object const &)>  decode_msgpack,
std::function< T(std::vector< uint8_t >)>  decode_bincode 
)

========= BYTES TO BARRETENBERG'S REPRESENTATION ========= ///

The functions below handle the transition from serialized ACIR formats (msgpack and bincode), which is the output of compiling a Noir program, to Barretenberg's internal formats.

The flow is as follows:

  • A buffer of bytes is deserialised according to either msgpack or bincode into an Acir::Circuit, which is just the representation of a function in terms of Acir::Opcodes, Acir::Witness, Acir::PublicInputs. As of now (Nov 2025) only bincode is supported.
  • The Acir::Circuit is transformed into AcirFormat, which is Barretenberg's internal representation of the Acir constraints that have to be added to the Builder.
  • A buffer of bytes is deserialized according to either msgpack or bincode into an Acir::Circuit, which is just the representation of a function in terms of Acir::Opcodes, Acir::Witness, Acir::PublicInputs. Currently only bincode is supported.
  • The Acir::Circuit is transformed into AcirFormat, which is Barretenberg's internal representation of the Acir constraints that have to be added to the Builder.
  • A buffer of bytes is deserialized into a WitnessVector, which is the list of witness values known at the time of noir program execution. This conversion takes a WitnessMap (which is a list of couples (witness_index, witness_value)) and converts it to a vector of bb::fr elements. ACIR optimizes away some witnesses, so the WitnessMap may have holes: witness indices go up, but not necessarily by one. The conversion accounts for these holes and fills them with zeros. NOTE: The witness vector does NOT contain all the witnesses that will be present in the builder by the end of circuit construction.
  • The AcirFormat structure and the WitnessVector are passed to acir_format::create_circuit, which constructs a barretenberg circuit by adding the relevant constraints and witnesses to a Builder

Deserialize buf either based on the first byte interpreted as a Noir serialization format byte, or falling back to bincode if the format cannot be recognized. Currently only bincode is expected.

Note
The function is written so that it can deserialize either msgpack or bincode depending on the first byte of the buffer. However, currently only bincode is supported, so we fail in case msgpack is encountered. Note that due to the lack of exception handling available in Wasm, the code cannot be structured to try bincode and fall back to msgpack if that fails. Therefore, we look at the first byte and commit to a format based on that.

Definition at line 274 of file acir_to_constraint_buf.cpp.

◆ fields_from_witnesses()

template<typename Builder >
std::vector< field_t< Builder > > acir_format::fields_from_witnesses ( Builder builder,
std::span< const uint32_t >  witness_indices 
)

========== ACIR TO BARRETENBERG ========== ///

The functions below are helpers for constructing in-circuit representations of the witnesses passed from ACIR to barretenberg

Generate builder variables from witness indices. This function is useful when receiving the indices of the witness from ACIR.

Template Parameters
Builder
Parameters
builder
witness_indices
Returns
std::vector<stdlib::field_t<Builder>>

Definition at line 16 of file utils.cpp.

◆ fields_from_witnesses< MegaCircuitBuilder >()

template std::vector< field_t< MegaCircuitBuilder > > acir_format::fields_from_witnesses< MegaCircuitBuilder > ( MegaCircuitBuilder ,
std::span< const uint32_t >   
)

◆ fields_from_witnesses< UltraCircuitBuilder >()

template std::vector< field_t< UltraCircuitBuilder > > acir_format::fields_from_witnesses< UltraCircuitBuilder > ( UltraCircuitBuilder ,
std::span< const uint32_t >   
)

◆ fields_to_bytes()

template<typename Builder >
byte_array< Builder > acir_format::fields_to_bytes ( Builder builder,
std::vector< field_t< Builder > > &  fields 
)

Convert a vector of field_t elements to a byte_array enforcing each element to fit in one byte.

Template Parameters
Builder
Parameters
builder
fields
Returns
byte_array<Builder>

Definition at line 26 of file utils.cpp.

◆ fields_to_bytes< MegaCircuitBuilder >()

◆ fields_to_bytes< UltraCircuitBuilder >()

◆ from_buffer_with_bound_checks()

bb::fr acir_format::from_buffer_with_bound_checks ( const std::vector< uint8_t > &  buffer)

========= HELPERS ========= ///

The functions below are helpers for converting data between ACIR representations and Barretenberg's internal representations.

Deserialize an fr element from buffer. The function checks that the buffer is exactly 32 bytes long.

Parameters
buffer
Returns
bb::fr

Definition at line 32 of file acir_to_constraint_buf.cpp.

◆ get_witness_from_function_input()

uint32_t acir_format::get_witness_from_function_input ( const Acir::FunctionInput input)

Extract the witness index from an Acir::FunctionInput representing a witness.

Note
The function asserts that the input is indeed a witness variant.

Definition at line 64 of file acir_to_constraint_buf.cpp.

◆ HONK_RECURSION_CONSTANTS()

template<typename RecursiveFlavor >
constexpr std::tuple< size_t, size_t > acir_format::HONK_RECURSION_CONSTANTS ( const PredicateTestCase mode = PredicateTestCase::ConstantTrue)
constexpr

Definition at line 61 of file gate_count_constants.hpp.

◆ is_single_arithmetic_gate()

bool acir_format::is_single_arithmetic_gate ( Acir::Expression const &  arg,
const std::map< uint32_t, bb::fr > &  linear_terms 
)

Given an Acir::Expression and its processed linear terms, determine whether it can be represented by a single width-4 arithmetic gate.

By processed linear terms, we mean selector values accumulated per witness index. See process_linear_terms.

Definition at line 867 of file acir_to_constraint_buf.cpp.

◆ mem_op_to_acir_mem_op()

Acir::MemOp acir_format::mem_op_to_acir_mem_op ( const MemOp mem_op)
inline

Convert an acir_format::MemOp to an Acir::MemOp.

Definition at line 88 of file test_class.hpp.

◆ memory_init_to_block_constraint()

BlockConstraint acir_format::memory_init_to_block_constraint ( Acir::Opcode::MemoryInit const &  mem_init)

========= MEMORY OPERATIONS ========== ///

Process memory initialization: create a BlockConstraint storing the entries with which the memory table must be initialized.

Definition at line 782 of file acir_to_constraint_buf.cpp.

◆ mock_chonk_accumulation()

void acir_format::mock_chonk_accumulation ( const std::shared_ptr< Chonk > &  ivc,
Chonk::QUEUE_TYPE  type,
const bool  is_kernel 
)

Populate an IVC instance with data that mimics the state after a single IVC accumulation.

Mock state consists of a mock verification queue entry (proof, VK) and a mocked merge proof. Also initializes the recursive verifier accumulator since it is hashed in circuit.

Parameters
ivc
typeThe type of verification (OINK, HN, HN_TAIL, HN_FINAL)
is_kernelWhether this is a kernel circuit accumulation

Definition at line 138 of file hypernova_recursion_constraint.cpp.

◆ native_verification_debug()

template<typename Flavor >
void acir_format::native_verification_debug ( const std::shared_ptr< typename Flavor::VerificationKey vkey,
const typename Flavor::NativeFlavor::FF  vkey_hash,
const bb::stdlib::Proof< typename Flavor::CircuitBuilder > &  proof_fields 
)

Natively verify the stdlib proof for debugging.

Definition at line 133 of file honk_recursion_constraint.cpp.

◆ parse_input()

WitnessOrConstant< bb::fr > acir_format::parse_input ( const Acir::FunctionInput input)

Parse an Acir::FunctionInput (which can either be a witness or a constant) into a WitnessOrConstant.

Definition at line 38 of file acir_to_constraint_buf.cpp.

◆ populate_dummy_vk_in_constraint()

void acir_format::populate_dummy_vk_in_constraint ( MegaCircuitBuilder builder,
const std::shared_ptr< MegaFlavor::VerificationKey > &  mock_verification_key,
const std::vector< uint32_t > &  key_witness_indices 
)

Populate VK witness fields from a recursion constraint from a provided VerificationKey.

Parameters
builder
mock_verification_key
key_witness_indices

Definition at line 166 of file hypernova_recursion_constraint.cpp.

◆ populate_field_elements()

template<class FF >
void acir_format::populate_field_elements ( std::vector< bb::fr > &  fields,
const size_t &  num_elements,
std::optional< FF value = std::nullopt 
)

Helper to populate a field buffer with some number of field elements.

Parameters
fieldsfield buffer to append field elements to
num_elementsnumber of mock field elements to append
valueoptional mock value appended

Definition at line 30 of file mock_verifier_inputs.cpp.

◆ populate_field_elements_for_mock_commitments()

template<class Curve >
void acir_format::populate_field_elements_for_mock_commitments ( std::vector< bb::fr > &  fields,
const size_t &  num_commitments 
)

Helper to populate a field buffer with fields corresponding to some number of mock commitment values.

Parameters
fieldsfield buffer to append mock commitment values to
num_commitmentsnumber of mock commitments to append

Definition at line 18 of file mock_verifier_inputs.cpp.

◆ populate_fields()

template<typename Builder >
void acir_format::populate_fields ( Builder builder,
const std::vector< field_t< Builder > > &  fields,
const std::vector< bb::fr > &  values 
)

========== WRITE_VK UTILITIES ========== ///

The functions below are helpers for write_vk situations

Populate fields in the builder with the given values.

Definition at line 78 of file utils.cpp.

◆ populate_fields< MegaCircuitBuilder >()

template void acir_format::populate_fields< MegaCircuitBuilder > ( MegaCircuitBuilder ,
const std::vector< field_t< MegaCircuitBuilder > > &  ,
const std::vector< bb::fr > &   
)

◆ populate_fields< UltraCircuitBuilder >()

template void acir_format::populate_fields< UltraCircuitBuilder > ( UltraCircuitBuilder ,
const std::vector< field_t< UltraCircuitBuilder > > &  ,
const std::vector< bb::fr > &   
)

◆ process_call_data_operations()

template<typename Builder >
void acir_format::process_call_data_operations ( Builder builder,
const BlockConstraint constraint,
std::vector< bb::stdlib::field_t< Builder > > &  init 
)

Definition at line 139 of file block_constraint.cpp.

◆ process_hn_recursion_constraints()

void acir_format::process_hn_recursion_constraints ( MegaCircuitBuilder builder,
GateCounter< MegaCircuitBuilder > &  gate_counter,
std::vector< size_t > &  gates_per_opcode,
const std::pair< std::vector< RecursionConstraint >, std::vector< size_t > > &  hn_recursion_data,
const std::shared_ptr< IVCBase > &  ivc_base 
)

Process HyperNova recursion constraints and complete kernel logic.

Parameters
builder
gate_counter
gates_per_opcode
hn_recursion_datapair of (HypernovaRecursionConstraints, HypernovaRecursionConstraintsOriginalOpcodeIndices)
ivc_base

Definition at line 147 of file recursion_constraint.cpp.

◆ process_linear_terms()

std::map< uint32_t, bb::fr > acir_format::process_linear_terms ( Acir::Expression const &  expr)

========= ACIR OPCODE HANDLERS ========= ///

========= ARITHMETIC =================== ///

Process the linear terms of an Acir::Expression into a map of witness indices to selector values.

Iterating over the linear terms of the expression, we accumulate selector values for each witness index

Definition at line 916 of file acir_to_constraint_buf.cpp.

◆ process_RAM_operations()

template<typename Builder >
void acir_format::process_RAM_operations ( Builder builder,
const BlockConstraint constraint,
std::vector< bb::stdlib::field_t< Builder > > &  init 
)

Definition at line 112 of file block_constraint.cpp.

◆ process_return_data_operations()

template<typename Builder >
void acir_format::process_return_data_operations ( Builder builder,
const BlockConstraint constraint,
std::vector< bb::stdlib::field_t< Builder > > &  init 
)

Definition at line 183 of file block_constraint.cpp.

◆ process_ROM_operations()

template<typename Builder >
void acir_format::process_ROM_operations ( Builder builder,
const BlockConstraint constraint,
std::vector< bb::stdlib::field_t< Builder > > &  init 
)

Definition at line 88 of file block_constraint.cpp.

◆ recursion_data_to_recursion_constraint()

RecursionConstraint acir_format::recursion_data_to_recursion_constraint ( std::vector< bb::fr > &  witness,
const std::vector< bb::fr > &  proof,
const std::vector< bb::fr > &  key,
const bb::fr key_hash,
const bb::fr predicate,
const size_t  num_public_inputs_to_extract,
const uint32_t  proof_type 
)

========== TESTING UTILITIES ========== ///

The functions below are helpers for handling witnesses in testing situations

Given recursion data (proof, key, key hash, predicate, and the number of public inputs) and a proof type, populate a witness vector with these values and return the associated recursion constraint.

The proof is assumed to be barretenberg-style: containing all the public inputs at its start. The variable num_public_inputs_to_extract is used to extract the ACIR-style public inputs.

Definition at line 53 of file utils.cpp.

◆ set_zero_idx()

template<typename Builder >
void acir_format::set_zero_idx ( const Builder builder,
QuadConstraint mul_quad 
)

Replace indices which are set to IS_CONSTANT with the zero index of the builder.

When creating a mul_quad_ gate, unused witness indices are set to IS_CONSTANT. When adding the gate to the builder, we replace these indices with the zero index. Note that we don't do this replacement for a, so that we implicitly get a check that the gate is non-zero when adding it to the Builder.

Definition at line 11 of file arithmetic_constraints.cpp.

◆ set_zero_idx< MegaCircuitBuilder >()

◆ set_zero_idx< UltraCircuitBuilder >()

◆ split_into_mul_quad_gates()

std::vector< mul_quad_< fr > > acir_format::split_into_mul_quad_gates ( Acir::Expression const &  arg,
std::map< uint32_t, bb::fr > &  linear_terms 
)

========= ACIR OPCODE HANDLERS ========= ///

Definition at line 461 of file acir_to_constraint_buf.cpp.

◆ to_field_ct()

template<typename Builder >
bb::stdlib::field_t< Builder > acir_format::to_field_ct ( const WitnessOrConstant< typename Builder::FF > &  input,
Builder builder 
)

Definition at line 39 of file witness_constant.hpp.

◆ to_grumpkin_point() [1/3]

template bb::stdlib::cycle_group< MegaCircuitBuilder > acir_format::to_grumpkin_point ( const WitnessOrConstant< MegaCircuitBuilder::FF > &  input_x,
const WitnessOrConstant< MegaCircuitBuilder::FF > &  input_y,
const WitnessOrConstant< MegaCircuitBuilder::FF > &  input_infinite,
const bb::stdlib::bool_t< MegaCircuitBuilder > &  predicate,
MegaCircuitBuilder builder 
)

◆ to_grumpkin_point() [2/3]

template<typename Builder >
bb::stdlib::cycle_group< Builder > acir_format::to_grumpkin_point ( const WitnessOrConstant< typename Builder::FF > &  input_x,
const WitnessOrConstant< typename Builder::FF > &  input_y,
const WitnessOrConstant< typename Builder::FF > &  input_infinite,
const bb::stdlib::bool_t< Builder > &  predicate,
Builder builder 
)

Convert inputs representing a Grumpkin point into a cycle_group element.

Inputs x, y, and is_infinite are used to construct the point. We handle two cases:

  1. has_valid_witness_assignments is false: we are in a write_vk scenario. In this case, we set the point to be the generator of Grumpkin.
  2. predicate is a witness: we conditionally assign the point depending on the predicate; if it is witness true, we use the witnesses provided, otherwise, we set the point to be the generator of Grumpkin.
Template Parameters
Builder
FF
Parameters
input_xx-coordinate of the point
input_yy-coordinate of the point
input_infiniteboolean indicating if the point is at infinity
has_valid_witness_assignmentsboolean indicating whether a witness is provided
predicateA relevant predicate used to conditionally assign the point to a valid value
builder
Returns
bb::stdlib::cycle_group<Builder>

Definition at line 34 of file witness_constant.cpp.

◆ to_grumpkin_point() [3/3]

template bb::stdlib::cycle_group< UltraCircuitBuilder > acir_format::to_grumpkin_point ( const WitnessOrConstant< UltraCircuitBuilder::FF > &  input_x,
const WitnessOrConstant< UltraCircuitBuilder::FF > &  input_y,
const WitnessOrConstant< UltraCircuitBuilder::FF > &  input_infinite,
const bb::stdlib::bool_t< UltraCircuitBuilder > &  predicate,
UltraCircuitBuilder builder 
)

◆ to_grumpkin_scalar() [1/3]

template bb::stdlib::cycle_group< MegaCircuitBuilder >::cycle_scalar acir_format::to_grumpkin_scalar ( const WitnessOrConstant< MegaCircuitBuilder::FF > &  scalar_lo,
const WitnessOrConstant< MegaCircuitBuilder::FF > &  scalar_hi,
const bb::stdlib::bool_t< MegaCircuitBuilder > &  predicate,
MegaCircuitBuilder builder 
)

◆ to_grumpkin_scalar() [2/3]

template<typename Builder >
bb::stdlib::cycle_group< Builder >::cycle_scalar acir_format::to_grumpkin_scalar ( const WitnessOrConstant< typename Builder::FF > &  scalar_lo,
const WitnessOrConstant< typename Builder::FF > &  scalar_hi,
const bb::stdlib::bool_t< Builder > &  predicate,
Builder builder 
)

Convert inputs representing a Grumpkin scalar into a cycle_scalar element.

Inputs scalar_lo and scalar_hi are used to construct the scalar. We handle two cases:

  1. has_valid_witness_assignments is false: we are in a write_vk scenario. In this case, we set the scalar to 1.
  2. predicate is a witness: we conditionally assign the scalar depending on the predicate; if it is witness true, we use the witnesses provided, otherwise, we set the scalar to 1.
Template Parameters
Builder
Parameters
scalar_lolow 128-bit limb of the scalar
scalar_hihigh 126-bit limb of the scalar
has_valid_witness_assignmentsboolean indicating whether a witness is provided
predicateA relevant predicate used to conditionally assign the scalar to a valid value
builder
Returns
typename bb::stdlib::cycle_group<Builder>::cycle_scalar

Definition at line 102 of file witness_constant.cpp.

◆ to_grumpkin_scalar() [3/3]

template bb::stdlib::cycle_group< UltraCircuitBuilder >::cycle_scalar acir_format::to_grumpkin_scalar ( const WitnessOrConstant< UltraCircuitBuilder::FF > &  scalar_lo,
const WitnessOrConstant< UltraCircuitBuilder::FF > &  scalar_hi,
const bb::stdlib::bool_t< UltraCircuitBuilder > &  predicate,
UltraCircuitBuilder builder 
)

◆ update_max_witness_index()

void acir_format::update_max_witness_index ( const uint32_t  witness_idx,
AcirFormat af 
)

Update the max_witness_index.

In write_vk scenarios, we use the max witness index to populate the builder with enough dummy variables. When a witness vector is provided, we check that the max witness index is equal to the length of the witness vector minus one to avoid buffer overrides.

Definition at line 73 of file acir_to_constraint_buf.cpp.

◆ update_max_witness_index_from_expression()

void acir_format::update_max_witness_index_from_expression ( Acir::Expression const &  expr,
AcirFormat af 
)

Update max_witness_index by processing all witnesses in an Acir::Expression.

This function extracts witness indices from both multiplication terms and linear combinations in an expression and updates the max witness index

Definition at line 80 of file acir_to_constraint_buf.cpp.

◆ update_max_witness_index_from_opcode()

void acir_format::update_max_witness_index_from_opcode ( Acir::Opcode const &  opcode,
AcirFormat af 
)

Update the max witness index by processing all the witness indices contained in the Acir::Opcode.

Parameters
opcode
af

Definition at line 94 of file acir_to_constraint_buf.cpp.

◆ witness_buf_to_witness_vector()

WitnessVector acir_format::witness_buf_to_witness_vector ( std::vector< uint8_t > &&  buf)

Convert a buffer representing a witness vector into Barretenberg's internal WitnessVector format.

Definition at line 412 of file acir_to_constraint_buf.cpp.

◆ witness_map_to_witness_vector()

WitnessVector acir_format::witness_map_to_witness_vector ( Witnesses::WitnessMap const &  witness_map)

Convert from the ACIR-native WitnessMap format to Barretenberg's internal WitnessVector format.

Note
This transformation results in all unassigned witnesses within the WitnessMap being assigned the value 0. Converting the WitnessVector back to a WitnessMap is unlikely to return the exact same WitnessMap.

Definition at line 436 of file acir_to_constraint_buf.cpp.

◆ witness_or_constant_to_expression()

Acir::Expression acir_format::witness_or_constant_to_expression ( const WitnessOrConstant< bb::fr > &  input)
inline

Convert a WitnessOrConstant to an Acir::Expression.

For a witness, creates an expression with a single linear term (coefficient 1). For a constant, creates an expression with only the constant term.

Definition at line 50 of file test_class.hpp.

◆ witness_or_constant_to_function_input()

Acir::FunctionInput acir_format::witness_or_constant_to_function_input ( const WitnessOrConstant< bb::fr > &  input)
inline

Convert a WitnessOrConstant back to an Acir::FunctionInput.

Definition at line 26 of file test_class.hpp.

◆ witness_to_function_input()

Acir::FunctionInput acir_format::witness_to_function_input ( uint32_t  witness_index)
inline

Convert a witness index to an Acir::FunctionInput (witness variant).

Definition at line 38 of file test_class.hpp.

◆ xor_gate()

void acir_format::xor_gate ( UltraCircuitBuilder builder,
WitnessOrConstant< fr a,
WitnessOrConstant< fr b,
uint32_t  result 
)

Variable Documentation

◆ AES128_ENCRYPTION

template<typename Builder >
constexpr size_t acir_format::AES128_ENCRYPTION = 1432 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 31 of file gate_count_constants.hpp.

◆ ARITHMETIC_TRIPLE

template<typename Builder >
constexpr size_t acir_format::ARITHMETIC_TRIPLE = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 24 of file gate_count_constants.hpp.

◆ ASSERT_EQUALITY

template<typename Builder >
constexpr size_t acir_format::ASSERT_EQUALITY = ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 52 of file gate_count_constants.hpp.

◆ BIG_QUAD

template<typename Builder >
constexpr size_t acir_format::BIG_QUAD = 2 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 26 of file gate_count_constants.hpp.

◆ BLAKE2S

template<typename Builder >
constexpr size_t acir_format::BLAKE2S = 2952 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 41 of file gate_count_constants.hpp.

◆ BLAKE3

template<typename Builder >
constexpr size_t acir_format::BLAKE3 = 2158 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 42 of file gate_count_constants.hpp.

◆ BLOCK_CALLDATA

template<typename Builder >
constexpr size_t acir_format::BLOCK_CALLDATA = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 50 of file gate_count_constants.hpp.

◆ BLOCK_RAM_READ

template<typename Builder >
constexpr size_t acir_format::BLOCK_RAM_READ = 18 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 48 of file gate_count_constants.hpp.

◆ BLOCK_RAM_WRITE

template<typename Builder >
constexpr size_t acir_format::BLOCK_RAM_WRITE = 18 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 49 of file gate_count_constants.hpp.

◆ BLOCK_RETURNDATA

template<typename Builder >
constexpr size_t acir_format::BLOCK_RETURNDATA = 23 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 51 of file gate_count_constants.hpp.

◆ BLOCK_ROM_READ

template<typename Builder >
constexpr size_t acir_format::BLOCK_ROM_READ = 9 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 47 of file gate_count_constants.hpp.

◆ CHONK_RECURSION_GATES

constexpr size_t acir_format::CHONK_RECURSION_GATES = 2368439
inlineconstexpr

Definition at line 122 of file gate_count_constants.hpp.

◆ EC_ADD

template<typename Builder >
constexpr size_t acir_format::EC_ADD = 66 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 46 of file gate_count_constants.hpp.

◆ ECCVM_RECURSIVE_VERIFIER_GATE_COUNT

constexpr size_t acir_format::ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 214950
inlineconstexpr

Definition at line 156 of file gate_count_constants.hpp.

◆ ECDSA_SECP256K1

template<typename Builder >
constexpr size_t acir_format::ECDSA_SECP256K1 = 41994 + ZERO_GATE
inlineconstexpr

Definition at line 37 of file gate_count_constants.hpp.

◆ ECDSA_SECP256R1

template<typename Builder >
constexpr size_t acir_format::ECDSA_SECP256R1 = 72209 + ZERO_GATE + (IsMegaBuilder<Builder> ? 2 : 0)
inlineconstexpr

Definition at line 39 of file gate_count_constants.hpp.

◆ FINALIZED_GOBLIN_AVM_GATE_COUNT

constexpr size_t acir_format::FINALIZED_GOBLIN_AVM_GATE_COUNT = 3325922
inlineconstexpr

Definition at line 163 of file gate_count_constants.hpp.

◆ GOBLIN_AVM_GATE_COUNT

constexpr size_t acir_format::GOBLIN_AVM_GATE_COUNT = 3325906
inlineconstexpr

Definition at line 162 of file gate_count_constants.hpp.

◆ HIDING_KERNEL_ECC_ROWS

constexpr size_t acir_format::HIDING_KERNEL_ECC_ROWS = 1341 + MSM_ROWS_OFFSET
inlineconstexpr

Definition at line 148 of file gate_count_constants.hpp.

◆ HIDING_KERNEL_GATE_COUNT

constexpr size_t acir_format::HIDING_KERNEL_GATE_COUNT = 37106
inlineconstexpr

Definition at line 147 of file gate_count_constants.hpp.

◆ HIDING_KERNEL_ULTRA_OPS

constexpr size_t acir_format::HIDING_KERNEL_ULTRA_OPS = 124
inlineconstexpr

Definition at line 149 of file gate_count_constants.hpp.

◆ INIT_KERNEL_ECC_ROWS

constexpr size_t acir_format::INIT_KERNEL_ECC_ROWS = 881 + MSM_ROWS_OFFSET
inlineconstexpr

Definition at line 133 of file gate_count_constants.hpp.

◆ INIT_KERNEL_GATE_COUNT

constexpr size_t acir_format::INIT_KERNEL_GATE_COUNT = 26036
inlineconstexpr

Definition at line 132 of file gate_count_constants.hpp.

◆ INIT_KERNEL_ULTRA_OPS

constexpr size_t acir_format::INIT_KERNEL_ULTRA_OPS = 89
inlineconstexpr

Definition at line 134 of file gate_count_constants.hpp.

◆ INNER_KERNEL_ECC_ROWS

constexpr size_t acir_format::INNER_KERNEL_ECC_ROWS = 1700 + MSM_ROWS_OFFSET
inlineconstexpr

Definition at line 138 of file gate_count_constants.hpp.

◆ INNER_KERNEL_GATE_COUNT_HN

constexpr size_t acir_format::INNER_KERNEL_GATE_COUNT_HN = 61018
inlineconstexpr

Definition at line 137 of file gate_count_constants.hpp.

◆ INNER_KERNEL_ULTRA_OPS

constexpr size_t acir_format::INNER_KERNEL_ULTRA_OPS = 179
inlineconstexpr

Definition at line 139 of file gate_count_constants.hpp.

◆ is_std_vector_v

template<typename T >
constexpr bool acir_format::is_std_vector_v = is_std_vector<T>::value
inlineconstexpr

Definition at line 21 of file test_class.hpp.

◆ KECCAK_PERMUTATION

template<typename Builder >
constexpr size_t acir_format::KECCAK_PERMUTATION = 17387 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 43 of file gate_count_constants.hpp.

◆ LOGIC_AND_32

template<typename Builder >
constexpr size_t acir_format::LOGIC_AND_32 = 6 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 28 of file gate_count_constants.hpp.

◆ LOGIC_XOR_32

template<typename Builder >
constexpr size_t acir_format::LOGIC_XOR_32 = 6 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 27 of file gate_count_constants.hpp.

◆ MEGA_OFFSET

template<typename Builder >
constexpr size_t acir_format::MEGA_OFFSET = IsMegaBuilder<Builder> ? 3 : 0
inlineconstexpr

Definition at line 18 of file gate_count_constants.hpp.

◆ MSM_ROWS_OFFSET

constexpr size_t acir_format::MSM_ROWS_OFFSET = 2
inlineconstexpr

Definition at line 129 of file gate_count_constants.hpp.

◆ MULTI_SCALAR_MUL

template<typename Builder >
constexpr size_t acir_format::MULTI_SCALAR_MUL = 3550 + ZERO_GATE
inlineconstexpr

Definition at line 45 of file gate_count_constants.hpp.

◆ POSEIDON2_PERMUTATION

template<typename Builder >
constexpr size_t acir_format::POSEIDON2_PERMUTATION = 73 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 44 of file gate_count_constants.hpp.

◆ QUAD

template<typename Builder >
constexpr size_t acir_format::QUAD = 1 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 25 of file gate_count_constants.hpp.

◆ RANGE_32

template<typename Builder >
constexpr size_t acir_format::RANGE_32 = 2744 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 29 of file gate_count_constants.hpp.

◆ ROOT_ROLLUP_GATE_COUNT

constexpr size_t acir_format::ROOT_ROLLUP_GATE_COUNT = 12986977
inlineconstexpr

Definition at line 58 of file gate_count_constants.hpp.

◆ SHA256_COMPRESSION

template<typename Builder >
constexpr size_t acir_format::SHA256_COMPRESSION = 6679 + ZERO_GATE + MEGA_OFFSET<Builder>
inlineconstexpr

Definition at line 30 of file gate_count_constants.hpp.

◆ TAIL_KERNEL_ECC_ROWS

constexpr size_t acir_format::TAIL_KERNEL_ECC_ROWS = 914 + MSM_ROWS_OFFSET
inlineconstexpr

Definition at line 143 of file gate_count_constants.hpp.

◆ TAIL_KERNEL_GATE_COUNT

constexpr size_t acir_format::TAIL_KERNEL_GATE_COUNT = 33966
inlineconstexpr

Definition at line 142 of file gate_count_constants.hpp.

◆ TAIL_KERNEL_ULTRA_OPS

constexpr size_t acir_format::TAIL_KERNEL_ULTRA_OPS = 96
inlineconstexpr

Definition at line 144 of file gate_count_constants.hpp.

◆ ZERO_GATE

constexpr size_t acir_format::ZERO_GATE = 1
inlineconstexpr

Definition at line 21 of file gate_count_constants.hpp.