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

Function array_padded_with

pub fn array_padded_with<T, let N: u32>(
    array: [T; N],
    from_index: u32,
    padded_with: T,
) -> bool
where T: Eq

Returns true iff every element of array at index >= from_index equals padded_with.

from_index must be a valid index into the array, i.e. from_index <= N (the boundary from_index == N denotes a full prefix with no padding). Passing from_index > N is rejected: otherwise this check would pass vacuously (the loop never reaches from_index), letting a caller believe the array holds a from_index-length prefix followed by padding even though the array is shorter than from_index.