key

package
v0.0.0-...-516970c Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NGenerateKey = 10
)

Variables

View Source
var (
	BitSize = 256
)
View Source
var (
	ErrInvalidKey = errors.New("invalid key")
)

Functions

func GenerateKey

func GenerateKey() (*ecdsa.PrivateKey, error)

func IsValidPrivateKey

func IsValidPrivateKey(key *ecdsa.PrivateKey) bool

IsValidPrivateKey is to ensure that crypto.S256() is the same as btcec.S256() (p2pcrypto is using btcec.S256, while ecsda is using crypto.S256)

func P2PPubKeyBytesToPubKey

func P2PPubKeyBytesToPubKey(theBytes []byte) (*ecdsa.PublicKey, error)

func P2PPubKeyBytesToPubKeyBytes

func P2PPubKeyBytesToPubKeyBytes(theBytes []byte) ([]byte, error)

func P2PPubkeyToPubkey

func P2PPubkeyToPubkey(theKey p2pcrypto.PubKey) (*ecdsa.PublicKey, error)

func PrivateKeyToP2PKey

func PrivateKeyToP2PKey(key *ecdsa.PrivateKey) (p2pcrypto.PrivKey, p2pcrypto.PubKey, error)

func PrivateKeyToP2PPrivKey

func PrivateKeyToP2PPrivKey(key *ecdsa.PrivateKey) (p2pcrypto.PrivKey, error)

func PubKeyToP2PPubkey

func PubKeyToP2PPubkey(key *ecdsa.PublicKey) (p2pcrypto.PubKey, error)

func PubkeyBytesToAddress

func PubkeyBytesToAddress(pubBytes []byte) common.Address

func PubkeyToHash

func PubkeyToHash(p ecdsa.PublicKey) common.Hash

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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