Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyProof ¶
func VerifyProof(leafData []byte, proof *MerkleProof, rootHash []byte, hf HashFunction) bool
Types ¶
type HashFunction ¶
type MerkleNode ¶
type MerkleNode struct {
Left *MerkleNode
Right *MerkleNode
Hash []byte
}
type MerkleProof ¶
type MerkleTree ¶
type MerkleTree struct {
Root *MerkleNode
HashFunction HashFunction
Leaves []*MerkleNode
}
func NewMerkleTree ¶
func NewMerkleTree(data [][]byte, hf HashFunction) *MerkleTree
func (*MerkleTree) GenerateProof ¶
func (t *MerkleTree) GenerateProof(index int) (*MerkleProof, error)
func (*MerkleTree) GetRootHash ¶
func (t *MerkleTree) GetRootHash() []byte
func (*MerkleTree) PrintMerkleTree ¶
func (t *MerkleTree) PrintMerkleTree()
func (*MerkleTree) String ¶
func (t *MerkleTree) String() string
type SHA3_256Hash ¶
type SHA3_256Hash struct{}
func (SHA3_256Hash) Hash ¶
func (h SHA3_256Hash) Hash(data []byte) []byte
func (SHA3_256Hash) Name ¶
func (h SHA3_256Hash) Name() string
type SHA256Hash ¶
type SHA256Hash struct{}
func (SHA256Hash) Hash ¶
func (h SHA256Hash) Hash(data []byte) []byte
func (SHA256Hash) Name ¶
func (h SHA256Hash) Name() string
Click to show internal directories.
Click to hide internal directories.