func (curve *secp256k1Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) {
	z1 := zForAffine(x1, y1)
	z2 := zForAffine(x2, y2)
	return curve.affineFromJacobian(curve.addJacobian(x1, y1, z1, x2, y2, z2))
}
Add -- returns the sum of (x1,y1) and (x2,y2).
package secp256k1
import (
	"crypto/elliptic"
	"math/big"
	"sync"
)
var (
	initonce  sync.Once
	secp256k1 *secp256k1Curve
	three     = new(big.Int).SetUint64(3)
)
type secp256k1Curve struct {
	elliptic.CurveParams
}
func initSECP256K1() {
	secp256k1 = &secp256k1Curve{elliptic.CurveParams{Name: "secp256k1"}}
	secp256k1.P, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", 16)
	secp256k1.N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
	secp256k1.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000000000000000000000000000007", 16)
	secp256k1.Gx, _ = new(big.Int).SetString("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", 16)
	secp256k1.Gy, _ = new(big.Int).SetString("483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", 16)
	secp256k1.BitSize = 256
}
func SECP256K1() elliptic.Curve {
	initonce.Do(initSECP256K1)
	return secp256k1
}
func (curve *secp256k1Curve) Params() *elliptic.CurveParams {
	return &curve.CurveParams
}
func (curve *secp256k1Curve) IsOnCurve(x, y *big.Int) bool {
	var y2, x3 big.Int
	y2.Mul(y, y)          
	y2.Mod(&y2, curve.P)  
	x3.Mul(x, x)          
	x3.Mul(&x3, x)        
	x3.Add(&x3, curve.B)  
	x3.Mod(&x3, curve.P)  
	return x3.Cmp(&y2) == 0
}
func zForAffine(x, y *big.Int) *big.Int {
	z := new(big.Int)
	if x.Sign() != 0 || y.Sign() != 0 {
		z.SetInt64(1)
	}
	return z
}
func (curve *secp256k1Curve) affineFromJacobian(x, y, z *big.Int) (xOut, yOut *big.Int) {
	if z.Sign() == 0 {
		return new(big.Int), new(big.Int)
	}
	zinv := new(big.Int).ModInverse(z, curve.P)
	zinvsq := new(big.Int).Mul(zinv, zinv)
	xOut = new(big.Int).Mul(x, zinvsq)
	xOut.Mod(xOut, curve.P)
	zinvsq.Mul(zinvsq, zinv)
	yOut = new(big.Int).Mul(y, zinvsq)
	yOut.Mod(yOut, curve.P)
	return
}