nx_aes_cbc.nx
buildroot/runtime/nx_aes_cbc.nx
about
nx_aes_cbc.nx -- AES-128-CBC DECRYPT (NIST SP 800-38A ยง6.2) over the FIPS-197 block primitive in
nx_aes (aes128_decrypt_block + aes128_expand_key). The mode HLS uses for #EXT-X-KEY:METHOD=AES-128:
each .ts segment is one CBC stream with PKCS7 padding. CBC decrypt: P_i = InvCipher(C_i) XOR C_{i-1}
(C_{-1} = IV). In-place safe (the cipher block is saved before the plaintext overwrites it).
GATE (main): the canonical NIST SP 800-38A F.2.2 CBC-AES128 4-block vector (authoritative KAT) +
a PKCS7 strip check. Crypto is KAT-proven here BEFORE nx_hls_get composes it. license_tier: ORIGINAL
module: nishi-core.crypto.aes_cbc
dependencies 3 imports · 1 importers
imports: nx_aes.nxnx_itoa_lib.nxnx_syscalls.nx
imported by: nx_hls_get.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 14 | func aes128_cbc_decrypt(ct: *u8, n: i64, sched: *u8, iv: *u8, out: *u8) -> i64 |
| 32 | func aes128_pkcs7_strip(buf: *u8, n: i64) -> i64 |
| 42 | func cbc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 47 | func cbc_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 48 | func cbc_hexv(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=97 { if c<=102 { return c-97+10 } } if c>=65 { if c<=70 { return c-65+10 } } return 0 } called by 1: cbc_hex2bin |
| 50 | func cbc_hex2bin(hex: *u8, out: *u8, nbytes: i64) -> i64 |
| 56 | func main() -> i64 |