Skip to content

Commit

Permalink
Merge pull request #155 from keep-network/vss-normalize
Browse files Browse the repository at this point in the history
Do not normalize IDs of Shamir's Secret Sharing
  • Loading branch information
yycen authored Dec 10, 2021
2 parents 681ebad + 2718fca commit cd95cee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/vss/feldman_vss.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
// Check share ids of Shamir's Secret Sharing, return error if duplicate or 0 value found
func CheckIndexes(ec elliptic.Curve, indexes []*big.Int) ([]*big.Int, error) {
visited := make(map[string]struct{})
for i, v := range indexes {
for _, v := range indexes {
vMod := new(big.Int).Mod(v, ec.Params().N)
if vMod.Cmp(zero) == 0 {
return nil, errors.New("party index should not be 0")
Expand All @@ -52,7 +52,6 @@ func CheckIndexes(ec elliptic.Curve, indexes []*big.Int) ([]*big.Int, error) {
return nil, fmt.Errorf("duplicate indexes %s", vModStr)
}
visited[vModStr] = struct{}{}
indexes[i] = vMod
}
return indexes, nil
}
Expand Down

0 comments on commit cd95cee

Please sign in to comment.