Documentation ¶
Overview ¶
Package sphinx implements the Katzenpost parameterized Sphinx Packet Format.
Index ¶
- type PathHop
- type Sphinx
- func (s *Sphinx) DecryptSURBPayload(payload, keys []byte) ([]byte, error)
- func (s *Sphinx) Geometry() *geo.Geometry
- func (s *Sphinx) NewPacket(r io.Reader, path []*PathHop, payload []byte) ([]byte, error)
- func (s *Sphinx) NewPacketFromSURB(surb, payload []byte) ([]byte, *[constants.NodeIDLength]byte, error)
- func (s *Sphinx) NewSURB(r io.Reader, path []*PathHop) ([]byte, []byte, error)
- func (s *Sphinx) Unwrap(privKey interface{}, pkt []byte) ([]byte, []byte, []commands.RoutingCommand, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathHop ¶
type PathHop struct { ID [constants.NodeIDLength]byte NIKEPublicKey nike.PublicKey KEMPublicKey kem.PublicKey Commands []commands.RoutingCommand }
PathHop describes a hop that a Sphinx Packet will traverse, along with all of the per-hop Commands (excluding NextNodeHop).
type Sphinx ¶
type Sphinx struct {
// contains filtered or unexported fields
}
Sphinx is a modular implementation of the Sphinx cryptographic packet format that has a pluggable NIKE, non-interactive key exchange.
func FromGeometry ¶
FromGeometry returns Sphinx type given a valid Geometry.
func NewKEMSphinx ¶
NewKEMSphinx creates a new instance of KEMSphinx, the Sphinx nested cryptographic packet format that uses a KEM instead of a NIKE. This implies lots of packet over, one KEM encapsulation per hop actually. But since we no longer use 2400 maude modems let's rock out with our Hybrid Classical + PQ KEM Sphinx.
func (*Sphinx) 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 (*Sphinx) NewPacket ¶
NewPacket creates a forward Sphinx packet with the provided path and payload, using the provided entropy source.
func (*Sphinx) NewPacketFromSURB ¶
func (s *Sphinx) NewPacketFromSURB(surb, payload []byte) ([]byte, *[constants.NodeIDLength]byte, error)
NewPacketFromSURB creates a new reply Sphinx packet with the provided SURB and payload, and returns the packet and ID of the first hop.
func (*Sphinx) NewSURB ¶
NewSURB creates a new SURB with the provided path using the provided entropy source, and returns the SURB and decrypion keys.
func (*Sphinx) Unwrap ¶
func (s *Sphinx) Unwrap(privKey interface{}, pkt []byte) ([]byte, []byte, []commands.RoutingCommand, error)
Unwrap unwraps the provided Sphinx packet pkt in-place, using the provided NIKE or KEM private key, and returns the payload (if applicable), replay tag, and routing info command vector.
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. |