diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-01-22 23:11:58 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-01-23 08:30:11 +0100 |
| commit | a5d9c04f821b72e27f196ff2015078f87d4d9a5e (patch) | |
| tree | bcf765ce4cd55d6cc89f00405c6a250ce04054e0 /include/test/certs.h | |
| parent | fb1aeb3ffff2948edeb710e65aef261b589c7403 (diff) | |
| download | ouroboros-a5d9c04f821b72e27f196ff2015078f87d4d9a5e.tar.gz ouroboros-a5d9c04f821b72e27f196ff2015078f87d4d9a5e.zip | |
lib: Add automatic key rotation for encryption
Implement forward-secret key rotation using HKDF key derivation. The
operation is based on QUIC RFC 9001 and wireguard.
Keys rotate every 2^KEY_ROTATION_BIT packets, with the current phase
(P) signaled via controlling a bit in the IV (bit 7, first bit on the
wire). Default 20 (1M packets).
The wire format, after the DT header is:
[ P | random IV ][ encrypted blob ][ AEAD tag ]
Works with and without retransmission, and the FRCT header is fully
contained in the encrypted blob if used.
The receiver detects phase changes and rotates accordingly, keeping
the previous key valid during a grace period. This handles packet
reordering in unreliable flows: the 3/4 period protection window
prevents premature rotation when late packets arrive, while the
1/2 period grace window ensures the old key remains available for
decryption.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include/test/certs.h')
0 files changed, 0 insertions, 0 deletions
