crypto

package
v0.0.1-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptDataWithAES256

func DecryptDataWithAES256(secretKey []byte, additional []byte, ciphertext []byte) ([]byte, error)

DecryptDataWithAES256 combines secretKey and secondKey to decrypt AES256-GCM.

func EncryptDataWithAES256

func EncryptDataWithAES256(secretKey, additional, data []byte) ([]byte, error)

EncryptDataWithAES256 combines secretKey and secondKey to encrypt with AES256-GCM method.

func EncryptDataWithSecp256k1

func EncryptDataWithSecp256k1(pubKeyByte []byte, data []byte) ([]byte, error)

EncryptDataWithSecp256k1 encrypts data using recipient public key (ECIES) Secp256k1 is the only supported elliptic curve for encryption.

func GenerateMnemonic

func GenerateMnemonic() (string, error)

GenerateMnemonic create a new mnemonic

func GeneratePrivateKeyFromMnemonic

func GeneratePrivateKeyFromMnemonic(mnemonic string, coinType uint32) (secp256k1.PrivKey, error)

GeneratePrivateKeyFromMnemonic when a valid mnemonic is inputted, it returns a PrivKey and error is nil. If the mnemonic is not valid, an error is not nil.

func GenerateRandomKey

func GenerateRandomKey(size int) ([]byte, error)

func Hash

func Hash(data []byte) []byte

Hash with SHA256.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL