1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! The executor's hasher seam: the one place each hashing policy is
//! spelled, so a table picks a policy by name instead of re-spelling it.
//!
//! * [`FxBuildHasher`] — the keyless FxHash for engine-allocated dense ids
//! (the `CoreMap` family, the distinct set's node/rel word tables). Ids no
//! client can choose; ADR-0355 bars it from attacker-writable keys.
//! * [`shared_random_state`] — the one process-wide seeded SipHash state
//! (LABS-822) for every table whose keys a client can influence.
use RandomState;
use OnceLock;
/// FxHash as a `BuildHasher`: the hasher of the `CoreMap` family and of
/// every other engine-id table. Keyless — never for client-controlled keys.
pub type FxBuildHasher = BuildHasherDefault;
/// An engine-id table on [`FxBuildHasher`] — the spelled `std` map type
/// for the dense-id policy (the shortest-path searches' trees and
/// predecessor tables), so a table names the seam instead of the
/// dependency. [`crate::graph::CoreMap`] is the concurrent spelling.
pub type FxMap<K, V> = HashMap;
/// The seeded build-hasher of every table whose keys a client can
/// influence: the one name for the policy [`shared_random_state`]
/// constructs, spelled at type boundaries instead of `RandomState`.
pub type SeededState = RandomState;
/// The one process-wide seed behind [`shared_random_state`] (LABS-822).
static SHARED_RANDOM_STATE: = new;
/// The process-wide seeded hasher state, cloned per table. A `RandomState`
/// clone copies two seed words and never re-reads the thread-local RNG
/// cell, whose read LABS-822 measured as the classic walker's hot cost
/// when every used-set built a fresh `RandomState`. The seed stays secret
/// for the process lifetime, so sharing it carries the same HashDoS
/// exposure as std's per-thread seed.
pub