Documentation ¶
Overview ¶
Package sphinx implements the Katzenpost parameterized Sphinx Packet Format.
Index ¶
- Constants
- func DecryptSURBPayload(payload, keys []byte) ([]byte, error)
- func NewPacket(r io.Reader, path []*PathHop, payload []byte) ([]byte, error)
- func NewPacketFromSURB(surb, payload []byte) ([]byte, *[constants.NodeIDLength]byte, error)
- func NewSURB(r io.Reader, path []*PathHop) ([]byte, []byte, error)
- func Unwrap(privKey *ecdh.PrivateKey, pkt []byte) ([]byte, []byte, []commands.RoutingCommand, error)
- type PathHop
Constants ¶
const ( // HeaderLength is the length of a Sphinx packet header in bytes. HeaderLength = adLength + crypto.GroupElementLength + routingInfoLength + crypto.MACLength // 460 bytes. // PayloadTagLength is the length of the Sphinx packet payload SPRP tag. PayloadTagLength = 16 )
const ( // SURBLength is the length of a Sphinx SURB in bytes. SURBLength = HeaderLength + constants.NodeIDLength + sprpKeyMaterialLength // 556 bytes. )
Variables ¶
This section is empty.
Functions ¶
func DecryptSURBPayload ¶
DecryptSURBPayload decrypts the provided Sphinx payload generated via a SURB with the provided keys, and returns the plaintext. The keys are obliterated at the end of this call.
func NewPacket ¶
NewPacket creates a forward Sphinx packet with the provided path and payload, using the provided entropy source.
func NewPacketFromSURB ¶
NewPacketFromSURB creates a new reply Sphinx packet with the provided SURB and payload, and returns the packet and ID of the first hop.
func NewSURB ¶
NewSURB creates a new SURB with the provided path using the provided entropy source, and returns the SURB and decrypion keys.
func Unwrap ¶
func Unwrap(privKey *ecdh.PrivateKey, pkt []byte) ([]byte, []byte, []commands.RoutingCommand, error)
Unwrap unwraps the provided Sphinx packet pkt in-place, using the provided ECDH private key, and returns the payload (if applicable), replay tag, and routing info command vector.
Types ¶
type PathHop ¶
type PathHop struct { ID [constants.NodeIDLength]byte PublicKey *ecdh.PublicKey Commands []commands.RoutingCommand }
PathHop describes a hop that a Sphinx Packet will traverse, along with all of the per-hop Commands (excluding NextNodeHop).
Directories ¶
Path | Synopsis |
---|---|
Package commands implements the Sphinx Packet Format per-hop routing info commands.
|
Package commands implements the Sphinx Packet Format per-hop routing info commands. |
Package constants contains the Sphinx Packet Format constants for the Katzenpost parameterization.
|
Package constants contains the Sphinx Packet Format constants for the Katzenpost parameterization. |
internal
|
|
crypto
Package crypto provides the Katzenpost parameterization of the Sphinx Packet Format cryptographic operations.
|
Package crypto provides the Katzenpost parameterization of the Sphinx Packet Format cryptographic operations. |
Package path provides routines for path selection.
|
Package path provides routines for path selection. |