Skip to content

Commit

Permalink
EcSub for Bip340 should keep the Y coordinate in the field order
Browse files Browse the repository at this point in the history
This does not make any difference to the result but it is preferable to
stay in the field order for the clarity's sake.
  • Loading branch information
pdyraga committed Jan 8, 2024
1 parent e5e8ca7 commit e16596e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frost/bip340.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (bc *Bip340Curve) EcAdd(a *Point, b *Point) *Point {

// EcSub returns the subtraction of two elliptic curve points.
func (bc *Bip340Curve) EcSub(a *Point, b *Point) *Point {
bNeg := &Point{b.X, new(big.Int).Neg(b.Y)}
bNeg := &Point{b.X, new(big.Int).Sub(bc.Params().P, b.Y)}
return bc.EcAdd(a, bNeg)
}

Expand Down

0 comments on commit e16596e

Please sign in to comment.