Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
  • Loading branch information
jsign committed Dec 4, 2023
1 parent 4d343c5 commit 2d144e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions banderwagon/element.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ func (p *Element) SetBytesUncompressed(buf []byte, trusted bool) error {
x.SetBytes(buf[:coordinateSize])

var y fp.Element
// subgroup check
// point in curve & subgroup check
if !trusted {
point := bandersnatch.GetPointFromX(&x, true)
if point == nil {
return fmt.Errorf("point not in the curve")
}
calcualtedYBytes := point.Y.Bytes()
if !bytes.Equal(calcualtedYBytes[:], buf[coordinateSize:]) {
calculatedYBytes := point.Y.Bytes()
if !bytes.Equal(calculatedYBytes[:], buf[coordinateSize:]) {
return fmt.Errorf("provided Y coordinate doesn't correspond to X")
}
y = point.Y
Expand Down

0 comments on commit 2d144e7

Please sign in to comment.