Expand description
Mixnet core logic.
Structs§
- Addressed
Packet - A packet plus the ID of the peer it should be sent to.
- Config
- Mixnet configuration.
- Delay
- Unitless delay. Can be converted to a
Duration
withto_duration
. - Events
- Flags to indicate events that have occurred. Note that these may be set spuriously.
- Mixnet
- Mixnet core state.
X
is the type of the extra data stored for each mixnode (Mixnode::extra
). - Mixnode
- Per-mixnode data.
- Mixnode
Index - The index of a mixnode in a session’s mixnode list. The index is always <=
MAX_MIXNODE_INDEX
. - Reply
Message - A reply to a previously sent request.
- Request
Message - A request from another node.
- Request
Metrics - Metrics that can be used to estimate a request’s round-trip time.
- Scattered
- A concatenation of multiple slices. The slices are not copied until
copy_to_slice
orto_vec
is called. - Session
Config - Configuration that can vary between sessions depending on whether the local node is a mixnode or not.
- Session
Status - The index and phase of the current session.
Enums§
- Message
- A message received over the mixnet.
- Mixnodes
Err - Error querying the mixnodes for a session.
- PostErr
- Request/reply posting error.
- RelSession
Index - Relative session index.
- Session
Phase - Each session should progress through these phases in order.
- Topology
Err - Topology error.
Constants§
- KX_
PUBLIC_ SIZE - Size in bytes of a
KxPublic
. - MAX_
HOPS - Maximum number of hops a packet can traverse. Sending a packet directly to the final destination node would count as one hop. Strictly speaking it is possible to construct packets that will traverse slightly more hops than this, but not using this crate.
- MAX_
MIXNODE_ INDEX - Maximum valid mixnode index.
- MESSAGE_
ID_ SIZE - Size in bytes of a
MessageId
. - PACKET_
SIZE - Size in bytes of a
Packet
. - PEER_
ID_ SIZE - Size in bytes of a
PeerId
. - SURB_
SIZE - Size in bytes of a
Surb
.
Traits§
- Network
Status - A trait for querying the peer ID and connectivity of the local node.
Type Aliases§
- KxPublic
- Key-exchange public key.
- KxSecret
- An unclamped key-exchange secret key.
- Message
Id - Message identifier. Should be randomly generated. Attached to fragments to enable reassembly.
- Packet
- Type for packets sent between nodes. Note that all packets are the same size.
- PeerId
- Globally unique identifier for a network peer. This is treated as an opaque type.
- RawMixnode
Index - Raw mixnode index type, not guaranteed to be <=
MAX_MIXNODE_INDEX
. - Session
Index - Absolute session index.
- Surb
- A “single-use reply block”. This should be treated as an opaque type.