secp256k1

package module
v0.101.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 9 Imported by: 2

README

go-secp256k1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init() bool

func SayHello

func SayHello()

Types

type PrivateKey

type PrivateKey struct {
	Data [32]byte
}

func NewPrivateKey

func NewPrivateKey(seed []byte) *PrivateKey

func NewPrivateKeyFromBase58

func NewPrivateKeyFromBase58(strPriv string) (*PrivateKey, error)

func NewPrivateKeyFromHex

func NewPrivateKeyFromHex(strPriv string) (*PrivateKey, error)

func (*PrivateKey) GetPublicKey

func (priv *PrivateKey) GetPublicKey() *PublicKey

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(digest []byte) (*Signature, error)

func (*PrivateKey) String

func (priv *PrivateKey) String() string

type PublicKey

type PublicKey struct {
	Data [33]byte
}

func GetPublicKey

func GetPublicKey(seckey *PrivateKey) (*PublicKey, error)

func NewPublicKeyFromBase58

func NewPublicKeyFromBase58(strPub string) (*PublicKey, error)

func Recover

func Recover(digest []byte, signature *Signature) (*PublicKey, error)

digest is 32 bytes signature is 65 bytes pubkey is 33 bytes

func (*PublicKey) Bytes

func (pk *PublicKey) Bytes() []byte

func (*PublicKey) String

func (pk *PublicKey) String() string

func (*PublicKey) StringAM

func (pk *PublicKey) StringAM() string

type Signature

type Signature struct {
	Data [65]byte
}

func NewSignature

func NewSignature(sig []byte) *Signature

func NewSignatureFromBase58

func NewSignatureFromBase58(sig string) (*Signature, error)

func Sign

func Sign(digest []byte, seckey *PrivateKey) (*Signature, error)

func (*Signature) Bytes

func (sig *Signature) Bytes() []byte

func (*Signature) String

func (sig *Signature) String() string

Jump to

Keyboard shortcuts

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