indverify

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package indverify is a second implementation of what a verifier of bdns proofs does, written from the specification (docs/spec.md sections 4 and 13) and RFC 9162 alone. It imports nothing of bdns, so a test that holds a proof to it holds the proof to the specification and not to the codec's own verifier. It is for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Absent

func Absent(before, after *Presence, root [32]byte, count uint64, key []byte, prefix bool) bool

Absent is the proof of absence of spec section 4, for one key or, with prefix, for every key that starts with key.

func Encode

func Encode(l *Leaf) []byte

Encode is the leaf's canonical CBOR array.

func Holds

func Holds(p *Proof, root [32]byte, count uint64) bool

Holds is section 13's rule: with no leaf present, section 4's absence; one key present is that leaf under the root and no neighbor; a whole name present is its leaves, adjacent, and on either side a leaf outside the name or the end of the state.

func Inclusion

func Inclusion(p *Presence, root [32]byte, count uint64) bool

Inclusion is RFC 9162 section 2.1.3.2.

func Key

func Key(l *Leaf) []byte

Key is the leaf's key.

func KeyOf

func KeyOf(n []string, typ uint16, scope []byte) []byte

KeyOf is the key of a name, a type and a scope.

func NamePrefix

func NamePrefix(n []string) []byte

NamePrefix is what the key of every leaf at a name starts with.

func Root

func Root(leaves [][]byte) [32]byte

Root is RFC 6962's MTH over leaf encodings.

Types

type Leaf

type Leaf struct {
	Name  []string
	Type  uint16
	TTL   uint32
	Data  [][]Part
	Scope []byte
}

Leaf is a leaf's five items.

type Part

type Part struct {
	IsName   bool
	Absolute bool
	Name     []string
	Bytes    []byte
}

Part is one part of a record's data: bytes, or a name.

type Presence

type Presence struct {
	Leaf  *Leaf
	Index uint64
	Path  [][32]byte
}

Presence is a leaf, its index and its audit path.

type Proof

type Proof struct {
	Whole         bool
	Name          []string
	Type          uint16
	Scope         []byte
	Present       []*Presence
	Before, After *Presence
}

Proof is a proof of spec section 13, decoded: what it is about, the leaves there and the neighbors.

Jump to

Keyboard shortcuts

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