confirm

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicString = "cn"
	Len         = magicbytes.Len + nonce.IDLen
)

Variables

View Source
var (
	Magic = slice.Bytes(MagicString)
)

Functions

This section is empty.

Types

type Callback

type Callback struct {
	nonce.ID
	time.Time
	Onion *Layer
	Hook
}

type Confirms

type Confirms struct {
	sync.Mutex
	Cnf []Callback
}

func NewConfirms

func NewConfirms() *Confirms

func (*Confirms) Add

func (cn *Confirms) Add(cb *Callback)

func (*Confirms) Confirm

func (cn *Confirms) Confirm(id nonce.ID) bool

func (*Confirms) Flush

func (cn *Confirms) Flush(timePast time.Time)

Flush clears out entries older than timePast.

type Hook

type Hook func(cf nonce.ID)

type Layer

type Layer struct {
	nonce.ID
}

Layer confirmation is an encryption crypt for messages returned to the client on the inside of an onion, for Ping and Ciphers messages, providing a confirmation of the transit of the onion through its encoded route.

It is encrypted because otherwise internal identifiers could be leaked and potentially reveal something about the entropy of a client/relay.

In order to speed up recognition, the key of the table of pending Ping and Ciphers messages will include the last hop that will deliver this crypt of the onion - there can be more than one up in the air at a time, but they are randomly selected, so they will generally be a much smaller subset versus the current full set of Session s currently open.

func (*Layer) Decode

func (x *Layer) Decode(b slice.Bytes, c *slice.Cursor) (e error)

func (*Layer) Encode

func (x *Layer) Encode(b slice.Bytes, c *slice.Cursor)

func (*Layer) Inner

func (x *Layer) Inner() types.Onion

func (*Layer) Insert

func (x *Layer) Insert(o types.Onion)

func (*Layer) Len

func (x *Layer) Len() int

func (*Layer) String

func (x *Layer) String() string

Jump to

Keyboard shortcuts

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