Skip to content

Commit

Permalink
use curveB constant in g(x)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincharm committed Mar 2, 2024
1 parent cfdae42 commit f26d313
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pairing/bn254/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var p = bigFromBase10("218882428718392752222464057452572750886963111572978236626
// p2 is p, represented as little-endian 64-bit words.
var p2 = [4]uint64{0x3c208c16d87cfd47, 0x97816a916871ca8d, 0xb85045b68181585d, 0x30644e72e131a029}

var curveB = newGFp(3)

// np is the negative inverse of p, mod 2^256.
var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b}

Expand Down
4 changes: 1 addition & 3 deletions pairing/bn254/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ type curvePoint struct {
x, y, z, t gfP
}

var curveB = newGFp(3)

// curveGen is the generator of G₁.
var curveGen = &curvePoint{
x: *newGFp(1),
Expand All @@ -26,7 +24,7 @@ func g(x *gfP) *gfP {
y := &gfP{}
gfpMul(y, x, x)
gfpMul(y, y, x)
gfpAdd(y, y, newGFp(3))
gfpAdd(y, y, curveB)
return y
}

Expand Down

0 comments on commit f26d313

Please sign in to comment.