crypto

package
v0.0.0-...-1f4e700 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddressSize is the size of an address in bytes.
	AddressSize int = 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 NewPrivateKey

func NewPrivateKey() (*PrivateKey, error)

func NewPrivateKeyFromSeed

func NewPrivateKeyFromSeed(seed []byte) (*PrivateKey, error)

func NewPrivateKeyFromString

func NewPrivateKeyFromString(seed string) (*PrivateKey, error)

func (*PrivateKey) Bytes

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

func (*PrivateKey) PublicKey

func (p *PrivateKey) PublicKey() *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, error)

func (*PublicKey) Address

func (p *PublicKey) Address() *Address

func (*PublicKey) Bytes

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

func (*PublicKey) Verify

func (p *PublicKey) Verify(msg, sig []byte) bool

type Signature

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

func SignatueFromBytes

func SignatueFromBytes(b []byte) (*Signature, error)

func (*Signature) Bytes

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

func (*Signature) Verify

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

Jump to

Keyboard shortcuts

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