eckey

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package eckey

Package eckey

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPublicKeyNotOnCurve indicates that the public key's (X, Y) coordinates do
	// not lie on the secp256k1 curve.
	ErrPublicKeyNotOnCurve = errors.New("Public key is not on secp256k1 curve")
)

Functions

func FromECDSAPub

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

func NewPublicKeyCoords

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

PublicKeyFromCoordinates serializes an (X, Y) coordinate pair into a public key. Returns nil if X or Y are nil.

func S256

func S256() elliptic.Curve

S256 returns an instance of the secp256k1 curve.

func ToECDSA

func ToECDSA(d []byte) (*ecdsa.PrivateKey, error)

ToECDSA creates a private key with the given D value.

func UnmarshalPubkey

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

UnmarshalPubkey converts bytes to a secp256k1 public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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