LogBuilder

Trait LogBuilder 

Source
pub trait LogBuilder<D, V>{
    // Required methods
    fn checkpoint(&self) -> Checkpoint<D>;
    fn push(&mut self, entry: &V) -> Node;
}
Expand description

A merkle tree log data type based on DAT. where the merkle tree computation is conformant to RFC 6962 - Certificate Transparency. This allows you to efficiently append data and then verify that it the log is consistent over time and contains a given entry.

It represents its data using binary in-order interval numbering. This means that all of the leaf and balanced branch nodes of the tree are stored in one contiguous array using a particular indexing scheme.

§Example

0 X \
1    X
2 X / \
3      X
4 X \ /
5    X
6 X /

§Properties

This has various convenient properties for traversing the structure.

  • The height of a node is the number of trailing ones in its index.
  • For the above reason, leaves always have even indices.
  • The side (left/right) of a node can be computed from its index.
  • The distance between parent/child indices is a simple function of height.

Required Methods§

Source

fn checkpoint(&self) -> Checkpoint<D>

Get the checkpoint (hash and length) of the log at this point.

Source

fn push(&mut self, entry: &V) -> Node

Push a new entry into the log.

Implementors§

Source§

impl<D, V> LogBuilder<D, V> for StackLog<D, V>

Source§

impl<D, V> LogBuilder<D, V> for VecLog<D, V>