auth

package
v0.0.0-...-7640ebf Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = errors.New("invalid signature")

Functions

func GetActor

func GetActor(auth chain.Auth) crypto.PublicKey

func GetSigner

func GetSigner(auth chain.Auth) crypto.PublicKey

func UnmarshalED25519

func UnmarshalED25519(p *codec.Packer, _ *warp.Message) (chain.Auth, error)

Types

type ED25519

type ED25519 struct {
	Signer    crypto.PublicKey `json:"signer"`
	Signature crypto.Signature `json:"signature"`
}

func (*ED25519) AsyncVerify

func (d *ED25519) AsyncVerify(msg []byte) error

func (*ED25519) CanDeduct

func (d *ED25519) CanDeduct(
	ctx context.Context,
	db chain.Database,
	amount uint64,
) error

func (*ED25519) Deduct

func (d *ED25519) Deduct(
	ctx context.Context,
	db chain.Database,
	amount uint64,
) error

func (*ED25519) Marshal

func (d *ED25519) Marshal(p *codec.Packer)

func (*ED25519) MaxUnits

func (*ED25519) MaxUnits(
	chain.Rules,
) uint64

func (*ED25519) Payer

func (d *ED25519) Payer() []byte

func (*ED25519) Refund

func (d *ED25519) Refund(
	ctx context.Context,
	db chain.Database,
	amount uint64,
) error

func (*ED25519) StateKeys

func (d *ED25519) StateKeys() [][]byte

func (*ED25519) ValidRange

func (*ED25519) ValidRange(chain.Rules) (int64, int64)

func (*ED25519) Verify

func (d *ED25519) Verify(
	_ context.Context,
	r chain.Rules,
	_ chain.Database,
	_ chain.Action,
) (uint64, error)

type ED25519Factory

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

func NewED25519Factory

func NewED25519Factory(priv crypto.PrivateKey) *ED25519Factory

func (*ED25519Factory) Sign

func (d *ED25519Factory) Sign(msg []byte, _ chain.Action) (chain.Auth, error)

Jump to

Keyboard shortcuts

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