code wiki / (root) / nx_sha384_kat_test.nx

nx_sha384_kat_test.nx

buildroot/runtime/nx_sha384_kat_test.nx

3942 B94 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_sha384_kat_test.nx -- NIST FIPS 180-4 SHA-384 + SHA-512/256 external-reference KATs. Catches the bug class previously named in [[feedback-canonical-constants-kat-against-reference-not-hand- converted]]: standards constants stored as hand-converted negative-decimal i64 with `// 0x...` trailing-comment can be silently wrong. Without an external NIST vector KAT, the substrate's SHA-384 + SHA-512/256 had silent output corruption (4 of 4 sha512_256_init constants wrong; 3 of 4 sha384_init constants wrong) for an unknown duration. This file establishes the EXTERNAL-REFERENCE KATs that were missing. It pins both SHA-384 + SHA-512/256 outputs against published NIST FIPS 180-4 test vectors. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_sha512.nx nx_sha384_kat_test.nx

imports: nx_syscalls.nxnx_sha512.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 sha384_digest sys_mmap ↻ sha384_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 rotr64_v nx_bits_rotr64 shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ bytes_eq_n sha512_256_digest sys_mmap ↻ sha512_256_init sha512_update ↻ sha512_final ↻

structs

none

consts

none

functions

23func bytes_eq_n(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
32func main() -> i64