Module core

Source
Expand description

Mixnet core logic.

Structs§

AddressedPacket
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 with to_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.
MixnodeIndex
The index of a mixnode in a session’s mixnode list. The index is always <= MAX_MIXNODE_INDEX.
ReplyMessage
A reply to a previously sent request.
RequestMessage
A request from another node.
RequestMetrics
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 or to_vec is called.
SessionConfig
Configuration that can vary between sessions depending on whether the local node is a mixnode or not.
SessionStatus
The index and phase of the current session.

Enums§

Message
A message received over the mixnet.
MixnodesErr
Error querying the mixnodes for a session.
PostErr
Request/reply posting error.
RelSessionIndex
Relative session index.
SessionPhase
Each session should progress through these phases in order.
TopologyErr
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§

NetworkStatus
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.
MessageId
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.
RawMixnodeIndex
Raw mixnode index type, not guaranteed to be <= MAX_MIXNODE_INDEX.
SessionIndex
Absolute session index.
Surb
A “single-use reply block”. This should be treated as an opaque type.