Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Classes | Macros
fuzz_defs.h File Reference

Shared constants and the command descriptor type for SDK fuzz harnesses. More...

#include <stdint.h>
Include dependency graph for fuzz_defs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fuzz_command_spec_t
 Describes one APDU command the harness may synthesise and dispatch. More...
 

Macros

#define FUZZ_STRUCTURED_LANE_THRESHOLD   102
 Control byte 0 above this value selects the structured lane; at or below it the harness takes the raw lane.
 
#define FUZZ_CMD_HAS_DATA   (1u << 0)
 

Detailed Description

Shared constants and the command descriptor type for SDK fuzz harnesses.

Definition in file fuzz_defs.h.

Macro Definition Documentation

◆ FUZZ_CMD_HAS_DATA

#define FUZZ_CMD_HAS_DATA   (1u << 0)

fuzz_command_spec_t flag: the command carries an APDU payload.

Definition at line 26 of file fuzz_defs.h.

◆ FUZZ_STRUCTURED_LANE_THRESHOLD

#define FUZZ_STRUCTURED_LANE_THRESHOLD   102

Control byte 0 above this value selects the structured lane; at or below it the harness takes the raw lane.

Structured lane (fuzz_ctrl[0] > 102): harness picks a command from the table via fuzz_ctrl[1], clamps P1/P2, and builds a valid APDU — drives the happy path. Raw lane (≤ 102): all APDU fields come straight from the tail bytes without clamping — exercises parsing edges and error paths.

The value 102 gives a ≈40/60 raw/structured split across 0–255; apps do not tune it. Most apps define one fuzz_commands[] and let both lanes share it. Override FUZZ_PICK_COMMAND_STRUCTURED / FUZZ_PICK_COMMAND_RAW only when two structurally different entry paths need separate tables.

Definition at line 23 of file fuzz_defs.h.