crypto

package
v0.0.0-...-180b776 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash160

func Hash160(s []byte) [20]byte

SHA256 + RIPEMD160

func MarshalPrivateKey

func MarshalPrivateKey(priv *ecdsa.PrivateKey) []byte

Returns bytes representation of private key (code borrowed from ethereum project)

func MarshalPublicKey

func MarshalPublicKey(pub *ecdsa.PublicKey) []byte

Returns bytes representation of public key (code borrowed from ethereum project)

func NewPrivateKey

func NewPrivateKey() (priv *ecdsa.PrivateKey, err error)

func ParsePrivateKey

func ParsePrivateKey(data []byte) *ecdsa.PrivateKey

Parses bytes representation of private key (code borrowed from ethereum project)

func ParsePublicKey

func ParsePublicKey(data []byte) *ecdsa.PublicKey

Parses bytes representation of public key (code borrowed from ethereum project)

func RetrievePublicKey

func RetrievePublicKey(hash, sig []byte) ([]byte, error)

Retrieves public key from signature used to sign hash

func S256

func S256() elliptic.Curve

func Sign

func Sign(hash []byte, priv *ecdsa.PrivateKey) (sig []byte, err error)

Signs hash using given private key. Returns signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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