pdp

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionLength              = 8
	MaxMerklePdpChallengeBlock = 1
)
View Source
const (
	MerklePdp = 1
)

Variables

This section is empty.

Functions

func GetPdpVersionFromProof

func GetPdpVersionFromProof(proof []byte) uint64

GetPdpVersionFromProof get pdp version from proof data

func GetPdpVersionFromUniqueId

func GetPdpVersionFromUniqueId(uniqueId []byte) uint64

GetPdpVersionFromUniqueId get pdp version from uniqueId data

func VerifyProofWithUniqueId

func VerifyProofWithUniqueId(uniqueId []byte, proof []byte, challenge []uint64) error

VerifyProof used in consensus algorithm

Types

type Pdp

type Pdp struct {
	Version uint64
}

func NewPdp

func NewPdp(version uint64) *Pdp

func (*Pdp) GenChallenge

func (p *Pdp) GenChallenge(nodeId [20]byte, blockHash []byte, fileBlockNum uint64) ([]uint64, error)

GenChallenge compute the index to choose block

func (*Pdp) GenProofWithBlocks

func (p *Pdp) GenProofWithBlocks(fileBlocks []types.Block, uniqueId []byte, challenge []uint64) ([]byte, error)

BuildProof need parameters

func (*Pdp) GenUniqueIdWithFileBlocks

func (p *Pdp) GenUniqueIdWithFileBlocks(fileBlocks []types.Block) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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