code wiki / (root) / nx_x509_validate_test.nx

nx_x509_validate_test.nx

buildroot/runtime/nx_x509_validate_test.nx

5298 B140 linesdepth 10pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic x509
docsdependenciesstructsconstsfunctions

about

nx_x509_validate_test.nx -- self-signed Ed25519 cert validation KAT. We don't construct a full RFC 5280 DER cert here -- that requires a DER encoder (queued). Instead we synthesise the minimum structure x509_verify_signature_ed25519 needs: a contiguous byte buffer holding [tbs || pubkey || sig], and a manually-set X509Cert struct pointing at the right offsets. The signature is REAL: signed with ed25519_sign_full at test time using RFC 8032 ยง7.1 TEST 1 priv -> pub. This proves the full chain: ed25519_sign produces a sig, x509_verify accepts it when given the right pubkey, rejects it when: - any tbs byte flipped - any sig byte flipped - signer_pubkey is wrong expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_x509.nx nx_ed25519_signature.nx nx_x509_validate.nx nx_x509_validate_test.nx

imports: nx_syscalls.nxnx_x509.nxnx_ed25519_signature.nxnx_x509_validate.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 ed25519_sign_full sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 rotr64_v 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 ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻

structs

none

consts

none

functions

25func main() -> i64