Proofs
Omtls.lean (Lean 4, core library only, no Mathlib) states and proves properties of small MODELS of the
record layer and key schedule in src/tls.om:
| Theorem | What it says | Model of |
|---|---|---|
record_fits | every record the reader accepts (at most 2^14 plaintext or 2^14 + 256 protected bytes) fits the 16645-byte record buffer with its 5-byte header | ot_tl_rdrec |
inner_fits_pending | after the record_overflow check, the inner plaintext fits the 16400-byte pending buffer | ot_tl_dec, ot_tl_pump1 |
hs_body_fits | a 24-bit handshake length fits the 2^24 - 1 byte reassembly buffer | ot_tl_rdhs |
queue_fits | the handshake byte queue never overflows | ot_tl_fill |
nonce_injective | for one key and iv, distinct sequence numbers give distinct nonces | ot_tl_nonce (RFC 8446 5.3) |
seq_fits | the sequence number never wraps (2^64 - 1 is refused) | ot_tl_dec, ot_tl_wrec |
hkdfLabel_length, hkdfLabel_fits | the HkdfLabel encoding's length, and that it fits the 330-byte info buffer | ot_tl_info (RFC 8446 7.1) |
labels_distinct, labels_short, hkdfLabel_injective_label | the nine key-schedule labels are distinct and short, and the encoding determines the label, so no two derivations from one secret share an HKDF info input | ot_tl_info, ot_tl_derive, ot_tl_keys |
NOT_PROVEN: that the compiled Omega code implements these models (the tests carry that weight: the RFC 8448 replay checks the key schedule and nonces byte for byte), and anything about the cryptographic strength of SHA-256, HKDF, the AEADs or X25519.
Check: lean proofs/Omtls.lean exits 0 with no output (Lean 4; the version used is in the report).