wolfBoot/tools/keytools
Daniele Lacamera e3242eec96 keytools: document stateful LMS/XMSS signing as demo/development only
LMS/HSS and XMSS/XMSS^MT are stateful hash-based signature schemes: each
signature consumes one-time key material, and reusing it breaks the whole
key. The key tools store the private key in a plain local file and sign
rewrites it in place, a pattern that does not meet production storage
requirements (atomic, durable, protected).

- keygen: print a warning after generating an LMS/XMSS key
- sign: print a warning (once per run) after a successful LMS/XMSS
  signature; other algorithms are unaffected
- docs/Signing.md: new "Stateful signatures" section explaining the
  statefulness, the file-based demo/development pattern, and the
  production guidance (stateless algorithm, or protected storage)

Verification:
- make -C tools/keytools: builds clean
- keygen --lms / --xmss: warning printed, rc=0; keygen --ed25519: none
- sign --lms / --xmss: warning printed once, rc=0; sign --ed25519: none
- sign --lms --delta (two signatures per run): warning printed once
- make -C tools/unit-tests run: exit 0
2026-11-11 16:41:25 +01:00
..
otp
…
Makefile
…
README.md
…
keygen.c keytools: document stateful LMS/XMSS signing as demo/development only 2026-11-11 16:41:25 +01:00
sign.c keytools: document stateful LMS/XMSS signing as demo/development only 2026-11-11 16:41:25 +01:00
user_settings.h
…
wolfBootKeyTools.sln
…
wolfBootKeygenTool.vcxproj
…
wolfBootSignTool.vcxproj
…

README.md

Key Tools for signing and key generation

Sign

See code file ./tools/keytools/sign.c and documentation in docs/Signing.md.

KeyGen and KeyStore

See code file ./tools/keytools/keygen.c and documentation docs/keystore.md.

Flash OTP Keystore Generation, Primer, Startup

See documentation docs/flash-OTP.md.

Keystore Generation

Pack public keys into a single binary (otp.bin) formatted the way wolfBoot expects for provisioning the device’s OTP/NVM keystore. No signing, no encryption—just a correctly laid-out image with a header plus fixed-size "slots" for each key.

See code file ./tools/keytools/otp/otp-keystore-gen.c

Flash OTP Primer

See code file ./tools/keytools/otp/otp-keystore-primer.c

Flash OTP Startup

See code file ./tools/keytools/otp/startup.c

Quick Start (Linux)

make wolfboot_signing_private_key.der SIGN=ED25519

# or

./tools/keytools/keygen --ed25519 -g wolfboot_signing_private_key.der

Note the above example is a basic case where a single key is generated. The tool supports multiple keys both with [-g privkey] and [-i pubkey] parameters.

See the local docs docs/keystore.md and the wolfBoot Keystore section of the manual for additional details.

Debugging and Development

DEBUG_SIGNTOOL

Enables additional diagnostic messages that may be useful during development and initial bring-up.

WOLFBOOT_SHOW_INCLUDE

Enables compile-time verbosity to indicate which user_settings.h file is being used.