Skip to main content

Module session

Module session 

Source
Expand description

Shared workflow plumbing — transport exchange + SCP wrap/unwrap (PDD §5.9/§5.10).

These helpers are the single point where a built C-APDU plaintext meets the Transport and (for an open channel) the backend’s wrap/unwrap. Keeping them here means every workflow drives the wire identically:

  • transmit_plain — pre-auth exchange (SELECT, GET DATA, the IU/EA of open_scp): send raw, split data ‖ SW.
  • transmit_in_session — over an open ScpSession: wrap the plaintext (C-MAC, optional C-ENC), send, verify/strip the response, split data ‖ SW. The fail-closed tear-down on an unwrap failure lives in the backend (Fork F3); this helper only propagates the error.

no_std: alloc-free; the split borrows into bounded heapless buffers.