Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix verify_bitfield #573

Merged
merged 3 commits into from
Feb 6, 2019
Merged

Fix verify_bitfield #573

merged 3 commits into from
Feb 6, 2019

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Feb 5, 2019

Issues

  1. When committee_size is 16, the bitfield length is 2, and then get_bitfield_bit(bitfield, committee_size) is out of range.
  2. If committee_size % 8 != 0, the padding zero should be added from index=committee_size in bitfield.

Fixes

  1. Only check the padding zeros when committee_size % 8 != 0, otherwise it will trigger IndexError.
  2. Check the zero padding bits from the bitfield index committee_size. (it was starting from committee_size + 1)

@JustinDrake JustinDrake self-requested a review February 5, 2019 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants