keys

package
v0.0.0-...-64543fc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKey

type PrivateKey struct {
	Bnkey     *curvebn.CurveBN
	PublicKey *PublicKey
}

func GenerateKey

func GenerateKey() (*PrivateKey, error)

func NewPrivateKeyFromBytes

func NewPrivateKeyFromBytes(priv []byte) *PrivateKey

NewPrivateKeyFromBytes decodes private key raw bytes, computes public key and returns PrivateKey instance

func NewPrivateKeyFromHex

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

func (*PrivateKey) Add

func (k *PrivateKey) Add(u *big.Int) *big.Int

func (*PrivateKey) Bytes

func (k *PrivateKey) Bytes() []byte

Bytes returns private key raw bytes

func (*PrivateKey) Hex

func (k *PrivateKey) Hex() string

Hex returns private key bytes in hex form

func (*PrivateKey) Int

func (k *PrivateKey) Int() *big.Int

func (*PrivateKey) Mul

func (k *PrivateKey) Mul(u *big.Int) *big.Int

type PublicKey

type PublicKey struct {
	Point *point.Point
}

func NewPublicKeyFromBytes

func NewPublicKeyFromBytes(b []byte) (*PublicKey, error)

func NewPublicKeyFromHex

func NewPublicKeyFromHex(s string) (*PublicKey, error)

func (*PublicKey) Bytes

func (k *PublicKey) Bytes(compressed bool) []byte

func (*PublicKey) Hex

func (k *PublicKey) Hex(compressed bool) string

Jump to

Keyboard shortcuts

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