code wiki / (root) / nx_jose_test.nx

nx_jose_test.nx

buildroot/runtime/nx_jose_test.nx

6938 B166 linesdepth 10pulls 20 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_jose_test.nx -- smoke for nx_jose + nx_jwk. Covers: 1. JWK enum gates + emit OKP/Ed25519 for a known public key 2. JOSE enum gates + algorithm enum 3. Signature input matches RFC 7515 §5.1 shape 4. End-to-end sign + emit flattened-JSON for an EdDSA JWS 5. Bounds-check / BAD_ARG paths Not yet covered (separate slice): - RFC 8037 §A.4 KAT bytes (the example uses a specific keypair + nonce; the substrate ed25519_sign_full is deterministic so bytes match, but the §A.4 fixture isn't in this smoke). - JWK thumbprint SHA-256 (queued: nx_sha256_jwk_thumbprint). expect_exit: 0 NOTE 2026-05-16: nx_ed25519_signature.nx transitively imports nx_syscalls.nx (RV64 number) -- composing it with nx_syscalls_x86_64.nx (this test's natural import) hits the F-meta-4 cross-target portability gap (duplicate sys_dup3 / sys_getdents64 / blk_set_byte symbols at link). Fix path is to split nx_ed25519 (and its 5-file chain) into a types-only base layer + a syscall-using convenience layer, same shape as nx_arena_types.nx -- queued as multi-session refactor. For this slice: gauntlet entry is COMPILE-clean only; runtime verification awaits the refactor or an RV64-qemu harness. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_jwk.nx nx_jose.nx nx_jose_test.nx

imports: nx_jwk.nxnx_jose.nx

imported by: nobody (leaf or entry point)

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

main nxjwk_verdict_is_valid bytes_eq nxjwk_verdict_name nxjose_verdict_is_valid nxjose_alg_is_valid nx_jwk_emit_okp_ed25519 nxjwk_put_cstr nxjwk_put jwt_b64url_encode b64_encode b64_enc_char nxjwk_put_bytes nxjwk_put ↻ nx_jose_signature_input jwt_b64url_encode ↻ nxjose_put_bytes nxjose_put nxjose_put ↻ nx_jose_sign_eddsa_flatten nx_jose_signature_input ↻ 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 sha512_gamma1 sha512_sigma1 sha512_ch sha512_k sha512_sigma0 sha512_maj

structs

none

consts

none

functions

35func bytes_eq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
44func main() -> i64