code wiki / (root) / nx_https_loopback_test.nx

nx_https_loopback_test.nx

buildroot/runtime/nx_https_loopback_test.nx

20511 B570 linesdepth 10pulls 34 transitivereach 0 importersview sourcekind gate/prooftopic https
docsdependenciesstructsconstsfunctions

about

nx_https_loopback_test.nx -- HTTPS-class fork loopback over real TCP that does the FULL TLS 1.3 handshake AND exchanges an HTTP/1.1 GET / 200 OK pair as AEAD-encrypted records inside the established session. This is the "browser substrate" end-to-end smoke: every byte on the wire is bit-identical to what real HTTPS produces (handshake + cipher records). Only the cert chain validation is stubbed (server's hand-built cert/cv blobs accepted unconditionally). Built per F6 friction-catalog discipline. 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_https_loopback_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 hbuild_addr sys_socket sys_bind sys_listen sys_fork nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll run_https_client sys_mmap ↻ hclient_setup sys_mmap ↻ hfill_priv hsetup_keypair sys_mmap ↻ x25519 nx_scratch_save nx_scratch_init nx_scratch nx_scratch_init ↻ nx_scratch_oom 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 fe_sub

structs

none

consts

30const HPORT: i64 = 19447

functions

34func hbuild_addr(out: *u8, port: i64) -> i64
called by 1: main
44func hread_n(fd: i64, buf: *u8, n: i64) -> i64
54func hsend_plain(fd: i64, buf: *u8, n: i64) -> i64
65func hrecv_plain(fd: i64, buf: *u8, cap: i64) -> i64
75func hsend_app(fd: i64, key: *u8, iv: *u8, seq: i64, p: *u8, plen: i64) -> i64
87func hrecv_app(fd: i64, key: *u8, iv: *u8, seq: i64, out: *u8, out_cap: i64) -> i64
106func hsend_aead(fd: i64, key: *u8, iv: *u8, seq: i64, p: *u8, plen: i64) -> i64
118func hrecv_aead(fd: i64, key: *u8, iv: *u8, seq: i64, out: *u8, out_cap: i64) -> i64
138func halloc_bundle() -> *u8
150func hbundle_ptr(bundle: *u8, slot: i64) -> *u8
155func hsetup_keypair(priv: *u8, pub: *u8) -> i64
167func hfill_priv(out: *u8, base: i64) -> i64
173func hfill_empty_hash(out: *u8) -> i64
185func hfill_random(out: *u8, base: i64) -> i64
191func hderive_keys(my_priv: *u8, peer_pub: *u8, th: *u8, eh: *u8, bundle: *u8) -> i64
203func hemit_send_ch(fd: i64, c_pub: *u8, ch_out: *u8, ch_cap: i64) -> i64
216func hparse_sh_get_pub(sh: *u8, sh_len: i64, pub_out: *i64) -> i64
232func hparse_ch_get_pub(ch: *u8, ch_len: i64, sid_o: *i64, sid_l: *i64, pub_out: *i64) -> i64
246func hbuild_th(ch: *u8, ch_len: i64, sh: *u8, sh_len: i64, th_out: *u8, tx_out: *i64) -> i64
255func haead_dispatch(fd: i64, key: *u8, iv: *u8, seq: i64, st: i64, shts: *u8, tx: *u8) -> i64
267func hbuild_canned(ee: *u8, cert: *u8, cv: *u8) -> i64
called by 1: hserver_send_flight
288func hcompute_sf(tx: *u8, shts: *u8, sf_out: *u8) -> i64
302func hserver_send_flight(fd: i64, bundle: *u8, tx: *u8) -> i64
326func hserver_recv_cf(fd: i64, bundle: *u8, tx: *u8) -> i64
342func hbuild_http_get(out: *u8) -> i64
called by 1: run_client_http
357func hbuild_http_200(out: *u8) -> i64
called by 1: run_server_http
376func hclient_setup(out_pub: *u8) -> *u8
384func hclient_xchg_hello(cfd: i64, c_pub: *u8, ch: *u8, sh: *u8, lens: *i64, pub_slot: *i64) -> i64
394func run_client_http(cfd: i64, ck: *u8, civ: *u8, sk: *u8, siv: *u8) -> i64
413func run_client_after_keys(cfd: i64, bundle: *u8, tx: *u8) -> i64
440func run_https_client(cfd: i64) -> i64
467func run_server_http(cfd: i64, bundle: *u8) -> i64
487func run_server_after_sh(cfd: i64, ctx: *i64) -> i64
506func run_https_server(cfd: i64) -> i64
542func main() -> i64