package
0.22.0
Repository: https://go.googlesource.com/mod
Documentation: pkg.go.dev

# Functions

CheckRecord verifies that p is a valid proof that the tree of size t with hash th has an n'th record with hash h.
CheckTree verifies that p is a valid proof that the tree of size t with hash th contains as a prefix the tree of size n with hash h.
FormatRecord formats a record for serving to a client in a lookup response.
FormatTree formats a tree description for inclusion in a note.
HashFromTile returns the hash at the given storage index, provided that t == TileForIndex(t.H, index) or a wider version, and data is t's tile data (of length at least t.W*HashSize).
NewTiles returns the coordinates of the tiles of height h ≥ 1 that must be published when publishing from a tree of size newTreeSize to replace a tree of size oldTreeSize.
NodeHash returns the hash for an interior tree node with the given left and right hashes.
ParseHash parses the base64-encoded string form of a hash.
ParseRecord parses a record description at the start of text, stopping immediately after the terminating blank line.
ParseTilePath parses a tile coordinate path.
ParseTree parses a formatted tree root description.
ProveRecord returns the proof that the tree of size t contains the record with index n.
ProveTree returns the proof that the tree of size t contains as a prefix all the records from the tree of smaller size n.
ReadTileData reads the hashes for tile t from r and returns the corresponding tile data.
RecordHash returns the content hash for the given record data.
SplitStoredHashIndex is the inverse of [StoredHashIndex].
StoredHashCount returns the number of stored hashes that are expected for a tree with n records.
StoredHashes returns the hashes that must be stored when writing record n with the given data.
StoredHashesForRecordHash is like [StoredHashes] but takes as its second argument RecordHash(data) instead of data itself.
StoredHashIndex maps the tree coordinates (level, n) to a dense linear ordering that can be used for hash storage.
TileForIndex returns the tile of fixed height h ≥ 1 and least width storing the given hash storage index.
TileHashReader returns a HashReader that satisfies requests by loading tiles of the given tree.
TreeHash computes the hash for the root of the tree with n records, using the HashReader to obtain previously stored hashes (those returned by StoredHashes during the writes of those n records).

# Constants

HashSize is the size of a Hash in bytes.

# Structs

A Tile is a description of a transparency log tile.
A Tree is a tree description, to be signed by a go.sum database server.

# Interfaces

A HashReader can read hashes for nodes in the log's tree structure.
A TileReader reads tiles from a go.sum database log.

# Type aliases

A Hash is a hash identifying a log record or tree root.
A HashReaderFunc is a function implementing [HashReader].
A RecordProof is a verifiable proof that a particular log root contains a particular record.
A TreeProof is a verifiable proof that a particular log tree contains as a prefix all records present in an earlier tree.