code wiki / (root) / nx_hash_facade.nx

nx_hash_facade.nx

buildroot/runtime/nx_hash_facade.nx

5567 B145 linesdepth 2pulls 2 transitivereach 8 importersview sourcekind librarytopic hash
docsdependenciesstructsconstsfunctions

about

nx_hash_facade.nx -- unified hash interface. Wraps existing crypto primitives (nx_blake2b, nx_sha512, BLAKE3-when- shipped) behind one substrate-level API. Other primitives that need a content hash call nx_hash_facade_compute() rather than picking a specific algorithm — the facade chooses based on caller's trust ceiling (from nx_attest_silicon). THE STRUCTURAL VALUE: many primitives I've shipped take a `content_hash: nx_size` parameter and rely on the caller to compute it correctly with the "right" algorithm. The facade collapses that decision into one place, so substrate-wide hash discipline is uniform. Composes: nx_blake2b -- the BLAKE2b 64-byte hash primitive (existing) nx_sha512 -- the SHA-512 hash primitive (existing) nx_attest_silicon -- trust-ceiling informs algorithm choice nx_methyl -- content_hash field uses this facade nx_vacuole -- content-addressed storage uses this facade nx_provenance_chain -- output_hash via this facade

dependencies 2 imports · 6 importers

nx_syscalls.nx nx_tier.nx nx_hash_facade.nx nx_admin_login_flow.nx nx_crypto_event_compose_test.nx nx_hash_facade_test.nx nx_save_slot.nx nx_wiki_https_daemon.nx nx_wiki_main.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_admin_login_flow.nxnx_crypto_event_compose_test.nxnx_hash_facade_test.nxnx_save_slot.nxnx_wiki_https_daemon.nxnx_wiki_main.nx

structs

68struct NxHashRequest

consts

28const NX_HA_BLAKE2B: nx_int = 0
29const NX_HA_BLAKE3: nx_int = 1 // queued (currently maps to BLAKE2B)
30const NX_HA_SHA512: nx_int = 2
31const NX_HA_N_ALGOS: nx_int = 3
35const NX_HF_OK: nx_int = 0
36const NX_HF_ERR_BAD_ALGO: nx_int = 1
37const NX_HF_ERR_BAD_INPUT: nx_int = 2

functions

39func nx_ha_is_valid(a: nx_int) -> nx_int
55func nx_hash_facade_pick_algo(trust_q10: nx_int) -> nx_int
called by 1: main
75func nx_hash_request_new(algo: nx_int,
called by 1: main calls 1: sys_mmap
97func _hash_fnv64(ptr: *u8, len: nx_size) -> nx_size
116func nx_hash_facade_compute(req: *NxHashRequest, out_hash: *i64) -> nx_int
called by 1: main calls 2: nx_ha_is_valid_hash_fnv64
130func nx_hash_facade_compute_bytes(ptr: *u8, len: nx_size) -> nx_size
142func nx_hash_facade_compare(a: nx_size, b: nx_size) -> nx_int