auth

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ED25519ComputeUnits = 5
	ED25519Size         = ed25519.PublicKeyLen + ed25519.SignatureLen
)

Variables

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

Functions

func Engines added in v0.3.0

func Engines() map[uint8]vm.AuthEngine

func GetActor

func GetActor(auth chain.Auth) ed25519.PublicKey

func GetSigner

func GetSigner(auth chain.Auth) ed25519.PublicKey

func UnmarshalED25519

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

Types

type ED25519

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

func (*ED25519) AsyncVerify

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

func (*ED25519) CanDeduct

func (d *ED25519) CanDeduct(
	ctx context.Context,
	im state.Immutable,
	amount uint64,
) error

func (*ED25519) Deduct

func (d *ED25519) Deduct(
	ctx context.Context,
	mu state.Mutable,
	amount uint64,
) error

func (*ED25519) GetTypeID added in v0.3.0

func (*ED25519) GetTypeID() uint8

func (*ED25519) Marshal

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

func (*ED25519) MaxComputeUnits added in v0.3.0

func (*ED25519) MaxComputeUnits(chain.Rules) uint64

func (*ED25519) Payer

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

func (*ED25519) Refund

func (d *ED25519) Refund(
	ctx context.Context,
	mu state.Mutable,
	amount uint64,
) error

func (*ED25519) Size added in v0.3.0

func (*ED25519) Size() int

func (*ED25519) StateKeys

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

func (*ED25519) ValidRange

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

func (*ED25519) Verify

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

type ED25519AuthEngine added in v0.3.0

type ED25519AuthEngine struct{}

func (*ED25519AuthEngine) Cache added in v0.3.0

func (*ED25519AuthEngine) Cache(auth chain.Auth)

func (*ED25519AuthEngine) GetBatchVerifier added in v0.3.0

func (*ED25519AuthEngine) GetBatchVerifier(cores int, count int) chain.AuthBatchVerifier

type ED25519Batch added in v0.3.0

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

func (*ED25519Batch) Add added in v0.3.0

func (b *ED25519Batch) Add(msg []byte, rauth chain.Auth) func() error

func (*ED25519Batch) Done added in v0.3.0

func (b *ED25519Batch) Done() []func() error

type ED25519Factory

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

func NewED25519Factory

func NewED25519Factory(priv ed25519.PrivateKey) *ED25519Factory

func (*ED25519Factory) MaxUnits added in v0.3.0

func (*ED25519Factory) MaxUnits() (uint64, uint64, []uint16)

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