code wiki / (root) / nx_chacha20_poly1305_test.nx

nx_chacha20_poly1305_test.nx

buildroot/runtime/nx_chacha20_poly1305_test.nx

7346 B185 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic chacha20
docsdependenciesstructsconstsfunctions

about

nx_chacha20_poly1305_test.nx -- RFC 8439 ยง2.8.2 AEAD KAT. Sunscreen vector (the canonical AEAD test vector): Plaintext (114 bytes ASCII): "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it." AAD (12 bytes): 50 51 52 53 c0 c1 c2 c3 c4 c5 c6 c7 Key (32 bytes): 80..9f sequential Nonce (12 bytes): 07 00 00 00 40 41 42 43 44 45 46 47 Expected ciphertext first 32: d3 1a 8d 34 64 8e 60 db 7b 86 af bc 53 ef 7e c2 a4 ad ed 51 29 6e 08 fe a9 e2 b5 a7 36 ee 62 d6 Expected tag: 1a e1 0b 59 4f 09 e2 6a 7e 90 2e cb d0 60 06 91 Also exercises tamper detection (single-bit flip in tag and in ciphertext both reject) and round-trip (decrypt restores PT). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_chacha20_poly1305.nx nx_chacha20_poly1305_test.nx

imports: nx_syscalls.nxnx_chacha20_poly1305.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 nx_chacha20_poly1305_encry sys_mmap ↻ aead_derive_otk sys_mmap ↻ chacha20_block sys_mmap ↻ _chacha20_set_consts_key load_u32_le load_u32_le ↻ chacha20_perm sys_mmap ↻ chacha20_perm_core store_u32_le chacha20_encrypt sys_mmap ↻ _chacha20_set_consts_key ↻ load_u32_le ↻ chacha20_perm_core ↻ aead_build_mac_data aead_put_u64_le poly1305_mac sys_mmap ↻ poly1305_clamp p_load_u32_le p_store_u32_le nx_chacha20_poly1305_decry sys_mmap ↻ sys_write aead_derive_otk ↻ sys_now_ms sys_mmap ↻ sys_clock_gettime_mono aead_build_mac_data ↻ poly1305_mac ↻ poly1305_tag_equal chacha20_encrypt ↻ nx_aead_verdict_is_valid

structs

none

consts

none

functions

25func main() -> i64