|
|
WireVector & | ecc_op_wire_1 () |
| |
|
WireVector & | ecc_op_wire_2 () |
| |
|
WireVector & | ecc_op_wire_3 () |
| |
|
WireVector & | ecc_op_wire_4 () |
| |
|
const WireVector & | ecc_op_wire_1 () const |
| |
|
const WireVector & | ecc_op_wire_2 () const |
| |
|
const WireVector & | ecc_op_wire_3 () const |
| |
|
const WireVector & | ecc_op_wire_4 () const |
| |
|
SelectorVector & | q_busread () |
| |
|
SelectorVector & | q_poseidon2_external () |
| |
|
SelectorVector & | q_poseidon2_internal () |
| |
|
const SelectorVector & | q_busread () const |
| |
|
const SelectorVector & | q_poseidon2_external () const |
| |
|
const SelectorVector & | q_poseidon2_internal () const |
| |
| ecc_op_tuple | queue_ecc_add_accum (const g1::affine_element &point) |
| | Add gates for simple point addition (no mul) and add the raw operation data to the op queue.
|
| |
| ecc_op_tuple | queue_ecc_mul_accum (const g1::affine_element &point, const FF &scalar) |
| | Add gates for point mul-then-accumulate and add the raw operation data to the op queue.
|
| |
| ecc_op_tuple | queue_ecc_eq () |
| | Add point equality gates based on the current value of the accumulator internal to the op queue and add the raw operation data to the op queue.
|
| |
|
| GoblinUltraCircuitBuilder_ (const size_t size_hint=0, std::shared_ptr< ECCOpQueue > op_queue_in=std::make_shared< ECCOpQueue >()) |
| |
|
| GoblinUltraCircuitBuilder_ (std::shared_ptr< ECCOpQueue > op_queue_in) |
| |
|
void | finalize_circuit () |
| |
| void | add_gates_to_ensure_all_polys_are_non_zero () |
| | Ensure all polynomials have at least one non-zero coefficient to avoid commiting to the zero-polynomial.
|
| |
| size_t | get_num_constant_gates () const override |
| |
| size_t | get_num_gates () const override |
| | Get the final number of gates in a circuit, which consists of the sum of: 1) Current number number of actual gates 2) Number of public inputs, as we'll need to add a gate for each of them 3) Number of Rom array-associated gates 4) Number of range-list associated gates 5) Number of non-native field multiplication gates.
|
| |
| virtual void | print_num_gates () const override |
| | Print the number and composition of gates in the circuit.
|
| |
| void | set_public_calldata (const uint32_t witness_index) |
| |
|
void | create_poseidon2_external_gate (const poseidon2_external_gate_< FF > &in) |
| |
|
void | create_poseidon2_internal_gate (const poseidon2_internal_gate_< FF > &in) |
| |
|
FF | compute_poseidon2_external_identity (FF q_poseidon2_external_value, FF q_1_value, FF q_2_value, FF q_3_value, FF q_4_value, FF w_1_value, FF w_2_value, FF w_3_value, FF w_4_value, FF w_1_shifted_value, FF w_2_shifted_value, FF w_3_shifted_value, FF w_4_shifted_value, FF alpha_base, FF alpha) const |
| |
|
FF | compute_poseidon2_internal_identity (FF q_poseidon2_internal_value, FF q_1_value, FF w_1_value, FF w_2_value, FF w_3_value, FF w_4_value, FF w_1_shifted_value, FF w_2_shifted_value, FF w_3_shifted_value, FF w_4_shifted_value, FF alpha_base, FF alpha) const |
| |
|
bool | check_circuit () |
| |
|
WireVector & | w_l () |
| |
|
const WireVector & | w_l () const |
| |
|
WireVector & | w_r () |
| |
|
const WireVector & | w_r () const |
| |
|
WireVector & | w_o () |
| |
|
const WireVector & | w_o () const |
| |
|
WireVector & | w_4 () |
| |
|
const WireVector & | w_4 () const |
| |
|
SelectorVector & | q_m () |
| |
|
const SelectorVector & | q_m () const |
| |
|
SelectorVector & | q_c () |
| |
|
const SelectorVector & | q_c () const |
| |
|
SelectorVector & | q_1 () |
| |
|
const SelectorVector & | q_1 () const |
| |
|
SelectorVector & | q_2 () |
| |
|
const SelectorVector & | q_2 () const |
| |
|
SelectorVector & | q_3 () |
| |
|
const SelectorVector & | q_3 () const |
| |
|
SelectorVector & | q_4 () |
| |
|
const SelectorVector & | q_4 () const |
| |
|
SelectorVector & | q_arith () |
| |
|
const SelectorVector & | q_arith () const |
| |
|
SelectorVector & | q_sort () |
| |
|
const SelectorVector & | q_sort () const |
| |
|
SelectorVector & | q_elliptic () |
| |
|
const SelectorVector & | q_elliptic () const |
| |
|
SelectorVector & | q_aux () |
| |
|
const SelectorVector & | q_aux () const |
| |
|
SelectorVector & | q_lookup_type () |
| |
|
const SelectorVector & | q_lookup_type () const |
| |
|
void | process_non_native_field_multiplications () |
| | Called in compute_proving_key when finalizing circuit. Iterates over the cached_non_native_field_multiplication objects, removes duplicates, and instantiates the remainder as constraints`.
|
| |
|
| UltraCircuitBuilder_ (const size_t size_hint=0) |
| |
|
| UltraCircuitBuilder_ (const UltraCircuitBuilder_ &other)=default |
| |
|
| UltraCircuitBuilder_ (UltraCircuitBuilder_ &&other) |
| |
|
UltraCircuitBuilder_ & | operator= (const UltraCircuitBuilder_ &other)=default |
| |
|
UltraCircuitBuilder_ & | operator= (UltraCircuitBuilder_ &&other) |
| |
| void | check_selector_length_consistency () |
| | Debug helper method for ensuring all selectors have the same size.
|
| |
| void | finalize_circuit () |
| |
| void | add_gates_to_ensure_all_polys_are_non_zero () |
| | Ensure all polynomials have at least one non-zero coefficient to avoid commiting to the zero-polynomial.
|
| |
| void | create_add_gate (const add_triple_< FF > &in) override |
| | Create an addition gate, where in.a * in.a_scaling + in.b * in.b_scaling + in.c * in.c_scaling + in.const_scaling = 0.
|
| |
| void | create_big_add_gate (const add_quad_< FF > &in, const bool use_next_gate_w_4=false) |
| | Create a big addition gate, where in.a * in.a_scaling + in.b * in.b_scaling + in.c * in.c_scaling + in.d * in.d_scaling + in.const_scaling = 0. If include_next_gate_w_4 is enabled, then thes sum also adds the value of the 4-th witness at the next index.
|
| |
| void | create_big_add_gate_with_bit_extraction (const add_quad_< FF > &in) |
| | A legacy method that was used to extract a bit from c-4d by using gate selectors in the Turboplonk, but is simulated here for ultraplonk.
|
| |
| void | create_big_mul_gate (const mul_quad_< FF > &in) |
| | Create a basic multiplication gate q_m * a * b + q_1 * a + q_2 * b + q_3 * c + q_4 * d + q_c = 0 (q_arith = 1)
|
| |
|
void | create_balanced_add_gate (const add_quad_< FF > &in) |
| |
| void | create_mul_gate (const mul_triple_< FF > &in) override |
| | Create a multiplication gate with q_m * a * b + q_3 * c + q_const = 0.
|
| |
| void | create_bool_gate (const uint32_t a) override |
| | Generate an arithmetic gate equivalent to x^2 - x = 0, which forces x to be 0 or 1.
|
| |
| void | create_poly_gate (const poly_triple_< FF > &in) override |
| | A plonk gate with disabled (set to zero) fourth wire. q_m * a * b + q_1 * a + q_2 * b + q_3.
|
| |
| void | create_ecc_add_gate (const ecc_add_gate_< FF > &in) |
| | Create an elliptic curve addition gate.
|
| |
| void | create_ecc_dbl_gate (const ecc_dbl_gate_< FF > &in) |
| | Create an elliptic curve doubling gate.
|
| |
| void | fix_witness (const uint32_t witness_index, const FF &witness_value) |
| | Add a gate equating a particular witness to a constant, fixing it the value.
|
| |
| void | create_new_range_constraint (const uint32_t variable_index, const uint64_t target_range, std::string const msg="create_new_range_constraint") |
| | Constrain a variable to a range.
|
| |
| void | create_range_constraint (const uint32_t variable_index, const size_t num_bits, std::string const &msg) |
| |
|
accumulator_triple_< FF > | create_logic_constraint (const uint32_t a, const uint32_t b, const size_t num_bits, bool is_xor_gate) |
| |
|
accumulator_triple_< FF > | create_and_constraint (const uint32_t a, const uint32_t b, const size_t num_bits) |
| |
|
accumulator_triple_< FF > | create_xor_constraint (const uint32_t a, const uint32_t b, const size_t num_bits) |
| |
|
uint32_t | put_constant_variable (const FF &variable) |
| |
| size_t | get_num_constant_gates () const override |
| |
| void | get_num_gates_split_into_components (size_t &count, size_t &rangecount, size_t &romcount, size_t &ramcount, size_t &nnfcount) const |
| | Get the final number of gates in a circuit, which consists of the sum of: 1) Current number number of actual gates 2) Number of public inputs, as we'll need to add a gate for each of them 3) Number of Rom array-associated gates 4) Number of range-list associated gates 5) Number of non-native field multiplication gates.
|
| |
| size_t | get_num_gates () const override |
| | Get the final number of gates in a circuit, which consists of the sum of: 1) Current number number of actual gates 2) Number of public inputs, as we'll need to add a gate for each of them 3) Number of Rom array-associated gates 4) Number of range-list associated gates 5) Number of non-native field multiplication gates.
|
| |
| size_t | get_total_circuit_size () const |
| | Get the size of the circuit if it was finalized now.
|
| |
| virtual void | print_num_gates () const override |
| | Print the number and composition of gates in the circuit.
|
| |
|
void | assert_equal_constant (const uint32_t a_idx, const FF &b, std::string const &msg="assert equal constant") |
| |
| void | add_table_column_selector_poly_to_proving_key (barretenberg::polynomial &small, const std::string &tag) |
| |
|
void | initialize_precomputed_table (const plookup::BasicTableId id, bool(*generator)(std::vector< FF > &, std::vector< FF > &, std::vector< FF > &), std::array< FF, 2 >(*get_values_from_key)(const std::array< uint64_t, 2 >)) |
| |
|
plookup::BasicTable & | get_table (const plookup::BasicTableId id) |
| |
|
plookup::MultiTable & | create_table (const plookup::MultiTableId id) |
| |
|
plookup::ReadData< uint32_t > | create_gates_from_plookup_accumulators (const plookup::MultiTableId &id, const plookup::ReadData< FF > &read_values, const uint32_t key_a_index, std::optional< uint32_t > key_b_index=std::nullopt) |
| | Perform a series of lookups, one for each 'row' in read_values.
|
| |
| std::vector< uint32_t > | decompose_into_default_range (const uint32_t variable_index, const uint64_t num_bits, const uint64_t target_range_bitnum=DEFAULT_PLOOKUP_RANGE_BITNUM, std::string const &msg="decompose_into_default_range") |
| |
|
std::vector< uint32_t > | decompose_into_default_range_better_for_oddlimbnum (const uint32_t variable_index, const size_t num_bits, std::string const &msg="decompose_into_default_range_better_for_oddlimbnum") |
| |
|
void | create_dummy_constraints (const std::vector< uint32_t > &variable_index) |
| |
|
void | create_sort_constraint (const std::vector< uint32_t > &variable_index) |
| |
|
void | create_sort_constraint_with_edges (const std::vector< uint32_t > &variable_index, const FF &, const FF &) |
| |
|
void | assign_tag (const uint32_t variable_index, const uint32_t tag) |
| |
|
uint32_t | create_tag (const uint32_t tag_index, const uint32_t tau_index) |
| |
|
uint32_t | get_new_tag () |
| |
| RangeList | create_range_list (const uint64_t target_range) |
| |
|
void | process_range_list (RangeList &list) |
| |
|
void | process_range_lists () |
| |
| void | apply_aux_selectors (const AUX_SELECTORS type) |
| | Enable the auxilary gate of particular type.
|
| |
| void | range_constrain_two_limbs (const uint32_t lo_idx, const uint32_t hi_idx, const size_t lo_limb_bits=DEFAULT_NON_NATIVE_FIELD_LIMB_BITS, const size_t hi_limb_bits=DEFAULT_NON_NATIVE_FIELD_LIMB_BITS) |
| |
| std::array< uint32_t, 2 > | decompose_non_native_field_double_width_limb (const uint32_t limb_idx, const size_t num_limb_bits=(2 *DEFAULT_NON_NATIVE_FIELD_LIMB_BITS)) |
| | Decompose a single witness into two, where the lowest is DEFAULT_NON_NATIVE_FIELD_LIMB_BITS (68) range constrained and the lowst is num_limb_bits - DEFAULT.. range constrained.
|
| |
| std::array< uint32_t, 2 > | evaluate_non_native_field_multiplication (const non_native_field_witnesses< FF > &input, const bool range_constrain_quotient_and_remainder=true) |
| | Queue up non-native field multiplication data.
|
| |
| std::array< uint32_t, 2 > | queue_partial_non_native_field_multiplication (const non_native_field_witnesses< FF > &input) |
| |
| std::array< uint32_t, 5 > | evaluate_non_native_field_subtraction (add_simple limb0, add_simple limb1, add_simple limb2, add_simple limb3, std::tuple< uint32_t, uint32_t, FF > limbp) |
| |
| std::array< uint32_t, 5 > | evaluate_non_native_field_addition (add_simple limb0, add_simple limb1, add_simple limb2, add_simple limb3, std::tuple< uint32_t, uint32_t, FF > limbp) |
| |
| size_t | create_ROM_array (const size_t array_size) |
| | Create a new read-only memory region.
|
| |
| void | set_ROM_element (const size_t rom_id, const size_t index_value, const uint32_t value_witness) |
| | Initialize a rom cell to equal value_witness
|
| |
| void | set_ROM_element_pair (const size_t rom_id, const size_t index_value, const std::array< uint32_t, 2 > &value_witnesses) |
| | Initialize a ROM array element with a pair of witness values.
|
| |
| uint32_t | read_ROM_array (const size_t rom_id, const uint32_t index_witness) |
| | Read a single element from ROM.
|
| |
| std::array< uint32_t, 2 > | read_ROM_array_pair (const size_t rom_id, const uint32_t index_witness) |
| | Read a pair of elements from ROM.
|
| |
| void | create_ROM_gate (RomRecord &record) |
| | Gate that'reads' from a ROM table. i.e. table index is a witness not precomputed.
|
| |
| void | create_sorted_ROM_gate (RomRecord &record) |
| | Gate that performs consistency checks to validate that a claimed ROM read value is correct.
|
| |
| void | process_ROM_array (const size_t rom_id) |
| | Compute additional gates required to validate ROM reads. Called when generating the proving key.
|
| |
|
void | process_ROM_arrays () |
| |
| void | create_RAM_gate (RamRecord &record) |
| | Gate that performs a read/write operation into a RAM table. i.e. table index is a witness not precomputed.
|
| |
| void | create_sorted_RAM_gate (RamRecord &record) |
| | Gate that performs consistency checks to validate that a claimed RAM read/write value is correct.
|
| |
| void | create_final_sorted_RAM_gate (RamRecord &record, const size_t ram_array_size) |
| | Performs consistency checks to validate that a claimed RAM read/write value is correct. Used for the final gate in a list of sorted RAM records.
|
| |
| size_t | create_RAM_array (const size_t array_size) |
| | Create a new updatable memory region.
|
| |
| void | init_RAM_element (const size_t ram_id, const size_t index_value, const uint32_t value_witness) |
| | Initialize a RAM cell to equal value_witness
|
| |
|
uint32_t | read_RAM_array (const size_t ram_id, const uint32_t index_witness) |
| |
|
void | write_RAM_array (const size_t ram_id, const uint32_t index_witness, const uint32_t value_witness) |
| |
| void | process_RAM_array (const size_t ram_id) |
| | Compute additional gates required to validate RAM read/writes. Called when generating the proving key.
|
| |
|
void | process_RAM_arrays () |
| |
| FF | compute_arithmetic_identity (FF q_arith_value, FF q_1_value, FF q_2_value, FF q_3_value, FF q_4_value, FF q_m_value, FF q_c_value, FF w_1_value, FF w_2_value, FF w_3_value, FF w_4_value, FF w_1_shifted_value, FF w_4_shifted_value, const FF alpha_base, const FF alpha) const |
| | Arithmetic gate-related methods.
|
| |
| FF | compute_auxilary_identity (FF q_aux_value, FF q_arith_value, FF q_1_value, FF q_2_value, FF q_3_value, FF q_4_value, FF q_m_value, FF q_c_value, FF w_1_value, FF w_2_value, FF w_3_value, FF w_4_value, FF w_1_shifted_value, FF w_2_shifted_value, FF w_3_shifted_value, FF w_4_shifted_value, FF alpha_base, FF alpha, FF eta) const |
| | Plookup Auxiliary Gate Identity.
|
| |
| FF | compute_elliptic_identity (FF q_elliptic_value, FF q_1_value, FF q_m_value, FF w_2_value, FF w_3_value, FF w_1_shifted_value, FF w_2_shifted_value, FF w_3_shifted_value, FF w_4_shifted_value, FF alpha_base, FF alpha) const |
| | Elliptic curve identity gate methods implement elliptic curve point addition.
|
| |
| FF | compute_genperm_sort_identity (FF q_sort_value, FF w_1_value, FF w_2_value, FF w_3_value, FF w_4_value, FF w_1_shifted_value, FF alpha_base, FF alpha) const |
| | General permutation sorting identity.
|
| |
| bool | check_circuit () |
| | Check that the circuit is correct in its current state.
|
| |
|
| CircuitBuilderBase (size_t size_hint=0) |
| |
|
| CircuitBuilderBase (const CircuitBuilderBase &other)=default |
| |
|
| CircuitBuilderBase (CircuitBuilderBase &&other) noexcept=default |
| |
|
CircuitBuilderBase & | operator= (const CircuitBuilderBase &other)=default |
| |
|
CircuitBuilderBase & | operator= (CircuitBuilderBase &&other) noexcept=default |
| |
| virtual size_t | get_num_gates () const |
| |
| virtual void | print_num_gates () const |
| |
|
virtual size_t | get_num_variables () const |
| |
| virtual void | create_add_gate (const add_triple_< FF > &in)=0 |
| |
| virtual void | create_mul_gate (const mul_triple_< FF > &in)=0 |
| |
| virtual void | create_bool_gate (const uint32_t a)=0 |
| |
| virtual void | create_poly_gate (const poly_triple_< FF > &in)=0 |
| |
|
virtual size_t | get_num_constant_gates () const=0 |
| |
| uint32_t | get_first_variable_in_class (uint32_t index) const |
| |
| void | update_real_variable_indices (uint32_t index, uint32_t new_real_index) |
| |
| FF | get_variable (const uint32_t index) const |
| |
| const FF & | get_variable_reference (const uint32_t index) const |
| |
|
uint32_t | get_public_input_index (const uint32_t witness_index) const |
| |
|
FF | get_public_input (const uint32_t index) const |
| |
|
std::vector< FF > | get_public_inputs () const |
| |
| virtual uint32_t | add_variable (const FF &in) |
| |
| virtual void | set_variable_name (uint32_t index, const std::string &name) |
| |
| virtual void | update_variable_names (uint32_t index) |
| |
| virtual void | finalize_variable_names () |
| |
| virtual msgpack::sbuffer | export_circuit () |
| |
| virtual uint32_t | add_public_variable (const FF &in) |
| |
| virtual void | set_public_input (const uint32_t witness_index) |
| |
| virtual void | assert_equal (const uint32_t a_idx, const uint32_t b_idx, std::string const &msg="assert_equal") |
| |
|
size_t | get_circuit_subgroup_size (const size_t num_gates) const |
| |
|
size_t | get_num_public_inputs () const |
| |
|
void | assert_valid_variables (const std::vector< uint32_t > &variable_indices) |
| |
|
bool | is_valid_variable (uint32_t variable_index) |
| |
| void | add_recursive_proof (const std::vector< uint32_t > &proof_output_witness_indices) |
| | Add information about which witnesses contain the recursive proof computation information.
|
| |
| void | set_recursive_proof (const std::vector< uint32_t > &proof_output_witness_indices) |
| | Update recursive_proof_public_input_indices with existing public inputs that represent a recursive proof.
|
| |
|
bool | failed () const |
| |
|
const std::string & | err () const |
| |
|
void | set_err (std::string msg) |
| |
|
void | failure (std::string msg) |
| |