Versions in this module Expand all Collapse all v0 v0.1.0 May 31, 2023 Changes in this version + const B + const ENCRYPTION_MODE_1 + const GB + const KB + const MB + const TB + func Decrypt(privateKeyHex string, cipherText string, t *EciesMetadata) (string, error) + func PKCS5Padding(ciphertext []byte, blockSize int) []byte + func PKCS5UnPadding(plaintext []byte) []byte + type EciesMetadata struct + EphemPublicKey string + Iv string + Mac string + Mode string + func Encrypt(pubkeyHex string, plainbytes []byte) (string, *EciesMetadata, error) + type PrivateKey struct + D *big.Int + func GenerateKey() (*PrivateKey, error) + func NewPrivateKeyFromBytes(priv []byte) *PrivateKey + func NewPrivateKeyFromHex(s string) (*PrivateKey, error) + func (k *PrivateKey) Bytes() []byte + func (k *PrivateKey) ECDH(pub *PublicKey) ([]byte, error) + func (k *PrivateKey) Encapsulate(pub *PublicKey) ([]byte, error) + func (k *PrivateKey) Equals(priv *PrivateKey) bool + func (k *PrivateKey) Hex() string + type PublicKey struct + X *big.Int + Y *big.Int + func NewPublicKeyFromBytes(b []byte) (*PublicKey, error) + func NewPublicKeyFromHex(s string) (*PublicKey, error) + func (k *PublicKey) Bytes(compressed bool) []byte + func (k *PublicKey) Decapsulate(priv *PrivateKey) ([]byte, error) + func (k *PublicKey) Equals(pub *PublicKey) bool + func (k *PublicKey) Hex(compressed bool) string