Skip to main content

LOAD_BLOCK_DATA

Constant LOAD_BLOCK_DATA 

Source
pub const LOAD_BLOCK_DATA: usize = 223;
Expand description

LOAD command data payload per block, sized so the wrapped command always fits a short APDU (Lc ≤ 255) under the most expensive secure-messaging mode the backend can negotiate. Under C-DECRYPTION the chunk is first pad-80 (ISO 7816-4) padded up to the cipher block size (16 B SCP03 / 8 B SCP02) — padding adds 1..block bytes, so an already block-aligned chunk grows by a whole extra block — then a C-MAC is appended (8 B in SCP03-S8 / SCP02, 16 B in SCP03-S16). Worst case (SCP03-S16): ceil16(chunk+1) + 16 ≤ 255 ⇒ chunk ≤ 223. The CAP parser yields the assembled LFDB (GPCS §C.2 order) in chunks of this size; nothing holds the whole multi-KB block in RAM. PDD §5.4a / §9; LOAD is GPCS v2.3.1 §11.6 (SCP03 wrap: Amendment D §6.2.3–6.2.4).