package core

import "github.com/google/trillian/skylog/core"

Package core contains code for a scalable Merkle tree construction.

Index

Types

type BuildJob

type BuildJob struct {
	RangeStart uint64   // The beginning of the range.
	Hashes     [][]byte // The leaf hashes.
}

BuildJob is a slice of leaf data hashes spanning a range of a Merkle tree.

type BuildWorker

type BuildWorker struct {
	// contains filtered or unexported fields
}

BuildWorker processes tree building jobs.

func NewBuildWorker

func NewBuildWorker(tw storage.TreeWriter, rf *compact.RangeFactory) *BuildWorker

NewBuildWorker returns a new BuildWorker for the specified tree.

func (*BuildWorker) Process

func (b *BuildWorker) Process(ctx context.Context, job BuildJob) (*compact.Range, error)

Process handles a single build job. It populates the tree storage with the leaf hashes from the slice in the job, and all internal nodes of the tree that can be inferred from them. Returns the compact range of the resulting tree segment.

Source Files

builder.go

Version
v1.3.8
Published
Feb 18, 2020
Platform
js/wasm
Imports
4 packages
Last checked
9 minutes ago

Tools for package owners.