code wiki / (root) / nx_tls13_full_tcp_test.nx

nx_tls13_full_tcp_test.nx

buildroot/runtime/nx_tls13_full_tcp_test.nx

16614 B479 linesdepth 10pulls 34 transitivereach 0 importersview sourcekind gate/prooftopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_full_tcp_test.nx -- full TLS 1.3 handshake over real TCP with AEAD-protected EE/Cert/CV/SF/CF records using the handshake-derived traffic keys. Wire bytes (from ServerHello onward) bit-identical to real TLS 1.3. Built per F6 friction-catalog discipline: every function <10 lets + <6 params + single-line call args, no monolithic run_client. expect_exit: 0 license_tier: ORIGINAL

dependencies 13 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_x25519.nx nx_tls13.nx nx_tls13_ext.nx nx_tls13_hello.nx nx_tls13_finished.nx nx_tls13_transcript.nx nx_tls13_handshake.nx nx_tls13_schedule.nx nx_tls13_full_tcp_test.nx

diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_connect.nxnx_x25519.nxnx_tls13.nxnx_tls13_ext.nxnx_tls13_hello.nxnx_tls13_finished.nxnx_tls13_transcript.nxnx_tls13_handshake.nxnx_tls13_schedule.nxnx_tls13_client.nxnx_tls13_server.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 build_addr sys_socket sys_bind sys_listen sys_fork nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll run_client sys_mmap ↻ fill_client_priv setup_keypair sys_mmap ↻ x25519 nx_scratch_save nx_scratch_init sys_mmap ↻ nx_scratch nx_scratch_init ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ fe_alloc nx_scratch ↻ fe_from_bytes fe_one fe_zero fe_zero ↻ fe_copy x25519_ladder_step fe_cswap nx_scratch_save ↻ fe_alloc ↻ fe_add fe_sq

structs

none

consts

27const TEST_PORT: i64 = 19446

functions

31func build_addr(out: *u8, port: i64) -> i64
called by 1: main
41func read_n(fd: i64, buf: *u8, n: i64) -> i64
51func send_plain(fd: i64, buf: *u8, n: i64) -> i64
62func recv_plain(fd: i64, buf: *u8, cap: i64) -> i64
called by 2: run_clientrun_server calls 2: sys_mmapread_n
73func send_aead(fd: i64, key: *u8, iv: *u8, seq: i64, payload: *u8, payload_len: i64) -> i64
85func recv_aead(fd: i64, key: *u8, iv: *u8, seq: i64, out: *u8, out_cap: i64) -> i64
105func setup_keypair(priv: *u8, pub: *u8) -> i64
called by 2: run_clientrun_server calls 2: sys_mmapx25519
114func fill_client_priv(out: *u8) -> i64
called by 1: run_client
126func fill_server_priv(out: *u8) -> i64
called by 1: run_server
138func fill_empty_hash(out: *u8) -> i64
150func fill_client_random(out: *u8) -> i64
called by 1: emit_and_send_ch
156func fill_server_random(out: *u8) -> i64
called by 1: run_server
162func fill_sni_example_com(out: *u8) -> i64
called by 1: emit_and_send_ch
172func alloc_key_bundle() -> *u8
called by 2: run_clientrun_server calls 1: sys_mmap
184func bundle_ptr(bundle: *u8, slot: i64) -> *u8
190func derive_handshake_keys(my_priv: *u8, peer_pub: *u8, th: *u8, eh: *u8, bundle: *u8) -> i64
203func emit_and_send_ch(fd: i64, c_pub: *u8, ch_out: *u8, ch_cap: i64) -> i64
216func parse_sh_recover_pub(sh: *u8, sh_len: i64, pub_out_slot: *i64) -> i64
233func build_transcript_th(ch: *u8, ch_len: i64, sh: *u8, sh_len: i64, th_out: *u8, tx_out_slot: *i64) -> i64
243func aead_dispatch(fd: i64, key: *u8, iv: *u8, seq: i64, st: i64, shts: *u8, tx: *u8) -> i64
255func run_client_finish(fd: i64, bundle: *u8, tx: *u8) -> i64
285func run_client(cfd: i64) -> i64
318func parse_ch_recover_pub(ch: *u8, ch_len: i64, sid_off_out: *i64, sid_len_out: *i64, pub_out_slot: *i64) -> i64
334func build_canned_payloads(ee: *u8, cert: *u8, cv: *u8) -> i64
357func compute_sf(s_tx: *u8, shts: *u8, sf_out: *u8) -> i64
371func server_send_encrypted_flight(fd: i64, bundle: *u8, s_tx: *u8) -> i64
395func server_recv_cf_and_ack(fd: i64, bundle: *u8, s_tx: *u8) -> i64
413func run_server(cfd: i64) -> i64
451func main() -> i64