Skip to content

Remove deprecated external liblms and libxmss library support#8

Closed
Frauschi wants to merge 3 commits intomasterfrom
claude/remove-deprecated-lms-xmss-6jKHA
Closed

Remove deprecated external liblms and libxmss library support#8
Frauschi wants to merge 3 commits intomasterfrom
claude/remove-deprecated-lms-xmss-6jKHA

Conversation

@Frauschi
Copy link
Copy Markdown
Owner

@Frauschi Frauschi commented Apr 22, 2026

Summary

  • Retires the external hash-sigs (liblms) and xmss-reference (libxmss) backends in favor of the internal wolfCrypt implementations (wc_lms, wc_xmss), which are already the default and have been marked as the supported path (external support was already labeled Deprecated in INSTALL).
  • Drops the --with-liblms / --with-libxmss configure options, the HAVE_LIBLMS / HAVE_LIBXMSS macros, and the BUILD_LIBLMS / BUILD_LIBXMSS automake conditionals.
  • Retires the now-redundant WOLFSSL_WC_LMS / WOLFSSL_WC_XMSS macros and the corresponding BUILD_WC_LMS / BUILD_WC_XMSS automake conditionals. With the external backends gone these macros were tautologically equal to WOLFSSL_HAVE_LMS / WOLFSSL_HAVE_XMSS, so they've been consolidated onto the HAVE_* names.
  • Deletes wolfcrypt/src/ext_{lms,xmss}.c and wolfssl/wolfcrypt/ext_{lms,xmss}.h (~2,200 lines of wrapper code) and collapses all HAVE_LIB{LMS,XMSS} and WOLFSSL_WC_{LMS,XMSS} conditionals in headers, tests, the benchmark suite, the Linux kernel module export template, the INTIME-RTOS VS project, Docker/Dockerfile, and INSTALL.

Release notes for these changes will land in ChangeLog.md separately.

Migration note for downstream users

  • Builds that relied on --with-liblms or --with-libxmss must switch to the default wolfCrypt backend (automatic under --enable-lms / --enable-xmss).
  • user_settings.h files that defined WOLFSSL_WC_LMS or WOLFSSL_WC_XMSS should remove those lines — WOLFSSL_HAVE_LMS / WOLFSSL_HAVE_XMSS are now the only macros needed.
  • Suffixed macros such as WOLFSSL_WC_LMS_SMALL, WOLFSSL_WC_LMS_SERIALIZE_STATE, WOLFSSL_WC_XMSS_SMALL, and WOLFSSL_WC_XMSS_{MIN,MAX}_HASH_SIZE are retained — they are tuning knobs for the wolfCrypt implementation, not backend selectors.

Test plan

  • ./autogen.sh regenerates the build system cleanly
  • ./configure --help no longer lists --with-liblms or --with-libxmss
  • Baseline ./configure && make -j$(nproc) succeeds
  • ./configure --enable-lms --enable-xmss && make -j$(nproc) succeeds; testwolfcrypt reports LMS test passed! and XMSS test passed!
  • ./configure --enable-lms=verify-only --enable-xmss=verify-only && make -j$(nproc) succeeds; testwolfcrypt reports LMS Vfy test passed! and XMSS Vfy test passed!
  • ./tests/unit.test passes end-to-end
  • ./wolfcrypt/benchmark/benchmark -lms_hss and -xmss_xmssmt run against the internal wolfCrypt backends
  • grep -r 'HAVE_LIBLMS\|HAVE_LIBXMSS\|ext_lms\|ext_xmss\|BUILD_LIBLMS\|BUILD_LIBXMSS\|BUILD_WC_LMS\|BUILD_WC_XMSS' returns no hits, and bare WOLFSSL_WC_LMS / WOLFSSL_WC_XMSS references return no hits

Notes

  • CMake and the GitHub workflows never supported the external libraries; CMake's -DWOLFSSL_WC_LMS definition is also dropped in this PR.

https://claude.ai/code/session_01CEeSVaiiJ6ziyya3CCz5RK

claude added 2 commits April 22, 2026 09:39
The external hash-sigs (liblms) and xmss-reference (libxmss) library
backends were already marked deprecated in INSTALL, since wolfCrypt
now ships its own LMS/HSS and XMSS/XMSS^MT implementations in wc_lms
and wc_xmss. Retire the external path entirely:

- Delete wolfcrypt/src/ext_{lms,xmss}.c and wolfssl/wolfcrypt/ext_{lms,xmss}.h
- Drop --with-liblms / --with-libxmss configure options, the
  HAVE_LIBLMS / HAVE_LIBXMSS macros, and the BUILD_LIBLMS /
  BUILD_LIBXMSS automake conditionals
- Collapse HAVE_LIB{LMS,XMSS} header/source guards in tests,
  benchmarks, and the linux kernel module export template
- Remove the hash-sigs install step from Docker/Dockerfile
- Remove ext_{lms,xmss}.c from the INTIME-RTOS VS project
- Update INSTALL and ChangeLog.md

https://claude.ai/code/session_01CEeSVaiiJ6ziyya3CCz5RK
With external liblms/libxmss support removed, WOLFSSL_WC_LMS and
WOLFSSL_WC_XMSS no longer distinguish between backends - they are
tautologically equal to WOLFSSL_HAVE_LMS / WOLFSSL_HAVE_XMSS. Retire
them to avoid leaving dead vocabulary in the codebase.

- configure.ac: drop ENABLED_WC_LMS / ENABLED_WC_XMSS, stop defining
  -DWOLFSSL_WC_LMS / -DWOLFSSL_WC_XMSS, rename BUILD_WC_LMS /
  BUILD_WC_XMSS to BUILD_LMS / BUILD_XMSS, and remove the redundant
  "LMS/XMSS wolfSSL impl" summary echo lines
- CMakeLists.txt: drop -DWOLFSSL_WC_LMS definition alongside HAVE_LMS
- src/include.am: rename guard conditionals to BUILD_LMS / BUILD_XMSS
- Collapse "#if defined(HAVE_LMS) && defined(WC_LMS)" guards in
  wc_lms.c / wc_lms_impl.c / wc_lms.h and tests/api.c to just HAVE_LMS
- Drop the "#if !defined(WOLFSSL_WC_XMSS) #error" guard from wc_xmss.h
- settings.h: swap WC_LMS/WC_XMSS for HAVE_LMS/HAVE_XMSS in W64_WRAPPER
  and int encode/decode feature triggers
- test.c/test.h: drop redundant WOLFSSL_WC_LMS clause from the
  lms_test_verify_only gate
- benchmark.c: simplify "!defined(WOLFSSL_WC_LMS) || X" parameter-set
  gates (keep just X) and remove an XMSS pub-len check that only ran on
  the external backend
- user_settings_pq.h / user_settings_wolfboot_keytools.h: drop
  WOLFSSL_WC_LMS / WOLFSSL_WC_XMSS defines
- ChangeLog: document the macro removal

https://claude.ai/code/session_01CEeSVaiiJ6ziyya3CCz5RK
Comment thread ChangeLog.md Outdated
Per PR review feedback: the release notes will be updated separately.

https://claude.ai/code/session_01CEeSVaiiJ6ziyya3CCz5RK
@Frauschi Frauschi closed this Apr 23, 2026
@Frauschi Frauschi deleted the claude/remove-deprecated-lms-xmss-6jKHA branch April 23, 2026 17:34
Frauschi pushed a commit that referenced this pull request May 3, 2026
Negative findings from review of 3b2d711:

- Drop redundant `(word16)` inner cast in `wc_xmss_impl.c` (#1):
  `(word16)((word16)hs * n)` -> `(word16)(hs * n)`. The inner cast added
  nothing; word8 promotes to int regardless.
- Normalize `(word32)1` to `(word32)1U` across the file (#5) so the
  pre-existing call sites match the style of the new shifts.
- Defensive guard in `wc_xmss_hash_message` (#2): if `idx_len > params->n`
  ever holds, the explicit `(word32)(params->n - idx_len)` cast that
  silenced the warning would otherwise produce a ~4 GB XMEMSET. Set
  state->ret = WC_FAILURE and bail; the invariant is structural for valid
  parameter sets.
- Defensive guard in `wc_idx_copy` (#3): if `dl < sl` is ever passed, the
  word32 subtraction wraps and the XMEMSET corrupts memory. Same
  structural invariant; early return rather than crash.
- Extend `test_xmss_runtime` (#7, #8) from 2 to 4 configurations:
    1. --enable-xmss (default)
    2. --enable-xmss=yes,small
    3. --enable-xmss=yes,verify-only          (NEW: RFC 8391 test vectors)
    4. --enable-xmss --enable-32bit -m32       (NEW: catches 32-bit
       width-dependent bugs in tree-index arithmetic; XmssIdx narrows to
       word32 there)
  The 32-bit row needs gcc-multilib so the job now installs it.

Verified locally:
- All 13 build_library matrix rows compile clean under the conversion
  flags.
- testwolfcrypt's "XMSS Vfy" / "XMSS" pass for --enable-xmss,
  --enable-xmss=yes,small, --enable-xmss=yes,verify-only, and
  --enable-xmss --enable-32bit (4/4).
- bench_xmss_xmssmt re-run with `-DBENCH_MIN_RUNTIME_SEC=5.0F` for
  longer averaging. Sign/verify deltas range -10% to +15% with no
  coherent regression pattern across parameter sets (the largest moves
  in either direction are on neighbouring rows of the same hash family),
  consistent with shared-system run-to-run noise rather than a real
  perf change. Single-sample keygens (1 op per measurement) carry
  expectedly high variance (-7% to +57%); sign/verify with hundreds to
  thousands of ops per measurement are the meaningful signal.

https://claude.ai/code/session_01EJmy1bKDgHseTwZ5Qqpu1g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants