wolfSentry can now load its policy from CBOR through the wolfCOSE decoder. A CBOR-only build drops the JSON parser and DOM, and new build options strip the loader down to only what a device needs.
| Measurement | JSON | wolfCOSE-backed CBOR | Saving |
|---|---|---|---|
| Full configuration loader footprint | 51,184 bytes | 47,822 bytes | 3,362 bytes (6.6%) |
| Recommended IDPS footprint | 51,184 bytes | 29,131 bytes | 22,053 bytes (43.1%) |
| Minimal configuration footprint | 51,184 bytes | 25,336 bytes | 25,848 bytes (50.5%) |
| One-route policy size | 261 bytes | 195 bytes | 66 bytes (25.3%) |
| Median policy load time | 3.07 us | 1.64 us | 46.6% faster (1.88x throughput) |
Build Options
Starting from the full CBOR loader at 47,822 bytes, each option below takes the recommended IDPS profile further down:
- NO_CONFIG_USER_VALUES=1 NO_CONFIG_ADDR_FAMILY_NAMES=1 saves 9,247 bytes
- NO_CONFIG_TRANSACTIONS=1 saves 5,900 bytes
- NO_CONFIG_LEGACY_EVENT_SYNTAX=1 saves 614 bytes
- NO_CONFIG_TEXT_NUMBERS=1 saves 1,602 bytes
- NO_CONFIG_ERROR_MESSAGES=1 saves 442 bytes
- NO_CONFIG_TEXT_ADDRESSES=1 saves 886 bytes
The recommended profile still supports routes, endpoints, events, actions, default policies, and event configuration, all in 29,131 bytes. If you also drop routes, events, and user values, MINIMAL_CONFIG=1 brings the loader down to 25,336 bytes.
make WOLFCOSE=1 NO_JSON=1 NO_CONFIG_USER_VALUES=1 NO_CONFIG_ADDR_FAMILY_NAMES=1 \
NO_CONFIG_TRANSACTIONS=1 NO_CONFIG_LEGACY_EVENT_SYNTAX=1 \
NO_CONFIG_TEXT_NUMBERS=1 NO_CONFIG_TEXT_ADDRESSES=1 NO_CONFIG_ERROR_MESSAGES=1
Since the policy is already CBOR, a signed COSE_Sign1 update can be verified with wolfCOSE and loaded directly. See https://github.com/wolfSSL/wolfsentry/pull/87 for details.
Sizes are linked bytes from x86-64 Clang -Os builds with dead section removal. Load times are medians of seven runs of 20,000 loads each.
If you have questions about any of the above, please contact us at facts@wolfssl.com or call us at +1 425 245 8247.
Download wolfSSL Now

