Expand description
Session Index Allocator
Manages allocation of 32-bit session indices for O(1) packet dispatch. Each Noise session receives a unique index chosen by the receiver; incoming encrypted packets include the receiver’s index for fast lookup.
§Design
- Indices are random (cryptographically secure) to prevent guessing
- Unique per transport to avoid collision between transports
- 32-bit space supports ~65K concurrent sessions before birthday collision
- Indices are rotated on rekey for anti-correlation
§Wire Format
Encrypted frames include receiver_idx for session lookup:
[0x00][receiver_idx:4 LE][counter:8 LE][ciphertext+tag]Structs§
- Index
Allocator - Allocator for session indices within a single transport.
- Session
Index - A 32-bit session index.
Enums§
- Index
Error - Errors related to index allocation.