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
40
41
42
43
44
45
46
47
48
49
// region: SecurityError
/// Errors the server state machine may produce during SecurityAccess handling.
// endregion: SecurityError
// region: SecurityProvider
/// Provides seed generation and key validation for UDS SecurityAccess (0x27).
///
/// The seed/key algorithm is always application-psecific. This trait allows the server to delegate
/// without knowing the algorithm.
///
/// # Security Levels
///
/// UDS security levels use odd bytes for Request Seed (0x01, 0x03, 0x05, ...) and the
/// corresponding even byte for Send Key (0x02, 0x04, 0x06, ...). The `level` parameter is always
/// the RequestSeed byte (odd).
///
/// # Simulation
///
/// In DST the implementation should derive seeds from the injected RNG so that the full exchange
/// is reproducible across simulation runs.
// endregion: SecurityProvider