Skip to content

Commit

Permalink
Fix createSortitionHash description
Browse files Browse the repository at this point in the history
Explicitly define 'i' as the index of the committee member to extract

Fix lint
  • Loading branch information
fed-franz committed Apr 5, 2023
1 parent 4432b01 commit a888566
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/core/consensus/user/sortition.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ func (v VotingCommittee) MarshalJSON() ([]byte, error) {
return json.Marshal(data)
}

// createSortitionHash takes Seed value 'seed', round number 'round', step number 'step', and iteration number 'i',
// and returns the SHA3-256 hash of their concatenation (i.e., H(round||i||step||seed)).
// createSortitionHash takes the Seed value 'seed', the round number 'round', the step number 'step',
// the index 'i' of the committee member to extract,
// and returns the hash (SHA3-256) of their concatenation (i.e., H(round||i||step||seed)).
func createSortitionHash(seed []byte, round uint64, step uint8, i int) ([]byte, error) {
msg := make([]byte, 12)

Expand Down

0 comments on commit a888566

Please sign in to comment.