Skip to content

Commit

Permalink
Remove unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
K1li4nL committed Jun 12, 2024
1 parent e5c76c5 commit ac0ecb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions share/poly.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func xyScalar(g kyber.Group, shares []*PriShare, t, n int) (map[int]kyber.Scalar
x := make(map[int]kyber.Scalar)
y := make(map[int]kyber.Scalar)
for _, s := range sorted {
if s == nil || s.V == nil || s.I < 0 {
if s == nil || s.V == nil {
continue
}
idx := int(s.I)
Expand Down Expand Up @@ -429,7 +429,7 @@ func xyCommit(g kyber.Group, shares []*PubShare, t, n int) (map[int]kyber.Scalar
y := make(map[int]kyber.Point)

for _, s := range sorted {
if s == nil || s.V == nil || s.I < 0 {
if s == nil || s.V == nil {
continue
}
idx := int(s.I)
Expand Down
2 changes: 1 addition & 1 deletion share/vss/rabin/vss.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ func (a *aggregator) VerifyDeal(d *Deal, inclusion bool) error {
if fi.I != gi.I {
return errors.New("vss: not the same index for f and g share in Deal")
}
if fi.I < 0 || fi.I >= uint32(len(a.verifiers)) {
if fi.I >= uint32(len(a.verifiers)) {
return errors.New("vss: index out of bounds in Deal")
}
// compute fi * G + gi * H
Expand Down

0 comments on commit ac0ecb3

Please sign in to comment.