Skip to content

Commit

Permalink
Merge pull request #634 from paulhauner/patch-10
Browse files Browse the repository at this point in the history
Add explicit assert to get_permutated_index
  • Loading branch information
djrtwo authored Feb 18, 2019
2 parents 9dcc6b8 + 2e6bf87 commit 75e649c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ def get_permuted_index(index: int, list_size: int, seed: Bytes32) -> int:
See the 'generalized domain' algorithm on page 3.
"""
assert index < list_size
assert list_size <= 2**40

for round in range(SHUFFLE_ROUND_COUNT):
pivot = bytes_to_int(hash(seed + int_to_bytes1(round))[0:8]) % list_size
Expand Down

0 comments on commit 75e649c

Please sign in to comment.