@@ -24,12 +24,18 @@ is converted to an x25519 key using the algorithm as implemented by libsodium.
24
24
NOTE: while it is likely ok to reuse the key for singing and diffie hellman it is strongly advised
25
25
not to reuse the key for other protocols like VRF or threshold signatures.
26
26
27
- ## Handshake session
27
+ ## Crypto algorithms
28
28
29
29
Using xoodyak (a finalist in the on-going NIST light weight crypto competition), the following
30
30
sequence of operations are performed for deriving the 0rtt-key, 1rtt-key and next-1rtt-key. For
31
31
fast authenticated encryption a chacha8poly1305 cipher is used.
32
32
33
+ ## Session
34
+
35
+ The initial packet contains the ephemeral client public key, the encrypted client static public key
36
+ and the encrypted client transport parameters. After the initial packet 0-rtt packets can be sent
37
+ using the ` initiator-0rtt-key ` without having to wait for a response from the server.
38
+
33
39
```
34
40
Initial:
35
41
| Cyclist({}, {}, {})
@@ -46,7 +52,13 @@ c | Encrypt(client_transport_parameters)
46
52
t | Squeeze(16)
47
53
| initiator-0rtt-key = SqueezeKey(32)
48
54
| responder-0rtt-key = SqueezeKey(32)
49
- ...
55
+ ```
56
+
57
+ After receiving an initial packet the server produces a handshake packet containing the encrypted
58
+ server ephemeral public key and the encrypted server transport parameters. After the handshake
59
+ packet 1-rtt packets can be sent. Once all 0-rtt packets have been acked the keys are discarded.
60
+
61
+ ```
50
62
Handshake:
51
63
c | Encrypt(e)
52
64
| Absorb(ee)
@@ -55,8 +67,13 @@ c | Encrypt(server_transport_parameters)
55
67
t | Squeeze(16)
56
68
| initiator-1rtt-key = SqueezeKey(32)
57
69
| responder-1rtt-key = SqueezeKey(32)
58
- ...
59
- Data:
70
+ ```
71
+
72
+ During the transport session the 1-rtt keys might need to be rotated. This happens when approaching
73
+ ` u64::MAX ` sent packets or if requested by the other party. See the quic spec for details.
74
+
75
+ ```
76
+ Key rotation:
60
77
| Ratchet()
61
78
| initiator-next-1rtt-key = SqueezeKey(32)
62
79
| responder-next-1rtt-key = SqueezeKey(32)
@@ -69,6 +86,18 @@ valid `quinn-noise` version.
69
86
70
87
- [ 0] https://github.com/quicwg/base-drafts/wiki/QUIC-Versions
71
88
89
+ ## Header protection
90
+
91
+ Header protection/obfuscation serves to prevent middle boxes from reading the header. Modification
92
+ is not possible since the header is passed as associated data to the cipher. The idea is that if
93
+ the header changes in a future quic version, middle boxes may drop the packets because they can't
94
+ read the header. But header protection/obfuscation only makes it harder not impossible. Due to
95
+ being questionable if it serves it's purpose it was decided that no header obfuscation is applied.
96
+
97
+ ## Retry mechanism
98
+
99
+ The retry mechanism is identical to what is specified in the quic-tls spec.
100
+
72
101
## License
73
102
74
103
MIT OR Apache-2.0
0 commit comments