ecc

package
v0.0.0-...-575f8db Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECC

type ECC struct {
	P big.Int
	A big.Int
	N big.Int
	G ECPoint
}

func NewSecp256K1

func NewSecp256K1() *ECC

func (*ECC) FieldAdd

func (curve *ECC) FieldAdd(a, b *big.Int) *big.Int

func (*ECC) FieldDiv

func (curve *ECC) FieldDiv(a, b *big.Int) *big.Int

func (*ECC) FieldMul

func (curve *ECC) FieldMul(a, b *big.Int) *big.Int

func (*ECC) FieldNormal

func (curve *ECC) FieldNormal(a *big.Int) *big.Int

func (*ECC) FieldSub

func (curve *ECC) FieldSub(a, b *big.Int) *big.Int

func (*ECC) Hack

func (curve *ECC) Hack(key, r, s *big.Int, hash []byte) *big.Int

func (*ECC) Inverse

func (curve *ECC) Inverse(x *big.Int) *big.Int

func (*ECC) NewPoint

func (curve *ECC) NewPoint(x *big.Int) *ECPoint

func (*ECC) PointAdd

func (curve *ECC) PointAdd(Q, P *ECPoint) *ECPoint

func (*ECC) PointScale

func (curve *ECC) PointScale(Q *ECPoint, N *big.Int) *ECPoint

func (*ECC) PointSub

func (curve *ECC) PointSub(Q, P *ECPoint) *ECPoint

func (*ECC) PointTwice

func (curve *ECC) PointTwice(Q *ECPoint) *ECPoint

func (*ECC) PrivateKey2Address

func (curve *ECC) PrivateKey2Address(key *big.Int) string

func (*ECC) PublicKey2Address

func (curve *ECC) PublicKey2Address(puK *ECPoint) string

func (*ECC) Recover

func (curve *ECC) Recover(r, s *big.Int, v int64, hash []byte) *ECPoint

v = 0 even, v = 1 odd

func (*ECC) SetPoint

func (curve *ECC) SetPoint(x *ECPoint) *ECPoint

func (*ECC) Sign

func (curve *ECC) Sign(key, d *big.Int, hash []byte) (*big.Int, *big.Int, int64)

func (*ECC) Sqrt

func (curve *ECC) Sqrt(x *big.Int) *big.Int

func (*ECC) Verify

func (curve *ECC) Verify(Q *ECPoint, r, s *big.Int, hash []byte) bool

type ECPoint

type ECPoint struct {
	X big.Int
	Y big.Int
}

func (*ECPoint) Bytes

func (p *ECPoint) Bytes() []byte

Jump to

Keyboard shortcuts

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