nx_aes_cbc_enc.nx
buildroot/runtime/nx_aes_cbc_enc.nx
about
nx_aes_cbc_enc.nx -- AES-128-CBC ENCRYPT (NIST SP 800-38A ยง6.2) + PKCS#7 pad, over the FIPS-197 block
primitive in nx_aes (aes128_encrypt_block + aes128_expand_key). The sovereign sibling of nx_aes_cbc
(which ships DECRYPT only). Needed by the PKCS#12 (.p12) provisioning rung R5b to shroud the client
identity key under PBES2 (PBKDF2 + AES-CBC). CBC encrypt: C_i = Cipher(P_i XOR C_{i-1}), C_{-1} = IV.
GATE (main): the canonical NIST SP 800-38A F.2.1 CBC-AES128.Encrypt 4-block vector (authoritative KAT).
license_tier: ORIGINAL expect_exit: 0 module: nishi-core.crypto.aes_cbc_enc
dependencies 2 imports · 1 importers
imports: nx_aes.nxnx_syscalls.nx
imported by: nx_mtls_pkcs12.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 12 | func aes128_cbc_encrypt(pt: *u8, n: i64, sched: *u8, iv: *u8, out: *u8) -> i64 |
| 29 | func aes128_pkcs7_pad(src: *u8, n: i64, out: *u8) -> i64 |
| 39 | func ace_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 40 | func ace_hexv(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=97 { if c<=102 { return c-97+10 } } return 0 } called by 1: ace_hex2bin |
| 41 | func ace_hex2bin(hex: *u8, out: *u8, nbytes: i64) -> i64 |
| 46 | func ace_row(name: *u8, ok: i64) -> i64 { if ok == 1 { ace_puts(" PASS " as *u8) } else { ace_puts(" FAIL " as *u8) } ace_puts(name); ace_puts("\n" as *u8); return ok } |
| 48 | func main() -> i64 |