tlogx

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalCheckpoint

func MarshalCheckpoint(c Checkpoint) string

func NewTilesForSize

func NewTilesForSize(h int, oldTreeSize, newTreeSize int64) []tlog.Tile

NewTilesForSize is like tlog.NewTiles but only lists the largest partial tile for each coordinate.

This makes only the tree of size newTreeSize retrievable, and not the trees of sizes oldTreeSize+1 to newTreeSize-1 (until the relevant full tiles are available), assuming tiles for oldTreeSize were similarly generated.

NewTilesForSize also doesn't return tiles that have not grown since oldTreeSize; it's unclear why tlog.NewTiles does.

Types

type Checkpoint

type Checkpoint struct {
	Origin    string
	N         int64
	Hash      tlog.Hash
	Extension string
}

func ParseCheckpoint

func ParseCheckpoint(text string) (Checkpoint, error)

type InjectedSigner

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

func NewInjectedSigner

func NewInjectedSigner(name string, alg uint8, key, sig []byte) (*InjectedSigner, error)

NewInjectedSigner constructs a new InjectedSigner that produces note signatures bearing the provided fixed value.

func (*InjectedSigner) KeyHash

func (v *InjectedSigner) KeyHash() uint32

func (*InjectedSigner) Name

func (v *InjectedSigner) Name() string

func (*InjectedSigner) Sign

func (s *InjectedSigner) Sign(msg []byte) ([]byte, error)

func (*InjectedSigner) Verifier

func (s *InjectedSigner) Verifier() note.Verifier

func (*InjectedSigner) Verify

func (v *InjectedSigner) Verify(msg, sig []byte) bool

type RFC6962Verifier

type RFC6962Verifier struct {

	// Timestamp, if not nil, is called with the timestamp extracted from any
	// valid verified signature.
	Timestamp func(uint64)
	// contains filtered or unexported fields
}

func NewRFC6962Verifier

func NewRFC6962Verifier(name string, key crypto.PublicKey) (*RFC6962Verifier, error)

NewRFC6962Verifier constructs a new RFC6962Verifier that verifies a RFC 6962 TreeHeadSignature formatted per c2sp.org/checkpoint.

func (*RFC6962Verifier) KeyHash

func (v *RFC6962Verifier) KeyHash() uint32

func (*RFC6962Verifier) Name

func (v *RFC6962Verifier) Name() string

func (*RFC6962Verifier) Verify

func (v *RFC6962Verifier) Verify(msg, sig []byte) bool

Jump to

Keyboard shortcuts

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