Skip to main content

Crate scll_core

Crate scll_core 

Source
Expand description

§scll-core

Hardware- and crypto-free core of the Simple Card Lifecycle Library. Holds transport/backend traits, GlobalPlatform command builders, the SCP02/SCP03 state machines (state only — crypto is delegated to a backend), the CAP parser, and the public model/report/error types.

Design reference: docs/pdd.md. Section numbers in module docs refer to that document.

§no_std

This crate is no_std and alloc-free: no extern crate alloc. Every former Vec/String is a fixed-capacity heapless collection sized from limits. std is enabled only under cfg(test) so dev-dependencies (e.g. proptest, §10.4) and host-side tests can use it; the shipped library never links std. Concrete transports (scll-transport-pcsc/-jcsim) are separate std host crates and are not part of an embedded build.

§Testability (PDD §3.5)

Every byte-level transform here is a pure function with no transport and no crypto dependency, so it is unit-testable and fuzzable directly.

Modules§

aid
Aid newtype — Application Identifier (PDD §6).
backend
Split crypto-backend traits — PDD §3.3 / §3.6.
cap
CAP-file parser — PDD §5.4a (Java Card VM Spec v3.1 Ch. 6). Pure; top fuzz target (§10.5 #1: parses an attacker-influenceable ZIP).
command
GlobalPlatform APDU builders — PDD §5 (pure; §3.5).
error
Typed error and warning surface — PDD §8.
lifecycle
Card (ISD) life-cycle transition state machine — PDD §5.11.
limits
Central capacity constants for the no_std + heapless build (PDD §2.2, short-APDU-only). Every former Vec/String in the public surface is a fixed-capacity heapless collection sized from one of these constants.
model
Public card model — PDD §6. Returned by discover_card (§5.2). Read-only.
report
Per-function reports — PDD §7.
response
Card-response parsers — PDD §5.2 (discover) and §5.12 (get_card_status).
scp
SCP version selection + session handle — PDD §4.3 / §5.9.
tlv
BER-TLV parse/encode (PDD §3.5). Pure, fuzzable (§10.5 target #2).
transport
Transport abstraction — PDD §3.2.
workflow
High-level workflow — PDD §5 (steps 1–12).

Constants§

SPEC_BASELINE
Spec baseline this crate targets (PDD front-matter).
VERSION
Library version string, surfaced here instead of stamped on every report (PDD §7: audit metadata belongs in a tracing span or this constant).