Documentation ¶
Index ¶
- Constants
- func IdentityHashForTest(strbytes []byte) []byte
- func Sha256DoubleHash(data []byte) []byte
- func VerifyProof(leafHash []byte, pathToTarget []*ProofPart, target []byte) bool
- func VerifyProofCustomHash(leafHash []byte, pathToTarget []*ProofPart, target []byte, ...) bool
- type Branch
- type HashToStrFunc
- type Leaf
- type Node
- type Proof
- type ProofPart
- type Tree
Constants ¶
View Source
const (
ProofPartSerializeSize = 1 + 32
)
Variables ¶
This section is empty.
Functions ¶
func IdentityHashForTest ¶
func Sha256DoubleHash ¶
Types ¶
type HashToStrFunc ¶
type Leaf ¶
func NewLeafFromHash ¶
type Proof ¶
type Proof struct { HashFunc func(isLeaf bool, xs []byte) []byte // PathToRoot is a path from the LeafHash up to the root of the Merkle // tree. Note that the LeafHash and the Root hash are not included in // the this list. Rather, the list is everything in between these two // items. To put it visually, below is how to think about a Merkle proof // as it is described by this library: // // RootHash // / \ // ... PathToRoot ... // / \ // ... LeafHash ... // PathToRoot []*ProofPart // LeafHash is the hash of an element at the lowest level of // the Merkle tree. It is the hash of the element we want to // prove actually exists in the tree. LeafHash []byte }
func (*Proof) ToString ¶
func (m *Proof) ToString(f HashToStrFunc) string
type ProofPart ¶
func (*ProofPart) Deserialize ¶
type Tree ¶
func NewTreeFromHashes ¶
Click to show internal directories.
Click to hide internal directories.