Versions in this module Expand all Collapse all v1 v1.0.9 Jul 14, 2021 v1.0.8 Jul 5, 2021 Changes in this version + const BitSize + const KeyBytes + const UnCompress + func Add(x, y *big.Int) *big.Int + func And(x, y *big.Int) *big.Int + func Decrypt(priv *PrivateKey, in []byte, cipherTextType Sm2CipherTextType) ([]byte, error) + func Encrypt(pub *PublicKey, in []byte, cipherTextType Sm2CipherTextType) ([]byte, error) + func GenerateKey(rand io.Reader) (*PrivateKey, *PublicKey, error) + func IsEcPointInfinity(x, y *big.Int) bool + func Lsh(x *big.Int, n uint) *big.Int + func MarshalCipher(in []byte, cipherTextType Sm2CipherTextType) ([]byte, error) + func MarshalSign(r, s *big.Int) ([]byte, error) + func Mod(x, y *big.Int) *big.Int + func ModInverse(x, y *big.Int) *big.Int + func Mul(x, y *big.Int) *big.Int + func SetBit(x *big.Int, i int, b uint) *big.Int + func Sign(priv *PrivateKey, userId []byte, in []byte) ([]byte, error) + func SignToRS(priv *PrivateKey, userId []byte, in []byte) (r, s *big.Int, err error) + func Sub(x, y *big.Int) *big.Int + func UnmarshalCipher(in []byte, cipherTextType Sm2CipherTextType) (out []byte, err error) + func UnmarshalSign(sign []byte) (r, s *big.Int, err error) + func Verify(pub *PublicKey, userId []byte, src []byte, sign []byte) bool + func VerifyByRS(pub *PublicKey, userId []byte, src []byte, r, s *big.Int) bool + type ExchangeResult struct + Key []byte + S1 []byte + S2 []byte + func CalculateKeyWithConfirmation(initiator bool, keyBits int, confirmationTag []byte, ...) (*ExchangeResult, error) + type P256V1Curve struct + A *big.Int + func GetSm2P256V1() P256V1Curve + type PrivateKey struct + Curve P256V1Curve + D *big.Int + func RawBytesToPrivateKey(bytes []byte) (*PrivateKey, error) + func (pri *PrivateKey) GetRawBytes() []byte + type PublicKey struct + Curve P256V1Curve + X *big.Int + Y *big.Int + func CalculatePubKey(priv *PrivateKey) *PublicKey + func RawBytesToPublicKey(bytes []byte) (*PublicKey, error) + func (pub *PublicKey) GetRawBytes() []byte + func (pub *PublicKey) GetUnCompressBytes() []byte + type Sm2CipherTextType int32 + const C1C2C3 + const C1C3C2