core: github.com/katzenpost/core/sphinx/commands Index | Files

package commands

import "github.com/katzenpost/core/sphinx/commands"

Package commands implements the Sphinx Packet Format per-hop routing info commands.

Index

Package Files

commands.go

Constants

const (
    // NextNodeHopLength is the length of a NextNodeHop command in bytes.
    NextNodeHopLength = 1 + constants.NodeIDLength + crypto.MACLength

    // RecipientLength is the length of a Recipient command in bytes.
    RecipientLength = 1 + constants.RecipientIDLength

    // SURBReplyLength is the length of a SURBReply command in bytes.
    SURBReplyLength = 1 + constants.SURBIDLength

    // NodeDelayLength is the length of a NodeDelay command in bytes.
    NodeDelayLength = 1 + 4
)

type NextNodeHop Uses

type NextNodeHop struct {
    ID  [constants.NodeIDLength]byte
    MAC [crypto.MACLength]byte
}

NextNodeHop is a de-serialized Sphinx next_node command.

func (*NextNodeHop) ToBytes Uses

func (cmd *NextNodeHop) ToBytes(b []byte) []byte

ToBytes appends the serialized NextNodeHop to slice b, and returns the resulting slice.

type NodeDelay Uses

type NodeDelay struct {
    Delay uint32
}

NodeDelay is a de-serialized Sphinx mix_delay command.

func (*NodeDelay) ToBytes Uses

func (cmd *NodeDelay) ToBytes(b []byte) []byte

ToBytes appends the serialized NodeDelay to slice b, and returns the resulting slice.

type Recipient Uses

type Recipient struct {
    ID [constants.RecipientIDLength]byte
}

Recipient is a de-serialized Sphinx recipient command.

func (*Recipient) ToBytes Uses

func (cmd *Recipient) ToBytes(b []byte) []byte

ToBytes appends the serialized Recipeient to slice b, and returns the resulting slice.

type RoutingCommand Uses

type RoutingCommand interface {
    // ToBytes appends the serialized command to slice b, and returns the
    // resulting slice.
    ToBytes(b []byte) []byte
}

RoutingCommand is the common interface exposed by all per-hop routing command structures.

func FromBytes Uses

func FromBytes(b []byte) (cmd RoutingCommand, rest []byte, err error)

FromBytes deserializes the first per-hop routing command in the buffer b, returning a RoutingCommand and the remaining bytes (if any), or an error.

type SURBReply Uses

type SURBReply struct {
    ID [constants.SURBIDLength]byte
}

SURBReply is a de-serialized Sphinx surb-reply command.

func (*SURBReply) ToBytes Uses

func (cmd *SURBReply) ToBytes(b []byte) []byte

ToBytes appends the serialized SURBReply to slice b, and returns the resulting slice.

Package commands imports 5 packages (graph) and is imported by 5 packages. Updated 2019-08-18. Refresh now. Tools for package owners.