crypto

package
v0.0.0-...-a41f14b Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PrivateKeyLen = 64
	SignatureLen  = 64
	PublicKeyLen  = 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 AddressFromBytes

func AddressFromBytes(b []byte) Address

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 NewPrivateKeyFromSeedString

func NewPrivateKeyFromSeedString(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(publicKey *PublicKey, msg []byte) bool

Jump to

Keyboard shortcuts

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