Skip to content

Commit

Permalink
pedersen x range bug fix (NethermindEth#595)
Browse files Browse the repository at this point in the history
Co-authored-by: rian <[email protected]>
  • Loading branch information
rianhughes and rian authored Jul 18, 2024
1 parent 98f77d7 commit 20b9a51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curve/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func (sc StarkCurve) PedersenHash(elems []*big.Int) (hash *big.Int, err error) {
for i, elem := range elems {
x := new(big.Int).Set(elem)

if x.Cmp(big.NewInt(0)) != -1 && x.Cmp(sc.P) != -1 {
if x.Cmp(big.NewInt(0)) == -1 || x.Cmp(sc.P) >= 0 {
return ptx, fmt.Errorf("invalid x: %v", x)
}

Expand Down

0 comments on commit 20b9a51

Please sign in to comment.