Skip to content

Commit 2324648

Browse files
committed
fix String methods
1 parent 8ee0391 commit 2324648

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: bn256/bn256.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func RandomG1(r io.Reader) (*big.Int, *G1, error) {
5555

5656
func (e *G1) String() string {
5757
if e.p == nil {
58-
e.p = newCurvePoint(nil)
58+
return "bn256.G1" + newCurvePoint(nil).String()
5959
}
6060
return "bn256.G1" + e.p.String()
6161
}
@@ -179,7 +179,7 @@ func RandomG2(r io.Reader) (*big.Int, *G2, error) {
179179

180180
func (e *G2) String() string {
181181
if e.p == nil {
182-
e.p = newTwistPoint(nil)
182+
return "bn256.G2" + newTwistPoint(nil).String()
183183
}
184184
return "bn256.G2" + e.p.String()
185185
}
@@ -285,7 +285,7 @@ type GT struct {
285285

286286
func (e *GT) String() string {
287287
if e.p == nil {
288-
e.p = newGFp12(nil)
288+
return "bn256.GT" + newGFp12(nil).String()
289289
}
290290
return "bn256.GT" + e.p.String()
291291
}

0 commit comments

Comments
 (0)