Documentation ¶
Index ¶
- func ComputeCompactValue(key []byte, value []byte, nodeHeight int) []byte
- func GetDefaultHashForHeight(height int) []byte
- func GetDefaultHashes() [257][]byte
- func GetRandomKeysFixedN(n int, byteSize int) [][]byte
- func GetRandomKeysRandN(maxN int, byteSize int) [][]byte
- func GetRandomValues(n int, maxByteSize int) [][]byte
- func HashInterNode(hash1 []byte, hash2 []byte) []byte
- func HashLeaf(key []byte, value []byte) []byte
- func IsBitSet(b []byte, idx int) (bool, error)
- func MaxUint16(a, b uint16) uint16
- func SetBit(b []byte, i int) error
- func SplitKeyValues(keys [][]byte, values [][]byte, bitIndex int) ([][]byte, [][]byte, [][]byte, [][]byte, error)
- func SplitSortedKeys(keys [][]byte, bitIndex int) ([][]byte, [][]byte, error)
Constants ¶
This section is empty.
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() [257][]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 GetRandomKeysFixedN ¶
GetRandomKeysFixedN generates n random (no repetition) fixed sized (byteSize) keys
func GetRandomKeysRandN ¶
GetRandomKeysRandN generate m random keys (key size: byteSize), the number of keys generates, m, is also randomly selected from the range [1, maxN]
func GetRandomValues ¶
GetRandomValues generate an slice (len n) of random values (byte slice) of random size from the range [1, maxByteSize]
func HashInterNode ¶
HashInterNode generates hash value for intermediate nodes (SHA3-256).
func IsBitSet ¶
IsBitSet returns if the bit at index `idx` in the byte array `b` is set to 1 (big endian) TODO: remove error return
Types ¶
This section is empty.