code wiki / (root) / nx_csprng.nx

nx_csprng.nx

buildroot/runtime/nx_csprng.nx

3730 B121 linesdepth 4pulls 4 transitivereach 645 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_csprng.nx -- cryptographically secure random via getrandom(2). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/nist/sp_800_90a Companion to nx_random (xoshiro256++): when caller needs entropy suitable for cryptographic keys, session tokens, AT_RANDOM seed material -- not deterministic test fixtures. Backed by the Linux getrandom() syscall (number 278 on RV64). Falls back to reading /dev/urandom if getrandom is unavailable (early boot or older kernel). API: nx_csprng_fill(dst, n) -> 0 on success, negative errno on fail nx_csprng_u64() -> i64 (full 64 bits of entropy) nx_csprng_seed_rng(rng) -> reseed an nx_random.NxRng with crypto entropy Pairs with nx_random (deterministic) + nx_uuid (entropy consumer).

dependencies 2 imports · 123 importers

nx_syscalls.nx nx_random.nx nx_csprng.nx _dlr_probe.nx _h2_multistream_curl_daemon.nx _h2_multistream_interop_gate.nx _h2_serve_curl_daemon.nx _h2_serve_loopback_gate.nx _nx_pub_from_priv_isolated_test.nx _uj_probe.nx _wt_probe_one.nx nx_acme_directory_live.nx nx_acme_http.nx

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

imports: nx_syscalls.nxnx_random.nx

imported by: _dlr_probe.nx_h2_multistream_curl_daemon.nx_h2_multistream_interop_gate.nx_h2_serve_curl_daemon.nx_h2_serve_loopback_gate.nx_nx_pub_from_priv_isolated_test.nx_uj_probe.nx_wt_probe_one.nxnx_acme_directory_live.nxnx_acme_http.nxnx_andelinwest_daemon.nxnx_apertus_shards_pull.nxnx_archive_daemon.nxnx_aw_mtls_proxy.nxnx_aw_tlsproxy.nxnx_bench_comb.nxnx_bench_kg.nxnx_bench_sign.nxnx_bench_verify.nxnx_bench_warc.nxnx_bench_x25519.nxnx_bf_live.nxnx_bip39.nxnx_browser_fetch_probe.nxnx_cap_keygen.nxnx_cert_autorenew.nxnx_cert_gen.nxnx_ch_census_oracle.nxnx_ch_census_race_stage.nxnx_ch_census_race_stage2.nxnx_chrome_fetch_probe.nxnx_cms_tls_front.nxnx_cms_tls_gate.nxnx_crawl_https.nxnx_crawl_preserve.nxnx_crypto_bench.nxnx_crypto_bench_full.nxnx_diora_live_reach.nxnx_doc_crypto.nxnx_edge_probe.nxnx_email_dns_gate.nxnx_email_provision_lib.nxnx_email_send_gate.nxnx_entity_media.nxnx_entity_seeds.nxnx_evidence_gather.nxnx_fetch_any.nxnx_fetch_dump.nxnx_fetch_unit.nxnx_gallery_auth_research_fetch.nxnx_genpass.nxnx_golive_dns_gate.nxnx_h2_test_leaf.nxnx_hf_file_fetch.nxnx_hf_probe.nxnx_hifigan_stream_fetch.nxnx_https_fetch.nxnx_https_fetch_file.nxnx_https_fetch_follow.nxnx_https_fetch_lib.nxnx_https_get_cli.nxnx_https_get_cli2.nxnx_https_get_spoof.nxnx_ia_probe.nxnx_invite_token.nxnx_kaprobe.nxnx_lib_fetch.nxnx_lib_fetch_cookie.nxnx_library_fetch.nxnx_link_sentinel.nxnx_live_https.nxnx_live_https_reach.nxnx_magnet_discover.nxnx_mcp_call.nxnx_media_gather.nxnx_mgmt_client.nxnx_model_fetch.nxnx_mtls_test_daemon.nxnx_nist_unwall.nxnx_no_cookie_session.nxnx_onsite_frontier_fetch.nxnx_onsite_research_fetch.nxnx_opaque_core.nxnx_opaque_envelope.nxnx_opaque_login_tls_daemon.nxnx_opaque_pake.nxnx_p256_comb_test.nxnx_p256_ecverify_core_bench.nxnx_p256_field_mul_oracle_test.nxnx_p256_modn_mont_test.nxnx_p256_verify_bench.nxnx_p256_verify_components.nxnx_p256_wnaf_bench.nxnx_p256_wnaf_difftest.nxnx_porkbun_ping_probe.nxnx_preserve_live.nxnx_pub_receipt_keys.nxnx_revimg_crawl_run.nxnx_sclass_ux_research_fetch.nxnx_semantic_research_fetch.nx +23 more (shown cap 100 declared)

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

main sys_mmap nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close nx_csprng_u64 sys_mmap ↻ nx_csprng_fill ↻

structs

none

consts

31const NX_GRND_NONBLOCK: i64 = 1
32const NX_GRND_RANDOM: i64 = 2
33const NX_GRND_INSECURE: i64 = 4

functions

36func nx_csprng_urandom_path(out: *u8) -> i64
called by 1: nx_csprng_fill
45func nx_csprng_fill(dst: *u8, n: i64) -> i64
73func nx_csprng_u64() -> i64
called by 1: main calls 2: sys_mmapnx_csprng_fill
84func nx_csprng_seed_rng(rng: *NxRng) -> i64
98func main() -> i64