Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const LeafSize + const SectorSize + func CheckDiffStorageProof(lh LeafRoot, leafNumber uint64, h hash.Hash, limits []SubTreeLimit, ...) error + func CheckLimitStorageProof(lh LeafRoot, h hash.Hash, left, right int, storageProofList [][]byte, ...) (bool, error) + func CheckStorageProof(h hash.Hash, merkleRoot []byte, storageProofList [][]byte, ...) bool + func GetDiffStorageProof(limits []SubTreeLimit, h SubtreeRoot, leafNumber uint64) (storageProofList [][]byte, err error) + func GetLimitStorageProof(left, right int, h SubtreeRoot) (storageProofList [][]byte, err error) + func LeavesCount(dataSize uint64) (count uint64) + func Sha256CachedTreeRoot(roots []common.Hash, height uint64) (root common.Hash) + func Sha256CachedTreeRoot2(roots []common.Hash) (root common.Hash) + func Sha256DiffProof(roots []common.Hash, rangeSet []SubTreeLimit, leavesCount uint64) (hashProofSet []common.Hash, err error) + func Sha256MerkleTreeProof(data []byte, proofIndex uint64) (proofData []byte, hashProofSet []common.Hash, leavesCount uint64, err error) + func Sha256MerkleTreeRoot(b []byte) (h common.Hash) + func Sha256RangeProof(data []byte, proofStart, proofEnd int) (hashPoofSet []common.Hash, err error) + func Sha256SectorRangeProof(roots []common.Hash, proofStart, proofEnd int) (hashProofSet []common.Hash, err error) + func Sha256VerifyDataPiece(dataPiece []byte, hashProofSet []common.Hash, numLeaves, proofIndex uint64, ...) (verified bool) + func Sha256VerifyDiffProof(rangeSet []SubTreeLimit, leavesCount uint64, ...) (err error) + func Sha256VerifyRangeProof(dataWithinRange []byte, hashProofSet []common.Hash, proofStart, proofEnd int, ...) (verified bool, err error) + func Sha256VerifySectorRangeProof(rootsVerify []common.Hash, hashProofSet []common.Hash, ...) (verified bool, err error) + type CachedSubtreeRoot struct + func NewCachedSubtreeRoot(roots [][]byte, h hash.Hash) *CachedSubtreeRoot + func (csh *CachedSubtreeRoot) GetSubtreeRoot(leafIndex int) ([]byte, error) + func (csh *CachedSubtreeRoot) Skip(n int) error + type CachedTree struct + func NewCachedTree(h hash.Hash, height uint64) *CachedTree + func (ct *CachedTree) ProofList(cachedTreeProofList [][]byte) (merkleRoot []byte, proofList [][]byte, storageProofIndex uint64, ...) + func (ct *CachedTree) SetStorageProofIndex(i uint64) error + type LeafRoot interface + GetLeafRoot func() ([]byte, error) + type LeafRootCached struct + func NewLeafRootCached(leafHashes [][]byte) *LeafRootCached + func (clh *LeafRootCached) GetLeafRoot() ([]byte, error) + type LeafRootReader struct + func NewLeafRootReader(r io.Reader, h hash.Hash, leafSize int) *LeafRootReader + func (rlh *LeafRootReader) GetLeafRoot() ([]byte, error) + type Sha256CachedTree struct + func NewSha256CachedTree(height uint64) (ct *Sha256CachedTree) + func (ct *Sha256CachedTree) Prove(proofData []byte, cachedHashProofSet []common.Hash) (hashProofSet []common.Hash) + func (ct *Sha256CachedTree) Push(h common.Hash) + func (ct *Sha256CachedTree) PushSubTree(height int, h common.Hash) (err error) + func (ct *Sha256CachedTree) Root() (h common.Hash) + type Sha256MerkleTree struct + func NewSha256MerkleTree() (mk *Sha256MerkleTree) + func (mt *Sha256MerkleTree) Root() (h common.Hash) + type SubTreeLimit struct + Left uint64 + Right uint64 + type SubtreeRoot interface + GetSubtreeRoot func(n int) ([]byte, error) + Skip func(n int) error + type SubtreeRootReader struct + func NewSubtreeRootReader(r io.Reader, leafNumber int, h hash.Hash) *SubtreeRootReader + func (rsh *SubtreeRootReader) GetSubtreeRoot(leafIndex int) ([]byte, error) + func (rsh *SubtreeRootReader) Skip(n int) (err error) + type Tree struct + func NewTree(h hash.Hash) *Tree + func (t *Tree) ProofList() (merkleRoot []byte, storageProofList [][]byte, storageProofIndex uint64, ...) + func (t *Tree) PushLeaf(data []byte) + func (t *Tree) PushSubTree(height int, sum []byte) error + func (t *Tree) Root() []byte + func (t *Tree) SetStorageProofIndex(i uint64) error