crypto

package
v0.0.0-...-aa76b34 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PrivateKeyLength = 64
	PublicKeyLength  = 32
	SignatureLength  = 64
	SeedLength       = 32
	AddressLength    = 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 NewPrivateKey

func NewPrivateKey() *PrivateKey

func PrivateKeyFromBytes

func PrivateKeyFromBytes(key []byte) *PrivateKey

func PrivateKeyFromString

func PrivateKeyFromString(key string) *PrivateKey

func (*PrivateKey) Bytes

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

func (*PrivateKey) PublicKey

func (p *PrivateKey) PublicKey() *PublicKey

func (*PrivateKey) Sign

func (p *PrivateKey) Sign(message string) *Signature

func (*PrivateKey) String

func (p *PrivateKey) String() string

type PublicKey

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

func PublicKeyFromBytes

func PublicKeyFromBytes(key []byte) *PublicKey

func PublicKeyFromString

func PublicKeyFromString(key string) *PublicKey

func (*PublicKey) Address

func (p *PublicKey) Address() *Address

func (*PublicKey) Bytes

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

func (*PublicKey) String

func (p *PublicKey) String() string

func (*PublicKey) Verify

func (p *PublicKey) Verify(message string, sig *Signature) bool

type Signature

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

func SignatureFromBytes

func SignatureFromBytes(value []byte) *Signature

func SignatureFromString

func SignatureFromString(value string) *Signature

func (*Signature) Bytes

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

func (*Signature) String

func (s *Signature) String() string

func (*Signature) Verify

func (s *Signature) Verify(message string, pubKey *PublicKey) bool

Jump to

Keyboard shortcuts

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