diff --git a/eth2/utils/swap_or_not_shuffle/src/get_permutated_index.rs b/eth2/utils/swap_or_not_shuffle/src/get_permutated_index.rs index f6b8065f89..8c62961805 100644 --- a/eth2/utils/swap_or_not_shuffle/src/get_permutated_index.rs +++ b/eth2/utils/swap_or_not_shuffle/src/get_permutated_index.rs @@ -41,7 +41,7 @@ pub fn get_permutated_index( } fn do_round(seed: &[u8], index: usize, pivot: usize, round: u8, list_size: usize) -> Option { - let flip = (pivot + list_size - index) % list_size; + let flip = (pivot + (list_size - index)) % list_size; let position = max(index, flip); let source = hash_with_round_and_position(seed, round, position)?; let byte = source[(position % 256) / 8];