Documentation ¶
Index ¶
- Constants
- func ComputeCompactValue(path []byte, payload *ledger.Payload, nodeHeight int) []byte
- func GetDefaultHashForHeight(height int) []byte
- func GetDefaultHashes() [defaultHashLen][]byte
- func HashInterNode(hash1 []byte, hash2 []byte) []byte
- func HashLeaf(path []byte, value []byte) []byte
- func VerifyTrieBatchProof(bp *ledger.TrieBatchProof, expectedState ledger.State) bool
- func VerifyTrieProof(p *ledger.TrieProof, expectedState ledger.State) bool
Constants ¶
const HashLen = 32
HashLen is the default output hash length in bytes
Variables ¶
This section is empty.
Functions ¶
func ComputeCompactValue ¶
ComputeCompactValue computes the value for the node considering the sub tree to only include this value and default values.
func GetDefaultHashForHeight ¶
GetDefaultHashForHeight returns the default hashes of the SMT at a specified height.
For each tree level N, there is a default hash equal to the chained hashing of the default value N times.
func GetDefaultHashes ¶
func GetDefaultHashes() [defaultHashLen][]byte
GetDefaultHashes returns the default hashes of the SMT.
For each tree level N, there is a default hash equal to the chained hashing of the default value N times.
func HashInterNode ¶
HashInterNode generates hash value for intermediate nodes (SHA3-256).
hash1 and hash2 must each be a 32 byte slice.
func HashLeaf ¶
HashLeaf generates hash value for leaf nodes (SHA3-256).
path must be a 32 byte slice. note that we don't include the keys here as they are already included in the path
func VerifyTrieBatchProof ¶
func VerifyTrieBatchProof(bp *ledger.TrieBatchProof, expectedState ledger.State) bool
VerifyTrieBatchProof verifies all the proof inside the batchproof
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package encoding provides byte serialization and deserialization of trie and ledger structs.
|
Package encoding provides byte serialization and deserialization of trie and ledger structs. |
Package pathfinder computes the trie storage path for any given key/value pair
|
Package pathfinder computes the trie storage path for any given key/value pair |