code wiki / (root) / nx_tls13_kdf_test.nx

nx_tls13_kdf_test.nx

buildroot/runtime/nx_tls13_kdf_test.nx

5767 B119 linesdepth 8pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_kdf_test.nx -- RFC 8446 §7.1 + RFC 8448 §3 KAT for the TLS 1.3 HKDF-Expand-Label + Derive-Secret wrappers. Three verification steps: A. HkdfLabel byte construction for the canonical first-call ("derived" label, empty-message SHA-256 hash as context, length 32). Verifies the structure layout exactly matches RFC 8446 §7.1's `struct HkdfLabel`. B. RFC 8448 §3 early_secret = HKDF-Extract(salt=0, IKM=0^32) = 33ad0a1c607ec03b09e6cd9893680ce210adf300aa1f2660e1b22e10f170f92a (the first secret in TLS 1.3's 5-stage key schedule, in the no-PSK case which is what 99% of fresh TLS handshakes use). C. RFC 8448 §3 derived = Derive-Secret(early_secret, "derived", empty) = 6f2615a108c702c5678f54fc9dbab69716c076189c48250cebeac3576c3611ba (the secret that gets HKDF-Extract'd with ECDHE output to produce the handshake_secret). The empty SHA-256 hash is hardcoded as the well-known constant e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 to keep this test focused on the KDF logic (the SHA-256 module has its own KAT). expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_hkdf.nx nx_tls13_kdf.nx nx_tls13_kdf_test.nx

imports: nx_syscalls.nxnx_hkdf.nxnx_tls13_kdf.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 tls13_build_hkdf_label hkdf_extract sys_mmap ↻ hmac_sha256 sys_mmap ↻ 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 sha256_final blk_set_byte ↻ sha256_compress ↻ sha256_init ↻ sha256_update ↻ sha256_final ↻ tls13_derive_secret tls13_hkdf_expand_label sys_mmap ↻ tls13_build_hkdf_label ↻ hkdf_expand sys_mmap ↻ hmac_sha256 ↻ nx_tls13_kdf_verdict_is_va

structs

none

consts

none

functions

33func main() -> i64