Versions in this module Expand all Collapse all v1 v1.0.0 Apr 15, 2023 Changes in this version + var ECIESAes128Sha256 = &ECIESParams + var ECIESAes256Sha384 = &ECIESParams + var ECIESAes256Sha512 = &ECIESParams + var ErrInvalidCurve = fmt.Errorf("ecies: invalid elliptic curve") + var ErrInvalidMessage = fmt.Errorf("ecies: invalid message") + var ErrInvalidPublicKey = fmt.Errorf("ecies: invalid public key") + var ErrKeyDataTooLong = fmt.Errorf("ecies: can't supply requested key data") + var ErrSharedKeyIsPointAtInfinity = fmt.Errorf("ecies: shared key is point at infinity") + var ErrSharedKeyTooBig = fmt.Errorf("ecies: shared key params are too big") + var ErrUnsupportedECIESParameters = fmt.Errorf("ecies: unsupported ECIES parameters") + func EccDecrypt(cipherText []byte, priKey string) (plainText []byte, err error) + func EccDecryptByBase64(base64CipherText, base64PriKey string) (plainText []byte, err error) + func EccDecryptByHex(hexCipherText, hexPriKey string) (plainText []byte, err error) + func EccEncrypt(plainText []byte, pubKey string) (cipherText []byte, err error) + func EccEncryptToBase64(plainText []byte, base64PubKey string) (base64CipherText string, err error) + func EccEncryptToHex(plainText []byte, hexPubKey string) (hexCipherText string, err error) + func EccSign(msg []byte, priKey string) (hexrSign, hexsSign string, err error) + func EccSignBase64(msg []byte, base64PriKey string) (base64rSign, base64sSign string, err error) + func EccSignHex(msg []byte, hexPriKey string) (hexrSign, hexsSign string, err error) + func EccVerifySign(msg []byte, hexrSign, hexsSign, pubKey string) bool + func EccVerifySignBase64(msg []byte, base64rSign, base64sSign, base64PubKey string) bool + func EccVerifySignHex(msg []byte, hexrSign, hexsSign, hexPubKey string) bool + func Encrypt(rand io.Reader, pub *PublicKey, m, s1, s2 []byte) (ct []byte, err error) + func MaxSharedKeyLength(pub *PublicKey) int + type ECIESParams struct + BlockSize int + Cipher func([]byte) (cipher.Block, error) + Hash func() hash.Hash + KeyLen int + func ParamsFromCurve(curve elliptic.Curve) (params *ECIESParams) + type EccKey struct + PrivateKey string + PublicKey string + func GenerateEccKeyBase64() (EccKey, error) + func GenerateEccKeyHex() (EccKey, error) + func GenerateEccKeyPem() (EccKey, error) + type PrivateKey struct + D *big.Int + func GenerateKey(rand io.Reader, curve elliptic.Curve, params *ECIESParams) (prv *PrivateKey, err error) + func ImportECDSA(prv *ecdsa.PrivateKey) *PrivateKey + func (prv *PrivateKey) Decrypt(c, s1, s2 []byte) (m []byte, err error) + func (prv *PrivateKey) ExportECDSA() *ecdsa.PrivateKey + func (prv *PrivateKey) GenerateShared(pub *PublicKey, skLen, macLen int) (sk []byte, err error) + type PublicKey struct + Params *ECIESParams + X *big.Int + Y *big.Int + func ImportECDSAPublic(pub *ecdsa.PublicKey) *PublicKey + func (pub *PublicKey) ExportECDSA() *ecdsa.PublicKey