crypto

package
v0.0.0-...-3bb59dd Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivKeyLen   = 64
	SignatureLen = 64
	PubKeyLen    = 32
	SeedLen      = 32
	AddressLen   = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

func (Address) Bytes

func (a Address) Bytes() []byte

func (Address) String

func (a Address) String() string

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func GeneratePrivateKey

func GeneratePrivateKey() *PrivateKey

func NewPrivateKeyFromSeed

func NewPrivateKeyFromSeed(seed []byte) *PrivateKey

func NewPrivateKeyFromSeedStr

func NewPrivateKeyFromSeedStr(seed string) *PrivateKey

func NewPrivateKeyFromString

func NewPrivateKeyFromString(s string) *PrivateKey

func (*PrivateKey) Bytes

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

func (*PrivateKey) Public

func (p *PrivateKey) Public() *PublicKey

func (*PrivateKey) Sign

func (p *PrivateKey) Sign(msg []byte) *Signature

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func PublicKeyFromBytes

func PublicKeyFromBytes(b []byte) *PublicKey

func (*PublicKey) Address

func (p *PublicKey) Address() Address

func (*PublicKey) Bytes

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

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func SignatureFromBytes

func SignatureFromBytes(b []byte) *Signature

func (*Signature) Bytes

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

func (*Signature) Verify

func (s *Signature) Verify(pubKey *PublicKey, msg []byte) bool

Jump to

Keyboard shortcuts

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