pub fn confine_array_index(index: usize, size: usize) -> usize
returns index if index < size, or 0 if index >= size. Immune to speculative execution information leak bugs such as Spectre V1.
index
index < size
0
index >= size