Versions in this module Expand all Collapse all v1 v1.0.0 May 30, 2022 Changes in this version + var C1C2C3 = 1 + var C1C3C2 = 0 + func BytesCombine(pBytes ...[]byte) []byte + func CipherMarshal(data []byte) ([]byte, error) + func CipherUnmarshal(data []byte) ([]byte, error) + func Compress(a *PublicKey) []byte + func Decrypt(priv *PrivateKey, data []byte, mode int) ([]byte, error) + func DecryptAsn1(pub *PrivateKey, data []byte) ([]byte, error) + func Encrypt(pub *PublicKey, data []byte, random io.Reader, mode int) ([]byte, error) + func EncryptAsn1(pub *PublicKey, data []byte, rand io.Reader) ([]byte, error) + func KeyExchangeA(klen int, ida, idb []byte, priA *PrivateKey, pubB *PublicKey, rpri *PrivateKey, ...) (k, s1, s2 []byte, err error) + func KeyExchangeB(klen int, ida, idb []byte, priB *PrivateKey, pubA *PublicKey, rpri *PrivateKey, ...) (k, s1, s2 []byte, err error) + func P256Sm2() elliptic.Curve + func SignDataToSignDigit(sign []byte) (*big.Int, *big.Int, error) + func SignDigitToSignData(r, s *big.Int) ([]byte, error) + func Sm2Sign(priv *PrivateKey, msg, uid []byte, random io.Reader) (r, s *big.Int, err error) + func Sm2Verify(pub *PublicKey, msg, uid []byte, r, s *big.Int) bool + func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool + func WNafReversed(wnaf []int8) []int8 + func ZA(pub *PublicKey, uid []byte) ([]byte, error) + type PrivateKey struct + D *big.Int + func GenerateKey(random io.Reader) (*PrivateKey, error) + func (priv *PrivateKey) Decrypt(_ io.Reader, msg []byte, _ crypto.DecrypterOpts) (plaintext []byte, err error) + func (priv *PrivateKey) DecryptAsn1(data []byte) ([]byte, error) + func (priv *PrivateKey) Public() crypto.PublicKey + func (priv *PrivateKey) Sign(random io.Reader, msg []byte, signer crypto.SignerOpts) ([]byte, error) + type PublicKey struct + X *big.Int + Y *big.Int + func Decompress(a []byte) *PublicKey + func (pub *PublicKey) EncryptAsn1(data []byte, random io.Reader) ([]byte, error) + func (pub *PublicKey) Sm3Digest(msg, uid []byte) ([]byte, error) + func (pub *PublicKey) Verify(msg []byte, sign []byte) bool