secp256k1

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 6 Imported by: 0

README

logo

Testing

go test -timeout 5s -run . github.com/zkweb3/go-secp256k1 -v -count=1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicKey

func GetPublicKey(sk *ecdsa.PrivateKey) (*ecdsa.PublicKey, error)

func ScalarMult

func ScalarMult(sk *ecdsa.PrivateKey, Gx, Gy *big.Int) (*big.Int, *big.Int, error)

func SignRFC6979

func SignRFC6979(sk *ecdsa.PrivateKey, hash common.Hash) (*big.Int, *big.Int, error)

SignRFC6979 generates a deterministic ECDSA signature according to RFC 6979 and BIP 62.

Types

type Fq

type Fq struct {
	Z, P *big.Int
}

func (*Fq) Add

func (f *Fq) Add(x *Fq) *Fq

func (*Fq) Div

func (f *Fq) Div(x *Fq) *Fq

func (*Fq) Equal

func (f *Fq) Equal(x *Fq) bool

func (*Fq) Mul

func (f *Fq) Mul(x *Fq) *Fq

func (*Fq) Neg

func (f *Fq) Neg() *Fq

func (*Fq) Set

func (f *Fq) Set(x *big.Int) *Fq

func (*Fq) String

func (f *Fq) String() string

func (*Fq) Sub

func (f *Fq) Sub(x *Fq) *Fq

type Point

type Point struct {
	X, Y *Fq
}

func (*Point) Add

func (p *Point) Add(x *Point) *Point

func (*Point) Set

func (p *Point) Set(x, y *big.Int) *Point

func (*Point) String

func (p *Point) String() string

Jump to

Keyboard shortcuts

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