code wiki / (root) / nx_x509_verify_ecdsa_test.nx

nx_x509_verify_ecdsa_test.nx

buildroot/runtime/nx_x509_verify_ecdsa_test.nx

6440 B120 linesdepth 11pulls 20 transitivereach 0 importersview sourcekind gate/prooftopic x509
docsdependenciesstructsconstsfunctions

about

nx_x509_verify_ecdsa_test.nx -- end-to-end KAT for the X.509 outer-signature verify pipeline (SHA-256 + DER parse + ECDSA verify). Test vector exploit: RFC 6979 §A.2.5 documents (NIST P-256 + SHA-256, msg = "sample") -> r, s. Since SHA-256("sample") is the documented hash AND our nx_x509_verify_ecdsa_p256 hashes the tbs input with SHA-256 before verifying, we can use: tbs = "sample" (6 ASCII bytes) sig_der = DER-encoded RFC 6979 r/s pub_x/y = RFC 6979 pubkey and the verify should return OK. This proves the FULL pipeline (hash + parse + ECDSA verify) without needing a real ECDSA- signed X.509 cert + chain. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_u256.nx nx_ecdsa_p256.nx nx_x509_verify_ecdsa.nx nx_x509_verify_ecdsa_test.nx

imports: nx_syscalls.nxnx_u256.nxnx_ecdsa_p256.nxnx_x509_verify_ecdsa.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 u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ u256_load_be nx_x509_verify_ecdsa_p256 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 blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ u256_alloc ↻ u256_load_be ↻ nx_ecdsa_sig_parse_der sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length ecdsa_int_load u256_zero

structs

none

consts

none

functions

23func main() -> i64