mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 04:44:28 +00:00
Clarify order-of-operations in shuffling
This commit is contained in:
@@ -41,7 +41,7 @@ pub fn get_permutated_index(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn do_round(seed: &[u8], index: usize, pivot: usize, round: u8, list_size: usize) -> Option<usize> {
|
fn do_round(seed: &[u8], index: usize, pivot: usize, round: u8, list_size: usize) -> Option<usize> {
|
||||||
let flip = (pivot + list_size - index) % list_size;
|
let flip = (pivot + (list_size - index)) % list_size;
|
||||||
let position = max(index, flip);
|
let position = max(index, flip);
|
||||||
let source = hash_with_round_and_position(seed, round, position)?;
|
let source = hash_with_round_and_position(seed, round, position)?;
|
||||||
let byte = source[(position % 256) / 8];
|
let byte = source[(position % 256) / 8];
|
||||||
|
|||||||
Reference in New Issue
Block a user