Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey returns a public/private key pair. The private key is generated using the given reader, which must return random data.
Types ¶
type SM2Curve ¶
type SM2Curve interface { // Params returns the parameters for the curve. Params() *elliptic.CurveParams SM2Params() *SM2CurveParams // IsOnCurve reports whether the given (x,y) lies on the curve. IsOnCurve(x, y *big.Int) bool // Add returns the sum of (x1,y1) and (x2,y2) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) // Double returns 2*(x,y) Double(x1, y1 *big.Int) (x, y *big.Int) // ScalarMult returns k*(Bx,By) where k is a number in big-endian form. ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int) // ScalarBaseMult returns k*G, where G is the base point of the group // and k is an integer in big-endian form. ScalarBaseMult(k []byte) (x, y *big.Int) }
type SM2CurveParams ¶
type SM2CurveParams struct { P *big.Int // the order of the underlying field N *big.Int // the order of the base point A *big.Int // the A constant of the curve equation B *big.Int // the B constant of the curve equation Gx, Gy *big.Int // (x,y) of the base point BitSize int // the size of the underlying field Name string // the canonical name of the curve }
A Curve represents a sm2 curve which a should be a big prime SM2 Standards: http://www.oscca.gov.cn/News/201012/News_1197.htm
Click to show internal directories.
Click to hide internal directories.