auditor

package
v0.0.0-...-cde1561 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package auditor implements a stateful third-party auditor for a transparency log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

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

Auditor represents a third-party auditor of a transparency log.

func NewAuditor

func NewAuditor(
	config *structs.PublicConfig,
	auditorKey suites.SigningPrivateKey,
	tx db.AuditorStore,
) (*Auditor, error)

NewAuditor returns a new Third-Party Auditor for a Transparency Log. `config` is the transparency log's public configuration, `auditorKey` is the auditor's private signing key, and `tx` is the auditor's persistent storage.

func (*Auditor) Commit

func (a *Auditor) Commit() (*structs.AuditorTreeHead, error)

Commit signs the auditor's tree head, commits it to the database, and returns it.

func (*Auditor) Process

func (a *Auditor) Process(update *structs.AuditorUpdate) error

Process takes an AuditorUpdate as input and updates the auditor's internal state, returning an error if any issues with the update were detected. If the update fails to process, no auditor state is changed. Successfully processed updates are not persisted until `Commit` is called.

type AuditorState

type AuditorState struct {
	TreeHead     structs.AuditorTreeHead // Last tree head issued by auditor.
	FullSubtrees [][]byte                // Full subtrees of the log tree.
	Timestamps   []uint64                // Timestamps of the log entries along the frontier.
	PrefixTree   []byte                  // Prefix tree root hash of the rightmost log entry.

	Inserted []InsertedVrfOutput // List of recently-inserted VRF outputs.
}

AuditorState is the state of an Auditor that's persisted to a database.

func NewAuditorState

func NewAuditorState(cs suites.CipherSuite, buf *bytes.Buffer) (*AuditorState, error)

func (*AuditorState) Marshal

func (as *AuditorState) Marshal() ([]byte, error)

type InsertedVrfOutput

type InsertedVrfOutput struct {
	Pos       uint64
	VrfOutput []byte
}

InsertedVrfOutput pairs a VRF output that was recently inserted into the audited transparency log's prefix tree with the position in the log where it was inserted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL