|
Embedded SDK
Embedded SDK
|
The mock/ folder holds the small, app-owned host-side glue. Everything generic — crypto, NBGL, OS, syscalls, SDK libraries — is provided by the framework and linked through secure_sdk; do not reimplement it here.
mock/mocks.h declares the symbols the harness and framework read:
mock/mocks.c defines them:
fuzz_app_cleanup() is not required here. The framework ships a weak no-op default, so define it (in the harness or here) only if your target needs per-iteration teardown.Most apps also add two small no-ops in mocks.c:
Add any other app-specific stub the fuzz build needs the same way (a hardware peripheral the host cannot provide, for instance). Keep them minimal and side-effect free.
This header is tooling-owned. It records the prefix layout for the current build:
ledger_fuzz_setup() bootstraps it with the sentinel values above on a fresh checkout, and scripts/update-scenario-layout.py rewrites the numbers after every build. Commit the bootstrap version so a clone configures cleanly, but do not stage the locally rewritten numbers — the harness reads the fresh values at build time. Advanced apps may append extra SCEN_* offsets via [layout].extra_args (see The fuzz manifest).
If an app must supply its own version of a symbol the shared mocks already provide, list the replacement source in the manifest's [mocks].override_sources (see The fuzz manifest) rather than editing the SDK. This is rarely needed.