ecp256

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PrivKeyBytesLen = 32

PrivKeyBytesLen defines the length in bytes of a serialized private key.

Variables

This section is empty.

Functions

func FromECDSAPub

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

func GenerateKey

func GenerateKey(rand io.Reader) (priv []byte, x,
	y *big.Int, err error)

GenerateKey generates a key using a random number generator, returning the private scalar and the corresponding public key points.

func GeneratePrivateKey

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

GeneratePrivateKey is a wrapper for ecdsa.GenerateKey that returns a PrivateKey instead of the normal ecdsa.PrivateKey.

func NewPrivateKey

func NewPrivateKey(d *big.Int) *ecdsa.PrivateKey

NewPrivateKey instantiates a new private key from a scalar encoded as a big integer.

func NewPublicKey

func NewPublicKey(x *big.Int, y *big.Int) *ecdsa.PublicKey

NewPublicKey instantiates a new public key with the given X,Y coordinates.

func PrivKeyFromBytes

func PrivKeyFromBytes(pk []byte) (*ecdsa.PrivateKey,
	*ecdsa.PublicKey)

PrivKeyFromBytes returns a private and public key for `curve' based on the private key passed as an argument as a byte slice.

func PrivKeyFromScalar

func PrivKeyFromScalar(s []byte) (*ecdsa.PrivateKey,
	*ecdsa.PublicKey)

PrivKeyFromScalar is the same as PrivKeyFromBytes in secp256k1.

func UnmarshalPubkey

func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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