shared

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 8 Imported by: 4

Documentation

Overview

nolint

Index

Constants

View Source
const (
	// T is the security param which determines the number of leaves
	// to be included in a non-interactive proof.
	T uint8 = 150

	// OwnerReadWrite is a standard owner read / write file permission.
	OwnerReadWrite = os.FileMode(0o600)
)

Variables

This section is empty.

Functions

func FiatShamir

func FiatShamir(challenge []byte, spaceSize uint64, securityParam uint8) map[uint64]bool

FiatShamir generates a set of indices to include in a non-interactive proof.

func MakeLabelFunc added in v0.2.0

func MakeLabelFunc() func(hash func(data []byte) []byte, labelID uint64, leftSiblings [][]byte) []byte

MakeLabelFunc returns a function which generates a PoET DAG label by concatenating a representation of the labelID with the list of left siblings and then hashing the result using the provided hash function.

⚠️ The resulting function is NOT thread-safe, however different generated instances are independent. The code is optimized for performance and memory allocations.

func Retry

func Retry(retryable func() error, numRetries int, interval time.Duration, logger func(msg string)) error

Retry provides generic capability for retryable function execution.

Types

type MerkleProof

type MerkleProof struct {
	Root         []byte
	ProvenLeaves [][]byte
	ProofNodes   [][]byte
}

func (*MerkleProof) DecodeScale added in v0.2.0

func (t *MerkleProof) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*MerkleProof) EncodeScale added in v0.2.0

func (t *MerkleProof) EncodeScale(enc *scale.Encoder) (total int, err error)

Jump to

Keyboard shortcuts

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