Skip to content

fix(lib-q-ml-dsa, lib-q-ml-kem): stop forcing std through no_std dependency edges - #147

Merged
Nexlab-One merged 2 commits into
mainfrom
fix/ml-dsa-hex-dev-only
Sep 20, 2026
Merged

Nexlab-One merged 2 commits into
mainfrom
fix/ml-dsa-hex-dev-only

Conversation

@Nexlab-One

Copy link
Copy Markdown
Contributor

Drops the redundant hex dependency that forced std through the no_std lib-q-ml-dsa/lib-q-ml-kem dependency edges. Found as an orphaned branch (author: Nexlab-One, no prior PR) during overnight branch sweep -- opening this so it gets CI and a real merge decision instead of sitting untested.

…std consumers

hex was declared unconditionally and non-optionally in [dependencies] while
already being present in [dev-dependencies]. There are zero hex:: uses anywhere
under src/ -- it is used only by the tests (wycheproof, nistkats, acvp,
wire_format, avx2_independent_verify) -- so the entry was pure redundancy.

It was not harmless redundancy. hex does not declare #![no_std] unless its own
std feature is off, so an unconditional edge to it forced std into every no_std
consumer of this crate. That is what broke GIPs bare-metal build

  cargo check -p gip-packet --no-default-features --target thumbv7em-none-eabihf

which reaches lib-q-ml-dsa as a mandatory dependency of gip-crypto.

No compiled code changes: cargo check -p lib-q-ml-dsa and --tests both clean.
…ndency edges

Needed for GIP's cross-target-thumb-packet CI job (cargo check --no-default-features
--target thumbv7em-none-eabihf), which depends on lib-q-ml-dsa and lib-q-ml-kem
through gip-crypto in alloc-only no_std mode.

lib-q-ml-dsa:
- lib-q-ring/lib-q-sha3/lib-q-intrinsics/lib-q-platform/lib-q-random dependencies
  had no default-features = false, so they always pulled their own std defaults
  regardless of lib-q-ml-dsa's own feature selection.
- lib-q-keccak dependency likewise had no default-features = false, unconditionally
  pulling lib-q-keccak's default (std + asm) even when only the `simd` feature was
  requested.
- the `random` feature forced `lib-q-random/std` when it should only need
  `lib-q-random/alloc` (RNG plumbing, not full std).
- `std = []` was a no-op; now properly forwards to each dependency's own std
  feature so std mode still links everything it used to.

lib-q-ml-kem:
- same `random` feature bug (forced `lib-q-random/std` instead of `/alloc`).
- `lib-q-random` dependency (both the optional normal dep and the dev-dependency)
  had no default-features override, again pulling std unconditionally.
- moved [dev-dependencies] to [target.'cfg(not(target_os = "none"))'.dev-dependencies]:
  Cargo does not isolate dev-dependency feature requests from normal-dependency
  feature requests for the same target, so this crate's own dev-deps (which
  needed lib-q-random/std for a host-only conformance test) were forcing std
  even on bare-metal (target_os = "none") builds that only check the lib.

All manifest/feature-gating only; no algorithm or constant changes.

Verified: cargo test -p lib-q-ml-dsa (6/6 wycheproof passed) and
cargo test -p lib-q-ml-kem (all passed) at default (std) features;
cargo check -p lib-q-ml-dsa, lib-q-ml-kem, lib-q-keccak, lib-q, lib-q-sig,
lib-q-kem, lib-q-hpke all OK.
@github-actions

Copy link
Copy Markdown

🔒 Security Validation Report

Generated: Sun Sep 20 12:26:48 UTC 2026

📊 Summary

  • NIST compliance: success
  • Cryptographic validation: success
  • Constant-time operations: success
  • Memory safety: success
  • Dependency security: success
  • WASM security: success

✅ Overall Security Status: PASSED

All critical security validations passed successfully.

🔍 Details

This report covers:

  • NIST post-quantum algorithm compliance
  • Constant-time operation verification
  • Memory safety and zeroization checks
  • Dependency vulnerability scanning
  • WASM build artifact validation

📋 Next Steps

✅ Security validation passed. Code is ready for deployment.


✅ Security validation passed! This code meets all security requirements.

@github-actions

Copy link
Copy Markdown

🔍 Pull Request Summary

Generated: Sun Sep 20 12:32:01 UTC 2026

📋 Validation Results

  • Core Validation: success
  • Security Validation: success
  • Test Coverage: success
  • WASM Compatibility: success
  • Documentation: success

✅ Overall Status: PASSED

🔒 Security Checklist

  • No classical cryptographic algorithms
  • Only SHA-3 family hash functions
  • Constant-time operations
  • Proper memory zeroization
  • Input validation
  • Error handling

📝 Review Notes

Please review the security implications of this change carefully.
All cryptographic changes require security team review.


✅ Automated validation passed! This PR is ready for review.

@Nexlab-One
Nexlab-One merged commit 290e551 into main Sep 20, 2026
154 checks passed
@Nexlab-One
Nexlab-One deleted the fix/ml-dsa-hex-dev-only branch September 20, 2026 13:26
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