crypto

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesGCMDecrypt

func AesGCMDecrypt(key, cipherText, nonce []byte) ([]byte, error)

func AesGCMEncrypt

func AesGCMEncrypt(key, inText []byte) (outText, nonce []byte, err error)

func GetEntropyCSPRNG

func GetEntropyCSPRNG(n int) []byte

func HexToECDSA added in v1.2.0

func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)

HexToECDSA parses a secp256k1 private key.

func S256 added in v1.2.0

func S256() elliptic.Curve

S256 returns an instance of the secp256k1 curve.

func ToECDSA added in v1.2.0

func ToECDSA(d []byte) (*ecdsa.PrivateKey, error)

ToECDSA creates a private key with the given D value.

Types

type SecureString

type SecureString struct {
	// contains filtered or unexported fields
}

func NewSecureString

func NewSecureString(passphrase string) (*SecureString, error)

NewSecureString from string

func (*SecureString) Bytes

func (ss *SecureString) Bytes() []byte

Bytes get bytes from string

func (*SecureString) Destroy

func (ss *SecureString) Destroy()

Destroy string buffer

Directories

Path Synopsis
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
Package random provides some functions to securely generate random bytes and numbers.
Package random provides some functions to securely generate random bytes and numbers.

Jump to

Keyboard shortcuts

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