Versions in this module Expand all Collapse all v1 v1.0.1 Nov 17, 2019 v1.0.0 Nov 17, 2019 Changes in this version + const BitSize + const KeyBytes + const UnCompressed + func GenKey(rand io.Reader) (*PrivKey, *PubKey, error) + func IsPointInfinity(x, y *big.Int) bool + func MarshalEncryptedToASN1DER(in []byte) ([]byte, error) + func UnmarshalEncryptedFromASN1DER(in []byte) ([]byte, error) + type ASN1DERCipher struct + C2 []byte + C3 []byte + X *big.Int + Y *big.Int + type Curve struct + A *big.Int + RInverse *big.Int + func GetSm2P256() Curve + func Init(A *big.Int, RInverse *big.Int, givenCurveParams *elliptic.CurveParams) *Curve + func InitWithRecommendedParams() *Curve + type PrivKey struct + Curve Curve + D *big.Int + func (sk *PrivKey) Decrypt(in []byte) ([]byte, error) + func (sk *PrivKey) GenPubKey() *PubKey + func (sk *PrivKey) Sign(userID []byte, data []byte) ([]byte, error) + func (sk *PrivKey) SignToASN1DER(userID []byte, msg []byte) ([]byte, error) + func (sk *PrivKey) SignToBigInt(userID []byte, msg []byte) (r, s *big.Int, err error) + func (sk *PrivKey) String() string + func (sk *PrivKey) ToBytes() []byte + type PubKey struct + Curve Curve + X *big.Int + Y *big.Int + func (pk *PubKey) Encrypt(msg []byte) ([]byte, error) + func (pk *PubKey) String() string + func (pk *PubKey) ToBytes() []byte + func (pk *PubKey) ToUncompressedBytes() []byte + func (pk *PubKey) Verify(userID []byte, data []byte, sig []byte) bool + func (pk *PubKey) VerifyFromASN1DER(userID []byte, msg []byte, sigBytes []byte) bool + func (pk *PubKey) VerifyFromBigInt(userID []byte, msg []byte, r, s *big.Int) bool + type Signature struct + R *big.Int + S *big.Int