code wiki / (root) / nx_hash_bench.nx

nx_hash_bench.nx

buildroot/runtime/nx_hash_bench.nx

2808 B70 linesdepth 5pulls 6 transitivereach 2 importersview sourcekind benchtopic hash
docsdependenciesstructsconstsfunctions

about

nx_hash_bench.nx -- piece-hashing throughput benchmark (SHA-1 + SHA-256). module: nishi-core.torrent.hash_bench depends: nx_sha1.nx, nx_sha256.nx, nx_syscalls.nx capability: CORE_COMPUTE wired_status: FULLY_WIRED Hashing is the torrent client's #1 CPU cost (rqbit's maintainer states "CPU is spent mostly on SHA-1 checksumming"; libtorrent v2 adds SHA-256 per 16 KiB leaf). The 2026-06 research pass found a striking gap: NO incumbent publishes a concrete hashing MB/s number anywhere -- "the oracle you'll have to generate yourself." So this is the leaderboard's column 7: we measure our sovereign crypto core's SHA-1 and SHA-256 throughput and publish the first concrete figure in the field. Correctness is KAT-gated (deterministic); the MB/s value is a wall-clock measurement (sys_now_us), reported informationally -- timing is NOT replayable, so it never gates.

dependencies 3 imports · 2 importers

nx_sha1.nx nx_sha256.nx nx_syscalls.nx nx_hash_bench.nx nx_hash_bench_run.nx nx_hash_bench_test.nx

imports: nx_sha1.nxnx_sha256.nxnx_syscalls.nx

imported by: nx_hash_bench_run.nxnx_hash_bench_test.nx

structs

none

consts

none

functions

21func nx_hb_fill(buf: *u8, n: i64) -> i64
called by 2: mainmain
29func nx_hb_sha1_mbps(buf: *u8, n: i64, iters: i64) -> i64
called by 2: mainmain calls 3: sys_mmapsys_now_ussha1
41func nx_hb_sha256_mbps(buf: *u8, n: i64, iters: i64) -> i64
53func nx_hb_sha1_ok() -> i64
called by 2: mainmain calls 2: sys_mmapsha1
62func nx_hb_sha256_ok() -> i64
called by 2: mainmain calls 2: sys_mmapsha256_digest