verifying

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyVRFNonce added in v0.2.4

func VerifyVRFNonce(nonce *uint64, m *shared.VRFNonceMetadata, opts ...OptionFunc) error

VerifyVRFNonce ensures the validity of a nonce for a given node. AtxId is the id of the ATX that was selected by the node for its commitment.

Types

type ErrInvalidIndex added in v0.11.0

type ErrInvalidIndex = postrs.ErrInvalidIndex

Reexport from internal pkg.

type OptionFunc added in v0.4.0

type OptionFunc func(*option)

func AllIndices added in v0.11.0

func AllIndices() OptionFunc

Verify all indices in the proof.

func SelectedIndex added in v0.11.0

func SelectedIndex(ord int) OptionFunc

Verify only the selected index. The `ord` is the ordinal number of the index in the proof to verify.

func Subset added in v0.11.0

func Subset(k3 uint, seed []byte) OptionFunc

Verify a subset of randomly selected K3 indices. The `id` is used to seed the random number generator.

func WithLabelScryptParams added in v0.5.1

func WithLabelScryptParams(params config.ScryptParams) OptionFunc

func WithPowFlags added in v0.7.0

func WithPowFlags(flags config.PowFlags) OptionFunc

type ProofVerifier added in v0.7.0

type ProofVerifier struct {
	*postrs.Verifier
}

func NewProofVerifier added in v0.7.0

func NewProofVerifier(opts ...OptionFunc) (*ProofVerifier, error)

NewProofVerifier creates a new proof verifier. The verifier must be closed after use with Close().

func (*ProofVerifier) Verify added in v0.7.0

func (v *ProofVerifier) Verify(
	p *shared.Proof,
	m *shared.ProofMetadata,
	cfg config.Config,
	logger *zap.Logger,
	opts ...OptionFunc,
) error

Verify ensures the validity of a proof in respect to its metadata. It returns nil if the proof is valid or an error describing the failure, otherwise.

Jump to

Keyboard shortcuts

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