Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Packet ¶
type Packet struct { Version byte *Header // packet payload has a fixed size and is obfuscated at each hop Payload [payloadSize]byte }
func NewPacket ¶
func NewPacket(sessionKey *ecdsa.PrivateKey, circuitPubKeys []ecdsa.PublicKey, finalAddr []byte, relayAddrs [][]byte, payload [payloadSize]byte) (*Packet, error)
NewPacket creates a new packet to be forwarded to the first relay in the secure circuit. It takes an ephemeral session key, the destination information (address and payload) and relay information (public keys and addresses) and constructs a cryptographically secure onion packet. The packet is then encoded and sent over the wire to the first relay. This is the entry point function for an initiator to construct a onion circuit.
type RelayerCtx ¶
type RelayerCtx struct {
// contains filtered or unexported fields
}
func NewRelayerCtx ¶
func NewRelayerCtx(privKey *ecdsa.PrivateKey) *RelayerCtx
func (*RelayerCtx) ListProcessedPackets ¶
func (r *RelayerCtx) ListProcessedPackets() [][32]byte
returns list tags of each of the processed packets by the current relay context
func (*RelayerCtx) ProcessPacket ¶
func (r *RelayerCtx) ProcessPacket(packet *Packet) ([addrSize]byte, *Packet, error)
processes packet in a given relayer context
Click to show internal directories.
Click to hide internal directories.