Documentation
¶
Overview ¶
Package historytree implements part of Crosby's and Wallach's history tree data structure, as presented in "Efficient Data Structures for Tamper-Evident Logging", available at http://static.usenix.org/event/sec09/tech/full_papers/crosby.pdf . We provide membership proofs and omit incremental proofs and signing roots. We also support computing the updated roots on the history tree based on a membership proof that fixes the rest of the tree. See the Balloon paper for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MembershipProof ¶
type MembershipProof struct { Nodes []ProofPosition Index, Version int Event, Root []byte }
MembershipProof is a proof of membership of an event.
func (*MembershipProof) Size ¶
func (p *MembershipProof) Size() (bytes int)
Size returns the size in bytes of a membership proof.
func (*MembershipProof) Update ¶
func (p *MembershipProof) Update(events [][]byte) (root []byte, version int, err error)
Update calculates the updated history tree, represented by the valid membership proof for the latest event inserted into a history tree, by inserting the provided events. Returns the updated root, or an error.
func (*MembershipProof) Verify ¶
func (p *MembershipProof) Verify() (correct bool)
Verify verifies a membership proof
type ProofPosition ¶
ProofPosition is a position and its hash in the tree.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a history tree.
func (*Tree) LatestVersion ¶
LatestVersion returns the latest version of the tree.
func (*Tree) MembershipProof ¶
func (t *Tree) MembershipProof(index, version int) (proof MembershipProof, err error)
MembershipProof generates a membership proof.