|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
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::fr > | parse_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 > | |
| 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::fr > | process_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::UltraCircuitBuilder > | create_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::UltraCircuitBuilder > | create_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::CircuitBuilder > | create_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< Chonk > | 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. | |
| 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::VerificationKey > | 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. | |
| 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::VerificationKey > | create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::AppIO > (const size_t, const size_t, const size_t) |
| template std::shared_ptr< MegaFlavor::VerificationKey > | create_mock_honk_vk< MegaFlavor, stdlib::recursion::honk::KernelIO > (const size_t, const size_t, const size_t) |
| template std::shared_ptr< MegaFlavor::VerificationKey > | create_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::VerificationKey > | create_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::VerificationKey > | create_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< MegaCircuitBuilder > | 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) |
| template<> | |
| HonkRecursionConstraintsOutput< UltraCircuitBuilder > | 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) |
| 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< Builder > | 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. | |
| 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::Opcode > | block_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::Opcode > | constraint_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< Builder > | 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. | |
| 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< UltraCircuitBuilder > | fields_to_bytes< UltraCircuitBuilder > (UltraCircuitBuilder &, std::vector< field_t< UltraCircuitBuilder > > &) |
| template byte_array< MegaCircuitBuilder > | fields_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< Builder > | 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. | |
| template bb::stdlib::cycle_group< UltraCircuitBuilder > | 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) |
| template bb::stdlib::cycle_group< MegaCircuitBuilder > | 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) |
| 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< Builder > | to_field_ct (const WitnessOrConstant< typename Builder::FF > &input, Builder &builder) |
| HonkRecursionConstraintOutput< Builder > | create_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 |
| using acir_format::HonkRecursionConstraintOutput = typedef bb::stdlib::recursion::honk::UltraRecursiveVerifierOutput<Builder> |
Alias for the result of recursively verifying a proof.
Definition at line 25 of file recursion_constraint_output.hpp.
| using acir_format::QuadConstraint = typedef mul_quad_<bb::fr> |
Standard UltraHonk arithmetic constraint of width 4.
Definition at line 24 of file arithmetic_constraints.hpp.
| using acir_format::WitnessVector = typedef std::vector<bb::fr> |
Definition at line 35 of file acir_format.hpp.
| Enumerator | |
|---|---|
| Read | |
| Write | |
Definition at line 15 of file block_constraint.hpp.
| Enumerator | |
|---|---|
| ROM | |
| RAM | |
| CallData | |
| ReturnData | |
Definition at line 36 of file block_constraint.hpp.
| Enumerator | |
|---|---|
| None | |
| Primary | |
| Secondary | |
Definition at line 20 of file block_constraint.hpp.
|
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.
| 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.
|
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.
| 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.
| 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.
| 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.
| proof_in | A proof stripped of its public inputs |
| public_inputs | The public inputs to be reinserted into the proof |
|
inline |
Add terms for a QuadConstraint to an Acir::Expression.
Definition at line 164 of file test_class.hpp.
| 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.
| T | The input type |
| witness | The witness vector to append to |
| input | The input value(s) - either a span of values or a single special type |
| std::array< uint32_t, N > acir_format::add_to_witness_and_track_indices | ( | std::vector< bb::fr > & | witness, |
| const T & | input | ||
| ) |
| void acir_format::and_gate | ( | UltraCircuitBuilder & | builder, |
| WitnessOrConstant< fr > | a, | ||
| WitnessOrConstant< fr > | b, | ||
| uint32_t | result | ||
| ) |
| 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.
|
inline |
Convert a BlockConstraint to a vector of Acir::Opcodes.
A BlockConstraint generates:
| constraint | The BlockConstraint to convert |
| block_id | The block ID to use for the memory operations |
Definition at line 129 of file test_class.hpp.
|
inline |
Convert an acir_format::BlockType to an Acir::BlockType.
Definition at line 100 of file test_class.hpp.
|
inline |
Build an Acir::Circuit from opcodes and witness count.
| opcodes | The ACIR opcodes to include in the circuit |
| max_witness_index | The maximum witness index in the circuit |
Definition at line 478 of file test_class.hpp.
| 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.
| template void acir_format::build_constraints< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | , |
| AcirFormat & | , | ||
| const ProgramMetadata & | |||
| ) |
| template void acir_format::build_constraints< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | , |
| AcirFormat & | , | ||
| const ProgramMetadata & | |||
| ) |
| 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.
| template void acir_format::check_mul_add_gate< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | , |
| const QuadConstraint & | , | ||
| const typename MegaCircuitBuilder::FF | |||
| ) |
| template void acir_format::check_mul_add_gate< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | , |
| const QuadConstraint & | , | ||
| const typename UltraCircuitBuilder::FF | |||
| ) |
| 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.
| 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.
| 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:
When ConstraintType is a std::vector, iterates over all constraints and collects their opcodes.
| constraint | The constraint (or vector of constraints) to convert |
| varnum | The number of witnesses |
Definition at line 506 of file test_class.hpp.
| 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).
| constraint | The constraint to convert |
Definition at line 204 of file test_class.hpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
| make_proof_invalid | If true, the proof is an invalid proof |
Definition at line 233 of file mock_verifier_inputs.cpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
| make_proof_invalid | If true, the proof is an invalid proof |
Definition at line 233 of file mock_verifier_inputs.cpp.
| template std::pair< HonkProof, std::shared_ptr< UltraFlavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk< UltraFlavor > | ( | const size_t | ) |
| template std::pair< HonkProof, std::shared_ptr< UltraRollupFlavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk< UltraRollupFlavor > | ( | const size_t | ) |
| template std::pair< HonkProof, std::shared_ptr< UltraZKFlavor::VerificationKey > > acir_format::construct_arbitrary_valid_honk_proof_and_vk< UltraZKFlavor > | ( | const size_t | ) |
| void acir_format::create_aes128_constraints | ( | Builder & | builder, |
| const AES128Constraint & | constraint | ||
| ) |
Definition at line 18 of file aes128_constraint.cpp.
| template void acir_format::create_aes128_constraints< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| const AES128Constraint & | constraint | ||
| ) |
| template void acir_format::create_aes128_constraints< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| const AES128Constraint & | constraint | ||
| ) |
| 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.
| 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.
| builder | |
| input | |
| input_points_accumulator_indices | |
| has_valid_witness_assignments |
Definition at line 118 of file avm2_recursion_constraint.cpp.
| void acir_format::create_big_quad_constraint | ( | Builder & | builder, |
| BigQuadConstraint & | big_constraint | ||
| ) |
Definition at line 58 of file arithmetic_constraints.cpp.
| template void acir_format::create_big_quad_constraint< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| BigQuadConstraint & | big_constraint | ||
| ) |
| template void acir_format::create_big_quad_constraint< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| BigQuadConstraint & | big_constraint | ||
| ) |
| void acir_format::create_blake2s_constraints | ( | Builder & | builder, |
| const Blake2sConstraint & | constraint | ||
| ) |
Definition at line 16 of file blake2s_constraint.cpp.
| template void acir_format::create_blake2s_constraints< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| const Blake2sConstraint & | constraint | ||
| ) |
| template void acir_format::create_blake2s_constraints< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| const Blake2sConstraint & | constraint | ||
| ) |
| void acir_format::create_blake3_constraints | ( | Builder & | builder, |
| const Blake3Constraint & | constraint | ||
| ) |
Definition at line 14 of file blake3_constraint.cpp.
| template void acir_format::create_blake3_constraints< bb::MegaCircuitBuilder > | ( | bb::MegaCircuitBuilder & | builder, |
| const Blake3Constraint & | constraint | ||
| ) |
| template void acir_format::create_blake3_constraints< bb::UltraCircuitBuilder > | ( | bb::UltraCircuitBuilder & | builder, |
| const Blake3Constraint & | constraint | ||
| ) |
| void acir_format::create_block_constraints | ( | Builder & | builder, |
| const BlockConstraint & | constraint | ||
| ) |
| 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.
| 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.
| 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.
| builder | |
| input | |
| input_points_accumulator_indices | |
| has_valid_witness_assignments |
Definition at line 70 of file chonk_recursion_constraints.cpp.
| UltraCircuitBuilder acir_format::create_circuit | ( | AcirProgram & | program, |
| const ProgramMetadata & | metadata | ||
| ) |
Specialization for creating an Ultra circuit from an acir program.
| program | constraints and optionally a witness |
| metadata | additional data needed to construct the circuit |
Definition at line 190 of file acir_format.cpp.
| MegaCircuitBuilder acir_format::create_circuit | ( | AcirProgram & | program, |
| const ProgramMetadata & | metadata | ||
| ) |
Specialization for creating a Mega circuit from an acir program.
| program | constraints and optionally a witness |
| metadata | additional data needed to construct the circuit |
Definition at line 222 of file acir_format.cpp.
| 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.
| 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.
| 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 > & | |||
| ) |
| 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 > & | |||
| ) |
| 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.
| builder | |
| proof_size | Size of proof with NO public inputs |
| public_inputs_size | Total size of public inputs including aggregation object |
| key_fields | |
| proof_fields |
Definition at line 28 of file chonk_recursion_constraints.cpp.
| 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:
| Builder |
| builder | |
| input | |
| has_valid_witness_assignments |
Definition at line 38 of file ec_operations.cpp.
| template void acir_format::create_ec_add_constraint< bb::MegaCircuitBuilder > | ( | bb::MegaCircuitBuilder & | builder, |
| const EcAdd & | input | ||
| ) |
| template void acir_format::create_ec_add_constraint< bb::UltraCircuitBuilder > | ( | bb::UltraCircuitBuilder & | builder, |
| const EcAdd & | input | ||
| ) |
| 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:
| Curve |
| builder | |
| input | |
| has_valid_witness_assignments |
Definition at line 41 of file ecdsa_constraints.cpp.
| template void acir_format::create_ecdsa_verify_constraints< stdlib::secp256k1< MegaCircuitBuilder > > | ( | MegaCircuitBuilder & | builder, |
| const EcdsaConstraint & | input | ||
| ) |
| template void acir_format::create_ecdsa_verify_constraints< stdlib::secp256k1< UltraCircuitBuilder > > | ( | UltraCircuitBuilder & | builder, |
| const EcdsaConstraint & | input | ||
| ) |
| template void acir_format::create_ecdsa_verify_constraints< stdlib::secp256r1< MegaCircuitBuilder > > | ( | MegaCircuitBuilder & | builder, |
| const EcdsaConstraint & | input | ||
| ) |
| template void acir_format::create_ecdsa_verify_constraints< stdlib::secp256r1< UltraCircuitBuilder > > | ( | UltraCircuitBuilder & | builder, |
| const EcdsaConstraint & | input | ||
| ) |
| 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.
| Flavor | The 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:
input, reconstruct in-circuit representations of the data required to recursively verify a proof.Definition at line 30 of file honk_recursion_constraint.cpp.
| void acir_format::create_keccak_permutations_constraints | ( | Builder & | builder, |
| const Keccakf1600 & | constraint | ||
| ) |
Definition at line 13 of file keccak_constraint.cpp.
| template void acir_format::create_keccak_permutations_constraints< bb::MegaCircuitBuilder > | ( | bb::MegaCircuitBuilder & | builder, |
| const Keccakf1600 & | constraint | ||
| ) |
| template void acir_format::create_keccak_permutations_constraints< bb::UltraCircuitBuilder > | ( | bb::UltraCircuitBuilder & | builder, |
| const Keccakf1600 & | constraint | ||
| ) |
| 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.
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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.
| constraints | IVC recursion constraints from a kernel circuit |
Definition at line 38 of file hypernova_recursion_constraint.cpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 445 of file mock_verifier_inputs.cpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 445 of file mock_verifier_inputs.cpp.
| template HonkProof acir_format::create_mock_chonk_proof< MegaCircuitBuilder > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_chonk_proof< UltraCircuitBuilder > | ( | const size_t | ) |
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.
| 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.
| template HonkProof acir_format::create_mock_decider_proof< MegaFlavor > | ( | ) |
| template HonkProof acir_format::create_mock_decider_proof< TranslatorFlavor > | ( | ) |
| template HonkProof acir_format::create_mock_decider_proof< UltraFlavor > | ( | ) |
| template HonkProof acir_format::create_mock_decider_proof< UltraRollupFlavor > | ( | ) |
| template HonkProof acir_format::create_mock_decider_proof< UltraZKFlavor > | ( | ) |
| 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.
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.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 215 of file mock_verifier_inputs.cpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 215 of file mock_verifier_inputs.cpp.
| template HonkProof acir_format::create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::AppIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_honk_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > | ( | const size_t | ) |
| 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.
| dyadic_size | Dyadic size of the circuit for which we generate a vk |
| pub_inputs_offest | Indicating whether the circuit has a first zero row |
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 463 of file mock_verifier_inputs.cpp.
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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 | |||
| ) |
| 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.
| include_fold | If true, the proof contains a mock multilinear batching sumcheck proof |
Definition at line 99 of file mock_verifier_inputs.cpp.
| 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.
| include_fold | If true, the proof contains a mock multilinear batching sumcheck proof |
Definition at line 99 of file mock_verifier_inputs.cpp.
| template HonkProof acir_format::create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::AppIO > | ( | bool | ) |
| template HonkProof acir_format::create_mock_hyper_nova_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > | ( | bool | ) |
| 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.
| 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.
| 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.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 39 of file mock_verifier_inputs.cpp.
| 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.
| acir_public_inputs_size | Number of public inputs coming from the ACIR constraints |
Definition at line 39 of file mock_verifier_inputs.cpp.
| template HonkProof acir_format::create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::AppIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::HidingKernelIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< MegaFlavor, stdlib::recursion::honk::KernelIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< UltraFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< UltraRollupFlavor, stdlib::recursion::honk::RollupIO > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< MegaCircuitBuilder > > | ( | const size_t | ) |
| template HonkProof acir_format::create_mock_oink_proof< UltraZKFlavor, stdlib::recursion::honk::DefaultIO< UltraCircuitBuilder > > | ( | const size_t | ) |
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.
| 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.
| template HonkProof acir_format::create_mock_pcs_proof< MegaFlavor > | ( | ) |
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.
| 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.
| 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.
| 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.
| 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:
| Builder |
| builder | |
| constraint_input | The MSM constraint containing witness indices and constants for points and scalars |
| has_valid_witness_assignments | Whether valid witnesses are provided (false during VK generation) |
Definition at line 49 of file multi_scalar_mul.cpp.
| template void acir_format::create_multi_scalar_mul_constraint< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| const MultiScalarMul & | input | ||
| ) |
| template void acir_format::create_multi_scalar_mul_constraint< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| const MultiScalarMul & | input | ||
| ) |
| void acir_format::create_poseidon2_permutations_constraints | ( | Builder & | builder, |
| const Poseidon2Constraint & | constraint | ||
| ) |
Definition at line 19 of file poseidon2_constraint.cpp.
| template void acir_format::create_poseidon2_permutations_constraints< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| const Poseidon2Constraint & | constraint | ||
| ) |
| template void acir_format::create_poseidon2_permutations_constraints< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| const Poseidon2Constraint & | constraint | ||
| ) |
| 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.
| template void acir_format::create_quad_constraint< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | builder, |
| QuadConstraint & | constraint | ||
| ) |
| template void acir_format::create_quad_constraint< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | builder, |
| QuadConstraint & | constraint | ||
| ) |
| 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:
| Builder |
| builder | |
| gate_counter | |
| gates_per_opcode | |
| ivc_base | |
| honk_recursion_data | pair of (HonkRecursionConstraints, HonkRecursionConstraintsOriginalOpcodeIndices) |
| avm_recursion_data | pair of (AvmRecursionConstraints, AvmRecursionConstraintsOriginalOpcodeIndices) |
| hn_recursion_data | pair of (HypernovaRecursionConstraints, HypernovaRecursionConstraintsOriginalOpcodeIndices) |
| chonk_recursion_data | pair of (ChonkRecursionConstraints, ChonkRecursionConstraintsOriginalOpcodeIndices) |
| 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.
| 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.
| void acir_format::create_sha256_compression_constraints | ( | Builder & | builder, |
| const Sha256Compression & | constraint | ||
| ) |
Definition at line 14 of file sha256_constraint.cpp.
| template void acir_format::create_sha256_compression_constraints< bb::MegaCircuitBuilder > | ( | bb::MegaCircuitBuilder & | builder, |
| const Sha256Compression & | constraint | ||
| ) |
| template void acir_format::create_sha256_compression_constraints< bb::UltraCircuitBuilder > | ( | bb::UltraCircuitBuilder & | builder, |
| const Sha256Compression & | constraint | ||
| ) |
| 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:
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.
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.
| 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.
| Builder |
| builder | |
| witness_indices |
| template std::vector< field_t< MegaCircuitBuilder > > acir_format::fields_from_witnesses< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | , |
| std::span< const uint32_t > | |||
| ) |
| template std::vector< field_t< UltraCircuitBuilder > > acir_format::fields_from_witnesses< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | , |
| std::span< const uint32_t > | |||
| ) |
| template byte_array< MegaCircuitBuilder > acir_format::fields_to_bytes< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | , |
| std::vector< field_t< MegaCircuitBuilder > > & | |||
| ) |
| template byte_array< UltraCircuitBuilder > acir_format::fields_to_bytes< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | , |
| std::vector< field_t< UltraCircuitBuilder > > & | |||
| ) |
| 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.
| buffer |
Definition at line 32 of file acir_to_constraint_buf.cpp.
| uint32_t acir_format::get_witness_from_function_input | ( | const Acir::FunctionInput & | input | ) |
Extract the witness index from an Acir::FunctionInput representing a witness.
Definition at line 64 of file acir_to_constraint_buf.cpp.
|
constexpr |
Definition at line 61 of file gate_count_constants.hpp.
| 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.
|
inline |
Convert an acir_format::MemOp to an Acir::MemOp.
Definition at line 88 of file test_class.hpp.
| 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.
| 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.
| ivc | |
| type | The type of verification (OINK, HN, HN_TAIL, HN_FINAL) |
| is_kernel | Whether this is a kernel circuit accumulation |
Definition at line 138 of file hypernova_recursion_constraint.cpp.
| 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.
| 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.
| 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.
| builder | |
| mock_verification_key | |
| key_witness_indices |
Definition at line 166 of file hypernova_recursion_constraint.cpp.
| 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.
| fields | field buffer to append field elements to |
| num_elements | number of mock field elements to append |
| value | optional mock value appended |
Definition at line 30 of file mock_verifier_inputs.cpp.
| 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.
| fields | field buffer to append mock commitment values to |
| num_commitments | number of mock commitments to append |
Definition at line 18 of file mock_verifier_inputs.cpp.
| template void acir_format::populate_fields< MegaCircuitBuilder > | ( | MegaCircuitBuilder & | , |
| const std::vector< field_t< MegaCircuitBuilder > > & | , | ||
| const std::vector< bb::fr > & | |||
| ) |
| template void acir_format::populate_fields< UltraCircuitBuilder > | ( | UltraCircuitBuilder & | , |
| const std::vector< field_t< UltraCircuitBuilder > > & | , | ||
| const std::vector< bb::fr > & | |||
| ) |
| 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.
| 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.
| builder | |
| gate_counter | |
| gates_per_opcode | |
| hn_recursion_data | pair of (HypernovaRecursionConstraints, HypernovaRecursionConstraintsOriginalOpcodeIndices) |
| ivc_base |
Definition at line 147 of file recursion_constraint.cpp.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| template void acir_format::set_zero_idx< MegaCircuitBuilder > | ( | const MegaCircuitBuilder & | , |
| QuadConstraint & | |||
| ) |
| template void acir_format::set_zero_idx< UltraCircuitBuilder > | ( | const UltraCircuitBuilder & | , |
| QuadConstraint & | |||
| ) |
| 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.
| 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.
| 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 | ||
| ) |
| 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:
| Builder | |
| FF |
| input_x | x-coordinate of the point |
| input_y | y-coordinate of the point |
| input_infinite | boolean indicating if the point is at infinity |
| has_valid_witness_assignments | boolean indicating whether a witness is provided |
| predicate | A relevant predicate used to conditionally assign the point to a valid value |
| builder |
Definition at line 34 of file witness_constant.cpp.
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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:
| Builder |
| scalar_lo | low 128-bit limb of the scalar |
| scalar_hi | high 126-bit limb of the scalar |
| has_valid_witness_assignments | boolean indicating whether a witness is provided |
| predicate | A relevant predicate used to conditionally assign the scalar to a valid value |
| builder |
Definition at line 102 of file witness_constant.cpp.
| 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 | ||
| ) |
| 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.
| 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.
| 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.
| opcode | |
| af |
Definition at line 94 of file acir_to_constraint_buf.cpp.
| 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.
| 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.
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.
|
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.
|
inline |
Convert a WitnessOrConstant back to an Acir::FunctionInput.
Definition at line 26 of file test_class.hpp.
|
inline |
Convert a witness index to an Acir::FunctionInput (witness variant).
Definition at line 38 of file test_class.hpp.
| void acir_format::xor_gate | ( | UltraCircuitBuilder & | builder, |
| WitnessOrConstant< fr > | a, | ||
| WitnessOrConstant< fr > | b, | ||
| uint32_t | result | ||
| ) |
|
inlineconstexpr |
Definition at line 31 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 24 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 52 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 26 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 41 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 42 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 50 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 48 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 49 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 51 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 47 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 122 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 46 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 156 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 37 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 39 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 163 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 162 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 148 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 147 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 149 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 133 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 132 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 134 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 138 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 137 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 139 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 21 of file test_class.hpp.
|
inlineconstexpr |
Definition at line 43 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 28 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 27 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 18 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 129 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 45 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 44 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 25 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 29 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 58 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 30 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 143 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 142 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 144 of file gate_count_constants.hpp.
|
inlineconstexpr |
Definition at line 21 of file gate_count_constants.hpp.