Versions in this module Expand all Collapse all v0 v0.1.3 Jun 22, 2021 v0.1.2 Jun 15, 2021 Changes in this version + var DecryptionErr = errors.New("sm2: decryption error") + var EncryptionErr = errors.New("sm2: encryption error") + var SM2PARAM_A []byte — darwin/amd64, linux/amd64, windows/amd64 + func AffineToP256Point(x, y *big.Int) (out p256Point) — darwin/amd64, linux/amd64, windows/amd64 + func Decrypt(c []byte, key *PrivateKey) ([]byte, error) + func DecryptAsn1(priv *PrivateKey, cipher []byte) (plaintext []byte, err error) + func Encrypt(rand io.Reader, key *PublicKey, msg []byte) (cipher []byte, err error) + func EncryptAsn1(rand io.Reader, key *PublicKey, msg []byte) (cipher []byte, err error) + func Hexprint(in []byte) — darwin/amd64, linux/amd64, windows/amd64 + func P256() elliptic.Curve + func Sign(rand io.Reader, priv *PrivateKey, msg []byte) (r, s *big.Int, err error) + func SignWithDigest(rand io.Reader, priv *PrivateKey, digest []byte) (r, s *big.Int, err error) + func Sm2KeyGen(rand io.Reader) (sk, pk []byte, err error) + func Sm2Sign(sk, pk, msg []byte) ([]byte, error) + func Sm2Verify(sign, pk, msg []byte) bool + func Uint64ToAffine(in []uint64) (x, y *big.Int) — darwin/amd64, linux/amd64, windows/amd64 + func Verify(pub *PublicKey, msg []byte, r, s *big.Int) bool + func VerifyWithDigest(pub *PublicKey, digest []byte, r, s *big.Int) bool + type PrivateKey struct + D *big.Int + DInv *big.Int + func GenerateKey(rand io.Reader) (*PrivateKey, error) + func (key *PrivateKey) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) + func (priv *PrivateKey) Public() crypto.PublicKey + func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opt crypto.SignerOpts) ([]byte, error) + type PublicKey struct + PreComputed *[37][64 * 8]uint64 + X *big.Int + Y *big.Int + func (pub *PublicKey) Verify(msg []byte, sign []byte) bool + type Sm2PrivateKey struct + D *big.Int + type Sm2PublicKey struct + X *big.Int + Y *big.Int