geo

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0, AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Geometry

type Geometry struct {

	// PacketLength is the length of a packet.
	PacketLength int

	// NrHops is the number of hops, this indicates the size
	// of the Sphinx packet header.
	NrHops int

	// HeaderLength is the length of the Sphinx packet header in bytes.
	HeaderLength int

	// RoutingInfoLength is the length of the routing info portion of the header.
	RoutingInfoLength int

	// PerHopRoutingInfoLength is the length of the per hop routing info.
	PerHopRoutingInfoLength int

	// SURBLength is the length of SURB.
	SURBLength int

	// SphinxPlaintextHeaderLength is the length of the plaintext header.
	SphinxPlaintextHeaderLength int

	// PayloadTagLength is the length of the payload tag.
	PayloadTagLength int

	// ForwardPayloadLength is the size of the payload.
	ForwardPayloadLength int

	// UserForwardPayloadLength is the size of the usable payload.
	UserForwardPayloadLength int

	// NextNodeHopLength is derived off the largest routing info
	// block that we expect to encounter. Everything else just has a
	// NextNodeHop + NodeDelay, or a Recipient, both cases which are
	// shorter.
	NextNodeHopLength int

	// SPRPKeyMaterialLength is the length of the SPRP key.
	SPRPKeyMaterialLength int

	// NIKEName is the name of the NIKE scheme used by the mixnet's Sphinx packet.
	// NIKEName and KEMName are mutually exclusive.
	NIKEName string

	// KEMName is the name of the KEM scheme used by the mixnet's Sphinx packet.
	// NIKEName and KEMName are mutually exclusive.
	KEMName string
}

Geometry describes the geometry of a Sphinx packet.

func GeometryFromUserForwardPayloadLength

func GeometryFromUserForwardPayloadLength(nike nike.Scheme, userForwardPayloadLength int, withSURB bool, nrHops int) *Geometry

func KEMGeometryFromUserForwardPayloadLength

func KEMGeometryFromUserForwardPayloadLength(kem kem.Scheme, userForwardPayloadLength int, withSURB bool, nrHops int) *Geometry

func (*Geometry) Display

func (g *Geometry) Display() string

func (*Geometry) Hash

func (g *Geometry) Hash() []byte

func (*Geometry) KEM

func (g *Geometry) KEM() kem.Scheme

func (*Geometry) NIKE

func (g *Geometry) NIKE() nike.Scheme

func (*Geometry) Scheme

func (g *Geometry) Scheme() (nike.Scheme, kem.Scheme)

func (*Geometry) String

func (g *Geometry) String() string

func (*Geometry) Validate

func (g *Geometry) Validate() error

Validate returns an error if one of it's validation checks fails. Note however that currently we only validate a few of the Geometry fields. This is not meant to be exhaustive, but more checks could be added.

Jump to

Keyboard shortcuts

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