Skip to content

Commit

Permalink
fix fuzzers
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Sep 21, 2023
1 parent c658aca commit c9968fe
Show file tree
Hide file tree
Showing 27 changed files with 249 additions and 249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ field_t<Builder> keccak<Builder>::normalize_and_rotate(const field_ct& limb, fie
compute_lookup_witnesses_for_limb.template operator()<right_bits, num_right_tables>(right_normalized);
compute_lookup_witnesses_for_limb.template operator()<left_bits, num_left_tables>(left_normalized);

// Call composer method to create plookup constraints.
// Call builder method to create plookup constraints.
// The MultiTable table index can be derived from `lane_idx`
// Each lane_idx has a different rotation amount, which changes sizes of left/right slices
// and therefore the selector constants required (i.e. the Q1, Q2, Q3 values in the earlier example)
Expand Down Expand Up @@ -320,7 +320,7 @@ template <typename Builder> void keccak<Builder>::theta(keccak_state& internal)
// | hi | mid | lo | X |
// | P0 | P1 | P2 | Y |
// To save a gate, we would need to place the wires for the first KECCAK_THETA_OUTPUT plookup gate
// at P0, P1, P2. This is fiddly composer logic that is circuit-width-dependent
// at P0, P1, P2. This is fiddly builder logic that is circuit-width-dependent
// (this would save 120 gates per hash block... not worth making the code less readable for that)
D[i] = plookup_read<Builder>::read_from_1_to_2_table(KECCAK_THETA_OUTPUT, mid);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ template <typename Builder> class pedersen_gates {
context->create_fixed_group_add_gate(in);
} else {

// TODO: not supported by honk composer?
// TODO: not supported by honk builder?
// context->assert_valid_variables({ in.a, in.b, in.c, in.d });

auto row_1 = previous_add_quad;
Expand Down Expand Up @@ -247,7 +247,7 @@ template <typename Builder> class pedersen_gates {
fr q_c = init.q_y_2;

// We will think of s = 1-a_0 as an auxiliary "switch" which is equal to either -x_alpha or 0
// during the initialization step, but we will not add this variable to the composer for reasons of
// during the initialization step, but we will not add this variable to the builder for reasons of
// efficiency.

// (ɑ^4 identity) impose 1-a_0 = 0 or -x_alpha
Expand Down
24 changes: 12 additions & 12 deletions barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ template <typename Builder> using bit_vector = std::vector<bool_t<Builder>>;
* @param index: The index of any leaf in the subtree,
* @param at_height: The height of the subtree,
* @param is_updating_tree: set to true if we're updating the tree.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*
* @see Check full documentation: https://hackmd.io/2zyJc6QhRuugyH8D78Tbqg?view
*/
Expand Down Expand Up @@ -57,7 +57,7 @@ field_t<Builder> compute_subtree_root(hash_path<Builder> const& hashes,
* @param index: The index of any leaf in the subtree,
* @param at_height: The height of the subtree,
* @param is_updating_tree: set to true if we're updating the tree.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*
* @see Check full documentation: https://hackmd.io/2zyJc6QhRuugyH8D78Tbqg?view
*/
Expand All @@ -83,7 +83,7 @@ bool_t<Builder> check_subtree_membership(field_t<Builder> const& root,
* @param at_height: The height of the subtree,
* @param is_updating_tree: set to true if we're updating the tree,
* @param msg: error message.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void assert_check_subtree_membership(field_t<Builder> const& root,
Expand All @@ -107,7 +107,7 @@ void assert_check_subtree_membership(field_t<Builder> const& root,
* @param value: The value of the leaf,
* @param index: The index of the leaf in the tree,
* @param is_updating_tree: set to true if we're updating the tree.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
bool_t<Builder> check_membership(field_t<Builder> const& root,
Expand All @@ -129,7 +129,7 @@ bool_t<Builder> check_membership(field_t<Builder> const& root,
* @param index: The index of the leaf in the tree,
* @param is_updating_tree: set to true if we're updating the tree,
* @param msg: error message.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void assert_check_membership(field_t<Builder> const& root,
Expand All @@ -154,7 +154,7 @@ void assert_check_membership(field_t<Builder> const& root,
* @param old_value: The value of the leaf before it was updated with new_value,
* @param index: The index of the leaf in the tree,
* @param msg: error message.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void update_membership(field_t<Builder> const& new_root,
Expand All @@ -181,7 +181,7 @@ void update_membership(field_t<Builder> const& new_root,
* @param old_values: The values of the existing leaves that were updated,
* @param old_paths: The hash path from the given index right before a given existing leaf is updated,
* @param old_indicies: Indices of the existing leaves that need to be updated,
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
field_t<Builder> update_memberships(field_t<Builder> old_root,
Expand Down Expand Up @@ -213,7 +213,7 @@ field_t<Builder> update_memberships(field_t<Builder> old_root,
* @param index: The index of any leaf in the subtree,
* @param at_height: The height of the subtree,
* @param msg: error message.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void update_subtree_membership(field_t<Builder> const& new_root,
Expand All @@ -240,7 +240,7 @@ void update_subtree_membership(field_t<Builder> const& new_root,
* Computes the root of a tree with leaves given as the vector `input`.
*
* @param input: vector of leaf values.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder> field_t<Builder> compute_tree_root(std::vector<field_t<Builder>> const& input)
{
Expand All @@ -263,7 +263,7 @@ template <typename Builder> field_t<Builder> compute_tree_root(std::vector<field
* Checks if a given root matches the root computed from a set of leaves.
*
* @param values: vector of leaf values.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
bool_t<Builder> check_tree(field_t<Builder> const& root, std::vector<field_t<Builder>> const& values)
Expand All @@ -275,7 +275,7 @@ bool_t<Builder> check_tree(field_t<Builder> const& root, std::vector<field_t<Bui
* Asserts if a given root matches the root computed from a set of leaves.
*
* @param values: vector of leaf values.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void assert_check_tree(field_t<Builder> const& root, std::vector<field_t<Builder>> const& values)
Expand All @@ -293,7 +293,7 @@ void assert_check_tree(field_t<Builder> const& root, std::vector<field_t<Builder
* @param new_values: The vector of values to be inserted from start_index,
* @param start_index: The index of any leaf from which new values are inserted,
* @param msg: error message.
* @tparam Builder: type of composer.
* @tparam Builder: type of builder.
*/
template <typename Builder>
void batch_update_membership(field_t<Builder> const& new_root,
Expand Down
Loading

0 comments on commit c9968fe

Please sign in to comment.