crypto

package
v0.0.0-...-8d57059 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EthSigVerify

func EthSigVerify(pk, msg, sig []byte) bool

func EthSign

func EthSign(prv *ecdsa.PrivateKey, msg []byte) (sig []byte, err error)

func GetPrivateKey

func GetPrivateKey(file string) (*ecdsa.PrivateKey, error)

func HashMessage

func HashMessage(msg []byte) []byte

func MakeRand

func MakeRand() ([]byte, error)

MakeRand returns a random slice of bytes. It returns an error if there was a problem while generating the random slice. It is different from the 'standard' random byte generation as it hashes its output before returning it; by hashing the system's PRNG output before it is send over the wire, we aim to make the random output less predictable (even if the system's PRNG isn't as unpredictable as desired). See https://trac.torproject.org/projects/tor/ticket/17694

Types

type Signature

type Signature struct {
	Hash      string
	Signature string
}

Jump to

Keyboard shortcuts

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