keypair

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	S256   = crypto.S256()
	Curve  = S256
	Params = Curve.Params()
)
View Source
var (
	ErrPointNotOnCurve    = errors.New("point is not on the curve")
	ErrPointNotCurveParam = errors.New("point param not same as curve")
)

Functions

func GenerateKeyPair

func GenerateKeyPair() (*PublicKey, *PrivateKey)

func HashToCurve

func HashToCurve(m []byte) (x, y *big.Int)

func HashToField

func HashToField(m []byte) *big.Int

HashToField hashes to an integer [1,N-1]

func Unmarshal

func Unmarshal(curve elliptic.Curve, data []byte) (x, y *big.Int)

Unmarshal a compressed point in the form specified in section 4.3.6 of ANSI X9.62.

Types

type Key

type Key struct {
	Address    common.Address
	PrivateKey PrivateKey
}

func NewKey

func NewKey(sk *ecdsa.PrivateKey) (Key, error)

type PrivateKey

type PrivateKey struct {
	*ecdsa.PrivateKey
}

func NewPrivateKey

func NewPrivateKey(sk *ecdsa.PrivateKey) (*PrivateKey, error)

func (*PrivateKey) Public

func (k *PrivateKey) Public() *PublicKey

type PublicKey

type PublicKey struct {
	*ecdsa.PublicKey
}

func NewPublicKey

func NewPublicKey(pk *ecdsa.PublicKey) (*PublicKey, error)

Jump to

Keyboard shortcuts

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