code wiki / (root) / nx_sha256_diff_probe.nx

nx_sha256_diff_probe.nx

buildroot/runtime/nx_sha256_diff_probe.nx

1850 B39 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind probetopic sha256
docsdependenciesstructsconstsfunctions

about

nx_sha256_diff_probe.nx -- differential oracle for the SHA-256 optimization. Hashes deterministic inputs of EVERY length 0..256 (covers all padding boundaries: 55/56/57 spillover, 63/64/65, 119/120, 127/128) and rolls a single hash over ALL output bytes. Run on the CURRENT (trusted, production) sha256 -> GOLDEN number; run again after the optimization -> must print the SAME number = byte-identical across the whole boundary space.

dependencies 1 imports · 0 importers

nx_sha256.nx nx_sha256_diff_probe.nx

imports: nx_sha256.nx

imported by: nobody (leaf or entry point)

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

main sha256_digest sys_mmap sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ _p_puts _p_putn

structs

none

consts

8const K_MAGIC_1000000007: i64 = 1000000007
9const K_MAGIC_680824791: i64 = 680824791

functions

11func _p_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main
12func _p_putn(v: i64) -> i64
called by 1: main
19func main() -> i64