|
|
|
@ -267,7 +267,7 @@ func (g *G2) Affine(p *PointG2) *PointG2 { |
|
|
|
|
|
|
|
|
|
// Add adds two G2 points p1, p2 and assigns the result to point at first argument.
|
|
|
|
|
func (g *G2) Add(r, p1, p2 *PointG2) *PointG2 { |
|
|
|
|
// http://www.hyperelliptic.org/EFD/gp/auto-shortw-jacobian-0.html#addition-add-2007-bl
|
|
|
|
|
// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-2007-bl
|
|
|
|
|
if g.IsZero(p1) { |
|
|
|
|
return r.Set(p2) |
|
|
|
|
} |
|
|
|
@ -315,7 +315,7 @@ func (g *G2) Add(r, p1, p2 *PointG2) *PointG2 { |
|
|
|
|
|
|
|
|
|
// Double doubles a G2 point p and assigns the result to the point at first argument.
|
|
|
|
|
func (g *G2) Double(r, p *PointG2) *PointG2 { |
|
|
|
|
// http://www.hyperelliptic.org/EFD/gp/auto-shortw-jacobian-0.html#doubling-dbl-2009-l
|
|
|
|
|
// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l
|
|
|
|
|
if g.IsZero(p) { |
|
|
|
|
return r.Set(p) |
|
|
|
|
} |
|
|
|
|