code wiki / (root) / nx_tls13_record_test.nx

nx_tls13_record_test.nx

buildroot/runtime/nx_tls13_record_test.nx

6800 B192 linesdepth 7pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_record_test.nx -- internal-consistency KAT for the TLS 1.3 record-layer protection wrapper. We don't pin to RFC 8448 ยง3 wire bytes here because those depend on the full key schedule + traffic-secret derivation tied to specific handshake messages. Instead we verify: A. Round-trip: encrypt then decrypt restores plaintext + type B. Nonce-with-seq: encrypt(seq=0) != encrypt(seq=1) given same (key, iv, content) -- confirms IV XOR seq actually varies the keystream C. Tampered tag rejected (TAG_MISMATCH) D. Tampered header (wrong length in AAD) rejected E. Padding: encrypt with padding_len > 0, decrypt strips it F. All-zeros inner (no type byte) rejected (EMPTY_INNER) G. Nonce construction byte-exact for known (iv, seq) pair expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_chacha20_poly1305.nx nx_tls13_record.nx nx_tls13_record_test.nx

imports: nx_syscalls.nxnx_chacha20_poly1305.nxnx_tls13_record.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap tls13_record_build_nonce nx_tls13_record_encrypt nx_tls13_record_encrypt_v2 sys_mmap ↻ tls13_record_write_header tls13_record_build_nonce ↻ tls13_record_aead_seal nx_chacha20_poly1305_encry sys_mmap ↻ aead_derive_otk sys_mmap ↻ chacha20_block chacha20_encrypt sys_mmap ↻ _chacha20_set_consts_key load_u32_le chacha20_perm_core aead_build_mac_data aead_put_u64_le poly1305_mac sys_mmap ↻ poly1305_clamp p_load_u32_le p_store_u32_le nx_aes128_gcm_seal sys_mmap ↻ aes128_expand_key _aes_sbox _aes_rcon aes128_encrypt_block nx_ghash_reflect16 gh_byterev_bits nx_ghash_mul_rev gh_clmul_core nx_ghash_upd_rev gh_rev_scratch gh_byterev_bits ↻ gh_clmul_core ↻

structs

none

consts

none

functions

25func main() -> i64