Documentation ¶
Index ¶
- func Decrypt(privKey *btcec.PrivateKey, data []byte) ([]byte, error)
- func DecryptWithAES256(secretKey, nonce, ciphertext []byte) ([]byte, error)
- func DeriveSharedKey(priv *btcec.PrivateKey, pub *btcec.PublicKey, kdf func([]byte) []byte) []byte
- func Encrypt(pubKey *btcec.PublicKey, data []byte) ([]byte, error)
- func EncryptWithAES256(secretKey, nonce, data []byte) ([]byte, error)
- func GeneratePrivateKeyFromMnemonic(mnemonic string, coinType, accNum, index uint32) (secp256k1.PrivKey, error)
- func KDFSHA256(in []byte) []byte
- func NewPrivKey() (*btcec.PrivateKey, error)
- func PrivKeyFromBytes(privKeyBz []byte) (*btcec.PrivateKey, *btcec.PublicKey)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(privKey *btcec.PrivateKey, data []byte) ([]byte, error)
Decrypt decrypts data using a secp256k1 private key (ECIES)
func DecryptWithAES256 ¶
DecryptWithAES256 decrypts data using a AES256 cryptography.
func DeriveSharedKey ¶
DeriveSharedKey derives a shared key (which can be used for asymmetric encryption) using a specified KDF (Key Derivation Function) from a shared secret generated by Diffie-Hellman key exchange (ECDH).
func EncryptWithAES256 ¶
EncryptWithAES256 encrypts data using a AES256 cryptography.
func NewPrivKey ¶
func NewPrivKey() (*btcec.PrivateKey, error)
NewPrivKey generates a random secp256k1 private key
func PrivKeyFromBytes ¶
func PrivKeyFromBytes(privKeyBz []byte) (*btcec.PrivateKey, *btcec.PublicKey)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.