For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::protocol::utils::arrays

Module arrays

Structs

  • ClaimedLengthArray - An array interpreted by Kernel circuits. Its length is merely a claim that must eventually be validated. Validation must include:

    • Asserting all items to the LHS of the length are nonempty (dense).
    • Asserting all items to the RHS of the length are empty.

Functions

  • Helper function to count the number of non-empty elements in a validated array. Danger: This is only safe to call if the input arrays have been "validated" (dense lhs, empty rhs).

    1. All elements before the first empty element are non-empty
    2. All elements after and including the first empty element are empty
    3. The array forms a contiguous sequence of non-empty elements followed by empty elements
  • Returns true iff every element of array at index >= from_index equals padded_with.
  • Asserts that all fields in input after the first in_len fields are zero.
  • Helper function to find the index of the first element in an array that satisfies a given predicate. If the element is not found, the function returns the length of the array N
  • Helper function to find the index of the last element in an array that satisfies a given predicate. If the element is not found, the function returns the length of the array N
  • Sorts the input array, but also outputs an original_index field for each sorted item, so that you know where it came from.
  • Splices two fixed-size arrays at count.
  • Helper fn to create a subarray from a given array.