Skip to content

docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) - #174

Merged
gonzafg2 merged 9 commits into
mainfrom
docs/adr-0035-ml-dsa-crate
Oct 28, 2026
Merged

gonzafg2 merged 9 commits into
mainfrom
docs/adr-0035-ml-dsa-crate

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Summary

ADR-0035 (Proposed) is subsidiary ADR 1 of RFC-0012: the crate for the ML-DSA-44 half of the composite host key. It is the dependency layer that RFC-0007 §2 calls for, and it parallels ADR-0019 (ml-kem).

Decision: use RustCrypto/ml-dsa, with default-features = false, features = ["zeroize", "rand_core"].

  • Hedged sign_randomized with ctx = "COMPSIG-MLDSA44-Ed25519-SHA512", matching what OpenSSH 10.6 does (ssh-mldsa-eddsa.c draws fresh randomness with arc4random_buf for every signature).
  • Keys derived with from_seed (FIPS 204 KeyGen_internal).

Version rule: the first release that contains RustCrypto/signatures#1386, pinned exactly.

  • #1386 is "ml-dsa: fix constant time issues", merged 2026-06-24. It is not in any release as of 2026-10-11; crates.io is still at 0.1.1.
  • 0.1.1 is rejected because host-key signing is reachable before authentication: any peer can get signatures and time them.
  • The ADR stays Proposed until that release exists, then flips to Accepted in the PR that adds the dependency.

Evidence gathered for the ADR (2026-10-11)

  • Temporarily adding ml-dsa = "=0.1.1" with the feature set above to quantumssh-core (then reverted):
    • cargo check -p quantumssh-core compiles.
    • New lockfile entries are ml-dsa, shake 0.1.0, signature 3.0.0 and sponge-cursor 0.1.0. All are RustCrypto crates licensed Apache-2.0 OR MIT, which deny.toml allows.
    • The only new duplicate is signature 2.x/3.x, which deny.toml only warns on. It goes away with the dalek 3.x bump planned on Phase 2 / Hito 2: usable server — PTY, config, SFTP, systemd, 0.1.0 #109.
  • RustSec: ml-dsa has only RUSTSEC-2025-0144, patched since 0.1.0-rc.3.
  • cargo deny is not installed locally. It runs in the PR that actually adds the dependency.
  • Alternatives, each checked against its primary source:
    • libcrux-ml-dsa 0.0.11: four RustSec advisories in 2026.
    • aws-lc-rs 1.18.1: PqdsaKeyPair::sign(&self, msg, signature) takes no context string, so it cannot produce the composite.
    • fips204 0.4.6: no release since 2024-12-22.
    • pqcrypto-mldsa: unmaintained (RUSTSEC-2026-0166).

Stacked on #172

This PR's base is the RFC-0012 branch, so the links to docs/rfcs/0012-… resolve. Merge #172 first (its comment window closes 2026-10-22); this PR then retargets to main. No code or Cargo.toml change lands here. The dependency arrives with the implementation, per RFC-0012 §Ordering.

Refs #109

https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW

@github-actions

Copy link
Copy Markdown

Reviewer: Codex (openai/codex-action, model gpt-5.6-terra)

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: First review
Lenses applied: Design decision (docs/adr/0035), MANIFIESTO commitments, threat model, RFC-0006/0007/0012

Executive summary

This proposed ADR selects a pure-Rust ML-DSA dependency only after the documented constant-time fixes reach a published release, preserving the pre-authentication signing-path requirement. It remains consistent with RFC-0012’s composite-only, hedged-signing, zeroization, exact-pin, and atomic-cutover requirements.

No findings meet the reporting threshold. Upstream release, advisory, and API assertions could not be independently verified without network access.

Decision: 🟢 Approved

@opencode-agent

Copy link
Copy Markdown

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: First review
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md); Rust under crates/ and CI lenses do not apply — the PR adds a single ADR and touches no code or workflow

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as subsidiary ADR 1 delegated by RFC-0012 and following the ADR-0019 template for ml-kem. The decision is sound against all five commitments and the hard security rules: it is pure-Rust, unsafe_code = "forbid"-compatible, Apache-2.0 OR MIT, and it correctly treats constant-time signing as mandatory because host-key signing is reachable pre-authentication, refusing 0.1.1 until the upstream constant-time fix ships. I independently confirmed the ADR's load-bearing external facts against crates.io, docs.rs and RustSec (see verification note), so the confidence in this assessment is high.

Verification note

  • The ADR's central version rule holds: ml-dsa 0.1.1 was published 2026-06-05, while ml-dsa: fix constant time issues RustCrypto/signatures#1386 ("fix constant time issues") merged 2026-06-24 and is in no published release — so its rejection of 0.1.1 is correct, not a conservative overreach. RUSTSEC-2025-0144 was patched at >= 0.1.0-rc.3, and 0.1.1 has no open advisory (rustsec.org/packages/ml-dsa.html).
  • The API the ADR commits to (from_seed = FIPS 204 KeyGen_internal, sign_randomized/sign_deterministic with an explicit ctx, verify_with_context) exists in 0.1.1, and sign_randomized is gated by the rand_core feature the ADR enables.
  • The licence, source (allow-git = []), and multiple-versions = "warn" claims match deny.toml; the cited module-lattice/hybrid-array/ctutils/crypto-common entries are already resolved in Cargo.lock.
  • Commit fb682ea is verified per the GitHub API (.commit.verification.verified = true), carries a DCO sign-off, and its subject is a valid Conventional Commit.

New findings

None. No issue reached the ≥ 80 reporting threshold.

Every candidate I examined was either a sub-threshold wording nit (e.g. the "nothing there is duplicated" phrasing in docs/adr/0035-ml-dsa-crate-rustcrypto.md:89-91, which can be read as "no new duplicate", since crypto-common 0.1.7/0.2.2 predates this change) or an assertion the corpus explicitly permits (e.g. an ADR written as Proposed before its parent RFC, which docs/adr/README.md §Process and RFC-0012 §Ordering both allow), so none is anchored to a violated rule and none is reported.

Decision: 🟢 Approved

github run

@claude

claude Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (#174)

Decision: 🟡 Minor changes
Iteration: First review
Lenses applied: Design decision (docs/adr/0035)

Executive summary

ADR-0035 selects RustCrypto/ml-dsa as the ML-DSA-44 crate for the composite ssh-mldsa44-ed25519 host key, staying Proposed until a release containing upstream PR #1386 ships. The security reasoning is sound — the pre-auth reachability of the signing path is correctly elevated to a hard constraint, the = exact version pin is the right mechanism, and the alternatives table is thorough. One issue needs addressing: the feature-set justification in Decision §2 is incomplete, and the §3 bridge to OS randomness is underspecified in a way that may carry a hidden dependency implication under commitment #4.

New findings

🟡 Important (should be resolved)

[docs/adr/0035-ml-dsa-crate-rustcrypto.md:63–71] — incomplete feature justification / unspecified randomness bridge (confidence: 82)

Problem: Decision §2 drops three default features (alloc, getrandom, pkcs8) with a single rationale — "because keys come from the openssh-key-v1 container, not PKCS#8" — that justifies only pkcs8. getrandom and alloc are dropped without a stated reason.

The gap compounds in §3, which mandates sign_randomized with "fresh OS randomness" and bridges to it with "(the workspace already takes its randomness from getrandom)". That parenthetical does not hold: sign_randomized takes a rand_core::CryptoRng value, not a byte buffer. OsRng sits behind rand_core's own os_rng feature, which depends on getrandom. With ml-dsa's getrandom feature off, rand_core 0.10.1 in Cargo.lock has zero transitive deps — OsRng does not exist in the tree. grep -rn "CryptoRng\|RngCore\|OsRng" across crates/ returns no hits; the workspace has no CryptoRng adapter of any kind.

The ADR is implementable — a first-party adapter over getrandom::fill mirrors kex.rs:657–663 exactly. But if that requires a direct rand_core workspace dependency, commitment #4 requires it to be justified here; it is absent from §Negative's lock-file accounting.

Fix: (1) Split §2's justification so each dropped default has its own rationale. (2) Add one sentence to §3 stating how the CryptoRng is sourced. Three valid paths:

  • A first-party struct over getrandom::fill implementing CryptoRng — no new dep, matches kex.rs:660. Preferred.
  • rand_core direct dep with os_rng — add to §Negative's lock-file inventory and justify under commitment chore(security): mark quantumssh.org aliases as live #4.
  • If ml-dsa exposes a hedged entry point taking the raw 32-byte rnd buffer directly (like encapsulate_deterministic), state that.

Anchor: CLAUDE.md commitment #4 (no unjustified new dependency); threat-model §4.3 (entropy sourcing).

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
… (sys_rng)

claude-review on #174: the feature list justified only pkcs8, and hedged
signing named no concrete CryptoRng.

- Decision 2 now gives each enabled and dropped feature its own reason
  (rand_core gates sign_randomized; getrandom stays off to keep one OS
  randomness path; alloc is unused by the composite's surface).
- Decision 3 names the RNG: getrandom::SysRng from the workspace's
  existing getrandom 0.4 dependency via its sys_rng feature, which
  implements rand_core 0.10 TryCryptoRng with no new crate (rand_core
  0.10.1 is already in Cargo.lock). Verified end to end with ml-dsa 0.1.1
  and getrandom 0.4.3 in a scratch crate.
- Records the rejected sign_internal path (upstream marks it test-only)
  and a first-party adapter.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@github-actions

Copy link
Copy Markdown

Reviewer: Codex (openai/codex-action, model gpt-5.6-terra)

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: Review #2 (1 resolved, 0 open)
Lenses applied: Design decision (docs/adr/0035), MANIFIESTO commitments, threat model, RFC-0006/0007/0012

Executive summary

ADR-0035 selects RustCrypto ml-dsa only once its constant-time signing fixes are released, with an exact-pin rule and no implementation or dependency change in this PR. The revised feature and RNG rationale closes the prior dependency/entropy-source concern; no new finding meets the reporting threshold. External upstream-release and API assertions could not be independently verified without network access.

Previous issues

# Issue Status Notes
1 Feature justification and CryptoRng source were unspecified ✅ Decision items 2–3 now justify each feature and specify getrandom::SysRng via the existing getrandom 0.4 dependency; lockfile impact is documented.

New findings

None. No issue reached the reporting threshold.

Decision: 🟢 Approved

@opencode-agent

Copy link
Copy Markdown

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: Review #2 (1 resolved, 0 open)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md). The Rust and CI lenses do not apply — the PR adds one ADR and touches no code, manifest, or workflow.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as subsidiary ADR 1 delegated by RFC-0012 and modelled on ADR-0019. It correctly treats constant-time signing as a hard requirement because host-key signing runs pre-authentication, refusing 0.1.1 until a release carries RustCrypto/signatures#1386. I independently re-verified the load-bearing external facts and the prior review's one finding, and both hold: the ADR is sound against all five commitments and the hard security rules.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no concrete CryptoRng for the hedged path (claude, conf 82) ✅ Resolved a64f2c7 gives every enabled/dropped feature its own reason and names &mut getrandom::SysRng via the workspace getrandom sys_rng feature. Verified against the current file, not the reply: docs/adr/0035-ml-dsa-crate-rustcrypto.md:63-94. getrandom 0.4.3 defines sys_rng = ["dep:rand_core"] and its SysRng implements rand_core 0.10's TryCryptoRng; rand_core 0.10.1 is already in Cargo.lock, so the claim "adds no crate" holds.

Verification note

Checked against primary sources, all consistent with the ADR:

  • ml-dsa 0.1.1 (2026-06-05) is the newest release; ml-dsa: fix constant time issues RustCrypto/signatures#1386 ("ml-dsa: fix constant time issues", merge 31b75402e4) merged 2026-06-24 and is in no published release. Rejecting 0.1.1 is correct, not conservative overreach.
  • ml-dsa 0.1.1 features are exactly alloc, getrandom, pkcs8 (defaults) plus zeroize, rand_core; sign_randomized is gated by #[cfg(feature = "rand_core")] and takes TryCryptoRng. Its deps resolve to lock entries already present (crypto-common 0.2.2, ctutils 0.4.2, hybrid-array 0.4.12, module-lattice 0.2.3), and signature 3.0.0 uses rand_core ^0.10 — so the "four new crates" accounting (ml-dsa, shake, sponge-cursor, signature 3.0.0) is accurate and adds no new rand_core/crypto-common major.
  • ml-dsa inherits RustCrypto/signatures' unsafe_code = "forbid" workspace lint; RUSTSEC-2025-0144 is patched at >= 0.1.0-rc.3; deny.toml allows Apache-2.0/MIT, sets allow-git = [] and multiple-versions = "warn" as the ADR states; OpenSSH V_10_6_P1 ssh-mldsa-eddsa.c fills a fresh buffer with arc4random_buf per signature.
  • Both commits (fb682ea, a64f2c7) report .commit.verification.verified = true (reason valid) via the GitHub API, and both carry DCO sign-offs with Conventional Commit subjects.

New findings

💡 Suggestions (nice to have)

  • docs/adr/0035-ml-dsa-crate-rustcrypto.md:35,79-80: the candidate table credits ml-dsa with "ACVP and Wycheproof vectors", but neither Decision nor Consequences commits to running them, whereas ADR-0019 — the ADR this one explicitly parallels — made CI-verified ACVP KATs a Decision item and a Positive. A one-line commitment (in the implementing PR, or here) keeps the parallel and ties the vectors to threat-model §7's residual-risk posture.

Decision: 🟢 Approved

github run

@claude

claude Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

PR Review: ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (#174)

Decision: 🟡 Minor changes
Iteration: Review #2 (1 resolved, 0 open from #1)
Lenses applied: Design decision (docs/adr/0035)

Executive summary

ADR-0035 is well-reasoned: crate selection is sound, the constant-time version-pin is correctly fail-closed, the five MANIFIESTO commitments are satisfied, and the feature set is now fully justified. Two design gaps need addressing before the ADR should flip to Accepted: the pre-auth signing path needs its RNG-failure behavior specified, and the version rule needs to explicitly exclude pre-releases.

Previous issues

# Issue Status Notes
1 Incomplete feature-set justification and underspecified CryptoRng bridge ✅ Resolved §2 now justifies each feature individually; §3 specifies getrandom::SysRng via sys_rng with an end-to-end scratch-crate verification

New findings

🟡 Important (should be resolved)

[docs/adr/0035:81–89] — unspecified fail behavior on the pre-auth signing path (confidence: 85)

Problem: Decision §3 commits to sign_randomized driven by &mut getrandom::SysRng. SysRng implements TryCryptoRng (fallible), so the signing call acquires an OS-RNG error path that does not exist in the current Ed25519-only HostKey::sign (which returns Vec<u8> — infallible). The ADR's own Context identifies this as the highest-trust pre-auth surface. The ADR does not specify whether sign becomes fallible (returning Result, mapping failures to SSH_DISCONNECT_KEY_EXCHANGE_FAILED) or whether RNG failure causes a panic reachable by any unauthenticated peer. The workspace already has a house pattern for this (kex.rs, cipher.rs, wire.rs all propagate getrandom failures as Err); the ADR should commit to the same fail-closed path.
Fix: Add one sentence to §3 specifying that RNG failure aborts the connection with SSH_DISCONNECT_KEY_EXCHANGE_FAILED and that the composite sign function becomes fallible accordingly.
Anchor: CLAUDE.md threat model §4.1 (pre-auth path, highest-trust), "Fail closed" rule, §4.3 (key material never in panic output)

[docs/adr/0035:56–62] — version rule admits pre-releases (confidence: 80)

Problem: "The first ml-dsa release containing #1386" does not exclude pre-releases. RustCrypto's precedent is to ship fixes in pre-releases first — RUSTSEC-2025-0144 was patched in 0.1.0-rc.3. An implementing PR could pin =0.1.2-rc.1 and be conformant, even though pre-releases carry less assurance than a stable release on an unaudited pre-auth crate.
Fix: Change "first ml-dsa release" → "first stable ml-dsa release".
Anchor: CLAUDE.md Commitment #4 (new dependencies must be fully justified); threat model §4.1

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
claude-review round 2 on #174:

- Version rule: the first stable (non-pre-release) ml-dsa release that
  contains RustCrypto/signatures#1386.
- Decision 3: SysRng is fallible, so host-key signing becomes fallible
  (HostKey::sign returns Vec<u8> today, host_key.rs:165); an RNG error
  aborts the key exchange with SSH_DISCONNECT_KEY_EXCHANGE_FAILED, the
  path kex.rs already takes for getrandom failures, and never panics.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

I have everything needed. Verified: all three commits report .commit.verification.verified = true via the GitHub API; the two claude-raised issues are fixed in the head commit; and the strongest candidate (a zeroize-doesn't-reach-shake gap) is real but shared with the already-accepted ml-kem baseline, so it sits below the bar.

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: Review #3 (3 resolved, 0 open)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md). The Rust and CI lenses do not apply — the PR adds one ADR and touches no code, manifest, or workflow.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as subsidiary ADR 1 delegated by RFC-0012 and modelled on ADR-0019. It correctly treats constant-time signing as a hard requirement because host-key signing runs pre-authentication, refusing 0.1.1 until a stable release carries RustCrypto/signatures#1386, and it fixes hedged signing, per-feature justification, exact-pin discipline, and fail-closed RNG handling. All three issues from the earlier rounds are now fixed in the head commit; I re-verified the load-bearing external facts against crates.io and the upstream tree, and they hold. No new finding reaches the ≥80 bar.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no concrete CryptoRng (claude, conf 82) ✅ Resolved a64f2c7: every enabled/dropped feature has its own reason; &mut getrandom::SysRng via the workspace getrandom sys_rng feature
2 RNG-failure behavior on the pre-auth signing path unspecified (claude, conf 85) ✅ Resolved 100a423: HostKey::sign becomes fallible and an RNG error aborts with SSH_DISCONNECT_KEY_EXCHANGE_FAILED, never panics
3 Version rule admitted pre-releases (claude, conf 80) ✅ Resolved 100a423: now "the first stable ml-dsa release (no -rc, -pre or other pre-release)"

Verified against the current file at 100a4232def3342a240b3111d98feba1e514457b, not the thread replies: docs/adr/0035-ml-dsa-crate-rustcrypto.md:56-57 and :96-102.

Verification note

  • ml-dsa 0.1.1 features are exactly alloc, getrandom, pkcs8 (defaults) plus zeroize, rand_core; zeroize = ["dep:zeroize","hybrid-array/zeroize","module-lattice/zeroize"]; rand_core = ["common/rand_core","signature/rand_core"]. The ADR's feature rationale is accurate.
  • getrandom 0.4's sys_rng exists and rand_core 0.10.1 is already resolved in Cargo.lock:591 (via ml-kem, crypto-common 0.2.2), so "adds no crate" holds; deny.toml matches the ADR's claims (multiple-versions = "warn", allow-git = [], Apache-2.0/MIT allowed).
  • All three commits report .commit.verification.verified = true (reason valid) via the GitHub API; each carries a DCO sign-off and a valid Conventional Commit subject.

New findings

No issue reached the ≥80 reporting threshold. Two sub-threshold suggestions are recorded for completeness.

💡 Suggestions (nice to have)

  • docs/adr/0035-ml-dsa-crate-rustcrypto.md:67-68: the zeroize bullet justifies the feature as "private-state erasure (RFC-0012 §Key material)", but ml-dsa 0.1.1's zeroize feature does not forward to the shake XOF it depends on (shake 0.1.0's own zeroize feature is off by default and is not activated transitively), so the SHAKE sponge state that absorbs the secret seed and K || rnd is not erased. This is bounded by threat-model §4.3's explicitly "best-effort" zeroization, matches the same shape of limitation already accepted for ml-kem in ADR-0019, and cannot be closed without a direct shake dependency (which commitment chore(security): mark quantumssh.org aliases as live #4 would then require justifying). A one-line note under §Negative or the zeroize bullet would keep the record precise. Anchor: threat-model §4.3; RFC-0012 §Key material.

  • docs/adr/0035-ml-dsa-crate-rustcrypto.md:35,109-112: the candidate table credits ml-dsa with "ACVP and Wycheproof vectors", but neither the Decision nor Consequences commits to running them — the only recorded verification is the self-roundtrip in item 3. ADR-0019, the template this ADR explicitly parallels, made CI-verified ACVP KATs a Decision item and a Positive. This was raised as a suggestion in the previous opencode review and remains open. Anchor: RFC-0007 §2 ("paralleling ADR-0019"); ADR-0019 Decision item 4; threat-model §5.2.4.

Decision: 🟢 Approved

github run

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…e erasure gap

opencode review #3 suggestions on #174 (below its threshold, applied):

- Decision 5: the implementation PR runs NIST ACVP ML-DSA-44 keyGen,
  sigVer and deterministic sigGen vectors (and the LAMPS composite
  vectors where published), as ADR-0019 required for ML-KEM.
- Negative: ml-dsa 0.1.1's zeroize feature does not reach its shake
  dependency (declared default-features = false), so the SHAKE sponge
  state is not erased; recorded as within threat-model 4.3's best-effort
  erasure.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟡 Minor changes
Iteration: Review #4 (5 resolved, 0 open from earlier rounds)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md). The Rust and CI lenses do not apply — the PR adds one ADR and touches no code, manifest, or workflow.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as subsidiary ADR 1 delegated by RFC-0012 and modelled on ADR-0019. The core decision is sound against all five commitments and the hard security rules: pure Rust with unsafe_code = "forbid" upstream, Apache-2.0 OR MIT, exact-pin discipline, hedged sign_randomized with getrandom::SysRng, and a fail-closed RNG error path on the pre-auth signing surface. I re-verified the load-bearing external facts against crates.io, the crate source, deny.toml, Cargo.lock, and the OpenSSH 10.6 tree, and they hold. The one new issue is a factual error in the conformance-vector item added by the head commit.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no concrete CryptoRng (claude, conf 82) ✅ Resolved a64f2c7: per-feature rationale; &mut getrandom::SysRng via getrandom's sys_rng
2 RNG-failure behavior on the pre-auth signing path unspecified (claude, conf 85) ✅ Resolved 100a423: HostKey::sign becomes fallible; error → SSH_DISCONNECT_KEY_EXCHANGE_FAILED
3 Version rule admitted pre-releases (claude, conf 80) ✅ Resolved 100a423: now "the first stable ml-dsa release (no -rc, -pre …)"
4 Commit to running conformance vectors (opencode suggestion) ✅ Resolved b820b43 item 5 added — but names the wrong API (new finding below)
5 Record the SHAKE-state erasure gap (opencode suggestion) ✅ Resolved b820b43 §Negative bullet; verified accurate against ml-dsa 0.1.1 / shake 0.1.0

New findings

🟡 Important (should be resolved)

docs/adr/0035-ml-dsa-crate-rustcrypto.md:115-116 — conformance vectors name the wrong signing API (confidence: 82)

Problem: Item 5 commits to running "the deterministic sigGen cases through sign_deterministic". sign_deterministic is the FIPS 204 external interface (Algorithm 2): it frames the message via MuBuilder::new(tr, ctx), absorbing 00 || len(ctx) || ctx || M (ml-dsa 0.1.1 src/lib.rs:165-173). The NIST ACVP sigGen vectors are the internal interface and are reproduced upstream through ExpandedSigningKey::sign_internal(&[&tc.message], &rnd) with rnd = B32::default() for deterministic groups (ml-dsa tests/sig-gen.rs:30-46); the vector schema has no context field (TestCase { sk, message, signature, rnd }). MuBuilder::internal absorbs only tr || M' (src/lib.rs:175-183), so sign_deterministic(M, ctx) — even with ctx = "" — produces a different mu and cannot match those vectors. An implementing PR that follows item 5 literally will fail to reproduce the vectors it was meant to check, defeating the "mechanically checked in CI" parallel with ADR-0019. This is also internally in tension with Alternative 5 (:199-207), which already flags sign_internal as the test-only internal entry point.

Fix: Name the internal path for the ACVP sigGen vectors, e.g. "the deterministic sigGen cases through sign_internal with a zeroed rnd, as upstream's own ACVP harness does (tests/sig-gen.rs)". Alternatively, restrict sign_deterministic to vectors NIST publishes with the external interface and say so. Either way, record that sign_internal is test-only upstream (Alternative 5) so the reliance is explicit.

Anchor: ADR-0019 (the template item 5 invokes: "ACVP conformance is mechanically checked in CI, not asserted"); RFC-0007 §2 (crate-selection ADR paralleling ADR-0019).

💡 Suggestions (nice to have)

  • docs/adr/0035-ml-dsa-crate-rustcrypto.md:118-120: "A crate upgrade that changes behaviour therefore fails CI" overstates coverage — production signing is hedged sign_randomized with ctx = "COMPSIG-MLDSA44-Ed25519-SHA512" (item 3), while the named vectors are deterministic. Committing to the hedged ACVP groups (the crate's harness consumes tc.rnd for deterministic: false) and, where published, the LAMPS composite vectors would make the claim true. Anchor: ADR-0035 item 3; RFC-0007 §2.

Verification note

Checked against primary sources, all consistent with the ADR: ml-dsa 0.1.1 features are exactly alloc/getrandom/pkcs8 (defaults) plus zeroize/rand_core; getrandom 0.4.3 sys_rng = ["dep:rand_core"] and SysRng implements rand_core 0.10 TryCryptoRng; rand_core 0.10.1, module-lattice 0.2.3, hybrid-array 0.4.12, ctutils 0.4.2, crypto-common 0.2.2 are already in Cargo.lock; ml-dsa 0.1.1 declares unsafe_code = "forbid", rust-version = 1.85, Apache-2.0 OR MIT, and shake with default-features = false un-forwarded by its zeroize feature; RustCrypto/signatures#1386 merged 2026-06-24 (31b75402e4) with crates.io still at 0.1.1; deny.toml sets multiple-versions = "warn", allow-git = [], Apache-2.0/MIT allowed; OpenSSH V_10_6_P1 ssh-mldsa-eddsa.c defines COMPOSITE_LABEL "COMPSIG-MLDSA44-Ed25519-SHA512" and fills mldsa_rnd with arc4random_buf per signature. All four commits report .commit.verification.verified = true (reason valid) via the GitHub API, and each carries a DCO sign-off and a valid Conventional Commit subject.

github run

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
opencode review #4 on #174: ACVP sigGen vectors are defined against
FIPS 204's internal interface, so sign_deterministic (external framing)
cannot reproduce them. Decision 5 now names the calls upstream's own
harness uses at ml-dsa/v0.1.1: from_seed for keyGen, sign_internal for
sigGen (deterministic with zeroed rnd and hedged with the vector's rnd),
verify_internal for sigVer, in tests only. The production framing
(sign_randomized with ctx and the composite M') is covered by the LAMPS
composite vectors where published and end to end by the ADR-0020
OpenSSH interop gate.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

PR Review: ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (#174)

Decision: 🟢 Approved
Iteration: Review #5 (6 resolved, 0 open from earlier rounds)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md). The Rust and CI lenses do not apply — the PR adds one ADR and touches no code, manifest, or workflow.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as subsidiary ADR 1 delegated by RFC-0012 and modelled on ADR-0019. The decision is sound against all five commitments and the hard security rules: pure Rust with upstream unsafe_code = "forbid", Apache-2.0 OR MIT, = exact-pin discipline, hedged sign_randomized over the pre-auth signing surface, and a fail-closed RNG error path. The head commit 605636e fixes the one outstanding finding from Review #4 (the ACVP plan named sign_deterministic for the internal vectors); I re-verified the corrected item against the crate's own v0.1.1 harness and it is now accurate. No new finding reaches the ≥80 bar.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no concrete CryptoRng (claude, conf 82) ✅ Resolved a64f2c7: every enabled/dropped feature has its own reason; &mut getrandom::SysRng via getrandom's sys_rng
2 RNG-failure behavior on the pre-auth signing path unspecified (claude, conf 85) ✅ Resolved 100a423: HostKey::sign becomes fallible; RNG error → SSH_DISCONNECT_KEY_EXCHANGE_FAILED, never panics
3 Version rule admitted pre-releases (claude, conf 80) ✅ Resolved 100a423: now "the first stable ml-dsa release (no -rc, -pre …)"
4 Commit to running conformance vectors (opencode suggestion) ✅ Resolved b820b43 added item 5; corrected by 605636e below
5 Record the SHAKE-state erasure gap (opencode suggestion) ✅ Resolved b820b43 §Negative bullet; accurate against ml-dsa 0.1.1 / shake 0.1.0
6 Item 5 named sign_deterministic for the internal ACVP vectors (opencode, conf 82) ✅ Resolved 605636e: now sigGen → sign_internal, sigVer → verify_internal; verified against upstream tests/sig-gen.rs / tests/sig-ver.rs at ml-dsa/v0.1.1
7 "A crate upgrade that changes behaviour therefore fails CI" overstated coverage (opencode suggestion) ✅ Resolved 605636e: item 5 split into a primitive layer (internal ACVP) and an external-framing layer (LAMPS vectors + ADR-0020 interop gate)

Verified against the current file at 605636e1b32a6603894511619c7b257274c88b1f (docs/adr/0035-ml-dsa-crate-rustcrypto.md:113-137), not the thread replies.

New findings

No issue reached the ≥80 reporting threshold. One sub-threshold suggestion is recorded for completeness.

💡 Suggestions (nice to have)

  • docs/adr/0035-ml-dsa-crate-rustcrypto.md:113-128: the ACVP plan's import path from the vector sk bytes to sign_internal/keyGen runs through ExpandedSigningKey::from_expanded / to_expanded, which upstream marks #[deprecated] (since 0.1.0) and its own tests wrap in #[allow(deprecated)] (tests/key-gen.rs, tests/sig-gen.rs). Item 5 flags only sign_internal as test-only, and its mitigation ("if upstream later gates these methods behind a feature… enable for dev-dependencies") does not cover an API that is deprecated-to-remove rather than feature-gated. A one-line note that these are test-only #[allow(deprecated)] calls, re-checked against the pinned release, would make the mechanism's reliance explicit. Anchor: ADR-0019 §Positive ("ACVP conformance is mechanically checked in CI, not asserted"); ADR-0035 item 5; threat-model §5.2.4.

Verification note

Checked against primary sources, all consistent with the ADR:

  • Upstream ml-dsa/v0.1.1 harness uses ExpandedSigningKey::sign_internal(&[&tc.message], &rnd) (deterministic → B32::default()) in tests/sig-gen.rs, VerifyingKey::verify_internal in tests/sig-ver.rs, and SigningKey::from_seed in tests/key-gen.rs — so item 5's corrected mapping is exact.
  • ml-dsa 0.1.1 Cargo.toml: defaults are alloc, getrandom, pkcs8; rand_core gates sign_randomized; zeroize forwards only to hybrid-array/module-lattice, not shake (default-features = false). Each per-feature rationale is accurate.
  • getrandom 0.4.3 sys_rng is ["dep:rand_core"] with rand_core ^0.10; SysRng implements TryCryptoRng. rand_core 0.10.1 and getrandom 0.4.3 are already in Cargo.lock; the workspace declares getrandom = { version = "0.4", default-features = false } directly, so this is one feature on an existing dependency, as §Negative records.
  • deny.toml sets multiple-versions = "warn", allow-git = [], and allows Apache-2.0/MIT, matching the ADR.
  • All five commits report .commit.verification.verified = true (reason valid) via the GitHub API, and each carries a DCO sign-off and a valid Conventional Commit subject.

Decision: 🟢 Approved

github run

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…CVP harness

opencode review #5 suggestion on #174: the ACVP vectors carry expanded signing keys, loaded through ExpandedSigningKey::from_expanded, which upstream deprecates and wraps in allow(deprecated) in its own harness. Item 5 now records the same test-only use and what happens if upstream gates or removes it.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

Copy link
Copy Markdown
Owner Author

Reviewer findings in general comments, rounds 3–5. The inline threads from claude-review were answered and resolved one by one.

# Source Finding Action Commit
1 opencode #3 (suggestion) ml-dsa's zeroize does not reach the shake sponge state Recorded under §Negative, within threat-model §4.3's best-effort erasure b820b43
2 opencode #3 (suggestion) ACVP vectors were listed but not committed to as tests (ADR-0019 parallel) New Decision item 5 b820b43
3 opencode #4 (important) Item 5 routed sigGen through sign_deterministic (external framing), which cannot reproduce ACVP vectors Item 5 now uses the internal interfaces upstream's own harness uses at ml-dsa/v0.1.1: from_seed, sign_internal (deterministic and hedged groups) and verify_internal, in tests only. The production framing is covered by the LAMPS composite vectors where published and by the ADR-0020 interop gate 605636e
4 opencode #5 (suggestion) The harness relies on #[deprecated] from_expanded Noted in item 5 as test-only #[allow(deprecated)] use, with a fallback if upstream gates or removes it 644307a

Codex review job (red since 16:08 UTC): this is an infrastructure failure, not a finding about the PR. The action's log ends with stream disconnected before completion: You have no credits remaining from the OpenAI API. It needs credits added to the account behind OPENAI_API_KEY. Codex approved rounds 1–2 of this PR before the credits ran out.

@opencode-agent

Copy link
Copy Markdown

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: Review #6 (7 resolved, 0 open)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md). The Rust and CI lenses do not apply — the PR adds one ADR and touches no code, manifest, or workflow.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite, as Subsidiary ADR 1 delegated by RFC-0012 and modelled on ADR-0019. The decision is sound against all five commitments and the hard security rules: pure Rust with upstream unsafe_code = "forbid", MIT OR Apache-2.0, = exact-pin discipline, hedged sign_randomized over the pre-auth signing surface, and a fail-closed RNG error path. Every issue from the previous rounds is fixed in the head commit 644307a; I re-verified the load-bearing external facts against crates.io, the crate source, RustSec, and the OpenSSH tree, and all hold. No new finding reaches the ≥80 bar.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no concrete CryptoRng (claude, conf 82) ✅ a64f2c7: per-feature rationale; &mut getrandom::SysRng via getrandom's sys_rng. Verified at :64-90.
2 RNG-failure behaviour on the pre-auth signing path unspecified (claude, conf 85) ✅ 100a423: HostKey::sign becomes fallible; error → SSH_DISCONNECT_KEY_EXCHANGE_FAILED, never panics. Verified at :96-102.
3 Version rule admitted pre-releases (claude, conf 80) ✅ 100a423: "first stable ml-dsa release (no -rc, -pre …)". Verified at :56-58.
4 Record the SHAKE-state erasure gap (opencode suggestion) ✅ b820b43 §Negative :171-178; verified accurate against ml-dsa 0.1.1 / shake 0.1.0.
5 Commit to running conformance vectors (opencode suggestion) ✅ b820b43 item 5, corrected by 605636e/644307a.
6 Item 5 routed sigGen through sign_deterministic for internal vectors (opencode, conf 82) ✅ 605636e: sigGen → sign_internal, sigVer → verify_internal; verified against upstream tests/sig-gen.rs / tests/sig-ver.rs at ml-dsa/v0.1.1.
7 Harness relies on #[deprecated] from_expanded (opencode suggestion) ✅ 644307a: noted as test-only #[allow(deprecated)] use with a fallback. Verified at :127-133.

New findings

No issue reached the ≥80 reporting threshold.

Verification note

Checked against primary sources, all consistent with the ADR:

  • ml-dsa 0.1.1 (2026-06-05) is the newest release (crates.io max_stable_version); ml-dsa: fix constant time issues RustCrypto/signatures#1386 "ml-dsa: fix constant time issues" merged 2026-06-24 (31b75402e4) and is a descendant of the ml-dsa/v0.1.1 tag, so it is in no published release. Rejecting 0.1.1 is correct, not conservative overreach.
  • ml-dsa 0.1.1 features are exactly alloc/getrandom/pkcs8 (defaults) plus zeroize/rand_core; sign_randomized<R: TryCryptoRng> returns Result<Signature, Error>, gated by #[cfg(feature = "rand_core")]; sign_internal carries the upstream // TODO(RLB) Only expose based on a feature marker (Alternative 5); from_expanded is #[deprecated(since = "0.1.0")]; from_seed documents FIPS 204 ML-DSA.KeyGen_internal; zeroize forwards to hybrid-array/module-lattice only, with shake declared default-features = false.
  • Upstream harness at ml-dsa/v0.1.1 uses SigningKey::from_seed (tests/key-gen.rs), sign_internal with B32::default() for deterministic groups (tests/sig-gen.rs), and verify_internal (tests/sig-ver.rs) — item 5's mapping is exact. tests/wycheproof.rs exists, so the candidate-table "ACVP and Wycheproof vectors" claim is accurate.
  • getrandom 0.4.3 sys_rng = ["dep:rand_core"] and SysRng implements rand_core 0.10 TryCryptoRng; signature 3.0.0 depends on rand_core ^0.10; rand_core 0.10.1, module-lattice 0.2.3, hybrid-array 0.4.12, ctutils 0.4.2 and crypto-common 0.2.2 are already in Cargo.lock, so "adds no crate" holds. shake 0.1.0 and sponge-cursor 0.1.0 are MIT OR Apache-2.0, and the net-new lock entries are exactly the four named.
  • RUSTSEC-2025-0144 is the only advisory for ml-dsa, patched = [">= 0.1.0-rc.3"]. OpenSSH V_10_6_P1 ssh-mldsa-eddsa.c defines COMPOSITE_LABEL "COMPSIG-MLDSA44-Ed25519-SHA512" and calls arc4random_buf per signature.
  • All six commits report .commit.verification.verified = true (reason valid) via the GitHub API, each carries a DCO sign-off and a valid Conventional Commit subject. (git log --format=%G? cannot observe this on the runner.)

Decision: 🟢 Approved

github run

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…nes, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…nes, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…ther (Proposed) (#177)

* docs(adr): ADR-0036 — move ed25519-dalek and x25519-dalek to 3.x together (Proposed)

The coordinated bump the #109 comment of 2026-07-18 deferred, subsidiary
to RFC-0003. Evaluates the four points that comment asked for: API
(ed25519-dalek 3 drops std; no first-party code change needed), zeroize
and static_secrets (kept; x25519 secrets now erase on drop only), MSRV
(1.85, below the workspace's 1.92), and maturity/audit (no advisory on
either line; Verus coverage applies to curve25519-dalek 4.1.3, not 5.0;
no known public audit of 5.0/3.0).

States the value plainly: no vulnerability fixed; Cargo.lock 102 -> 88,
no duplicated crates in quantumssh-core, signature 3 aligned with
ADR-0035's ml-dsa. Records that the dalek crates are BSD-3-Clause
(RFC-0003 says Apache-2.0 or MIT; deny.toml allows BSD-3-Clause).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — ed25519-dalek 3's runtime vs optional/dev dependencies

opencode review #2 suggestion on #177: getrandom 0.4 is a dev-dependency
of ed25519-dalek 3.0.0, and rand_core 0.10 and signature 3 are optional
there (signature 3 still enters through ed25519 3, a normal dependency).
The API bullet now names the runtime moves only. Verified against the
crates.io dependency metadata of ed25519-dalek 3.0.0 and ed25519 3.0.0.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — yanked 4.2.0 and licence cell wording

opencode suggestions on #177 (review #3) and #179 (review #2):
- curve25519-dalek 4.2.0 was published 2025-07-09 and yanked; both
  maintenance statements now say 'no usable 4.x release since
  2024-06-18' and name it (verified on crates.io).
- The licence cell said 'all six' with no referent; it now says 'all
  three crates'.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — cite RFC-0003's Guide-level explanation for the primitive stack

opencode suggestion on #179 (review #3): RFC-0003 section 'Operational
dependencies of this decision' only lists four follow-up ADRs and never
mentions the dalek crates; the primitive stack (with x25519-dalek and
ed25519-dalek) is in its Guide-level explanation. Related and Links now
point there, consistent with the licence note.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…-dalek 5) (#179)

* docs(adr): ADR-0036 — move ed25519-dalek and x25519-dalek to 3.x together (Proposed)

The coordinated bump the #109 comment of 2026-07-18 deferred, subsidiary
to RFC-0003. Evaluates the four points that comment asked for: API
(ed25519-dalek 3 drops std; no first-party code change needed), zeroize
and static_secrets (kept; x25519 secrets now erase on drop only), MSRV
(1.85, below the workspace's 1.92), and maturity/audit (no advisory on
either line; Verus coverage applies to curve25519-dalek 4.1.3, not 5.0;
no known public audit of 5.0/3.0).

States the value plainly: no vulnerability fixed; Cargo.lock 102 -> 88,
no duplicated crates in quantumssh-core, signature 3 aligned with
ADR-0035's ml-dsa. Records that the dalek crates are BSD-3-Clause
(RFC-0003 says Apache-2.0 or MIT; deny.toml allows BSD-3-Clause).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* fix(deps): declare zeroize's alloc feature explicitly

Zeroizing<Vec<u8>> (kex.rs, auth.rs, transport.rs) and Zeroizing<String>
need zeroize's alloc feature. The workspace never declared it: it
arrives only through feature unification from ed25519-dalek's std
feature (ed25519-dalek/std -> alloc -> zeroize?/alloc and
curve25519-dalek/alloc). Dropping std from ed25519-dalek, as its 3.x
line requires, would break the build in 35 places with no code change
of ours. Declare it where it is used.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* chore(deps): move ed25519-dalek and x25519-dalek to 3.0.0 (curve25519-dalek 5)

Implements ADR-0036. ed25519-dalek drops the removed std feature and the
unused rand_core feature; x25519-dalek keeps static_secrets and zeroize.
No first-party code change.

Cargo.lock: 102 -> 88 packages; cargo tree -d -e normal -p
quantumssh-core prints nothing (was sha2, digest, rand_core,
block-buffer, crypto-common, cpufeatures in two versions each).
fmt, clippy -D warnings, test --workspace (34 + 103 + 35) and
build --release pass.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 Accepted with the implementing PR #179

Flips Status to Accepted inside the implementing PR (repo pattern since
#128), points Links/Decision at #179, and historicises the three
drafting-time phrasings (table header, advisory sentence, ADR-0035
availability).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — ed25519-dalek 3's runtime vs optional/dev dependencies

opencode review #2 suggestion on #177: getrandom 0.4 is a dev-dependency
of ed25519-dalek 3.0.0, and rand_core 0.10 and signature 3 are optional
there (signature 3 still enters through ed25519 3, a normal dependency).
The API bullet now names the runtime moves only. Verified against the
crates.io dependency metadata of ed25519-dalek 3.0.0 and ed25519 3.0.0.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — yanked 4.2.0 and licence cell wording

opencode suggestions on #177 (review #3) and #179 (review #2):
- curve25519-dalek 4.2.0 was published 2025-07-09 and yanked; both
  maintenance statements now say 'no usable 4.x release since
  2024-06-18' and name it (verified on crates.io).
- The licence cell said 'all six' with no referent; it now says 'all
  three crates'.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — cite RFC-0003's Guide-level explanation for the primitive stack

opencode suggestion on #179 (review #3): RFC-0003 section 'Operational
dependencies of this decision' only lists four follow-up ADRs and never
mentions the dalek crates; the primitive stack (with x25519-dalek and
ed25519-dalek) is in its Guide-level explanation. Related and Links now
point there, consistent with the licence note.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T20:42:15.072085Z 587b8fe Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 644307a655

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

gonzafg2 added a commit that referenced this pull request Oct 12, 2026
…ng state

Codex (App) P1 on #174: ml-dsa's sign_randomized creates rnd, rhopp and
the mask y as plain buffers inside the crate (upstream master
signing.rs:316-329, 397-401); its zeroize feature covers only key
structures. RFC-0012 required 'any signing temporaries' in zeroizing
types, which no caller can guarantee for library internals and which is
stricter than threat-model 4.3 (best-effort erasure via zeroize).

Maintainer decision: the normative rule binds every signing temporary
QuantumSSH's own code creates or holds; crate-internal temporaries fall
under 4.3's best effort and the crate ADR records them as a residual.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @gonzafg2's task in 25s —— View job


PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (Proposed) (#174)

Decision: 🟢 Approved
Iteration: Review #7 (all earlier items resolved, 0 open)
Lenses applied: design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md), checked against the five CLAUDE.md commitments, threat-model §4.1/§4.3, RFC-0006/0007/0012 and ADR-0019/0020. I did not apply the Rust or CI lenses, because the PR adds one ADR and touches no code. I did not re-check upstream facts against the network. I read the ADR as it stands at the head commit, whose merge from main leaves the document unchanged.

Executive summary

ADR-0035 picks RustCrypto/ml-dsa for the ML-DSA-44 half of the composite, as subsidiary ADR 1 of RFC-0012. It stays Proposed until a stable release contains RustCrypto/signatures#1386. Pre-auth reachability of the signer makes constant-time signing a hard requirement, so the exact = pin and the rejection of 0.1.1 are coherent. The document is internally consistent and fails closed on RNG errors. It records the zeroization residuals instead of waiving them. I found nothing at or above the ≥ 80 reporting bar.

Previous issues

# Issue Status Notes
1 §2 justified only pkcs8; §3 named no CryptoRng (claude, conf 82) ✅ Each feature now has its own reason (:64-81). &mut getrandom::SysRng via the sys_rng feature is named (:82-95).
2 RNG-failure behaviour on the pre-auth signer unspecified (claude, conf 85) ✅ :96-102. Signing becomes fallible, an error aborts with SSH_DISCONNECT_KEY_EXCHANGE_FAILED, and it never panics.
3 Version rule admitted pre-releases (claude, conf 80) ✅ :56-58 now says "first stable … release".
4 SHAKE-state erasure gap (opencode suggestion) ✅ Recorded under §Negative (:180-184).
5 Conformance vectors not committed as tests (Codex/opencode suggestion) ✅ Item 5 (:113-142).
6 Item 5 named sign_deterministic for the internal ACVP vectors (opencode, conf 82) ✅ Now sign_internal / verify_internal / from_seed, in tests only (:115-125).
7 Overstated coverage claim, and reliance on deprecated from_expanded (opencode suggestions) ✅ Split into primitive and external-framing layers. The test-only #[allow(deprecated)] use has a fallback (:126-140).
8 Signing temporaries (rnd, rhopp, y) are not zeroized by ml-dsa (Codex P1) ✅ Recorded as a residual (:171-190). This depends on the RFC-0012 wording noted below.

On item 8, the Codex P1 asked to gate the release on upstream zeroization of signing temporaries. The maintainer instead scoped RFC-0012's normative rule to temporaries QuantumSSH's own code creates, and had this ADR record the in-crate ones as a residual. That is coherent. Threat-model §4.3 promises only best-effort erasure, and the ADR names the temporaries with line references. It also says they are re-checked against the pinned release, so the residual is not waived. I accept it, with one condition: the ADR is only consistent with RFC-0012 if #172 merges with that scoping intact (see the first suggestion).

New findings

No issue reached the ≥ 80 reporting threshold. Two sub-threshold suggestions:

💡 Suggestions (nice to have)

Commitment check

  1. Memory-safe: ✅ Pure Rust, and the upstream manifest forbids unsafe. This ADR adds no first-party unsafe, in line with ADR-0018.
  2. Post-quantum by default: ✅ This is the PQ signature half of the composite. It adds no classical-only or non-hybrid path, and the Ed25519 half stays.
  3. Zero legacy: ✅ This is not a legacy primitive. Ed25519 remains during its RFC-0006/0007 migration window.
  4. Small surface: ✅ Default features are off, and each retained or dropped feature is justified. The four new crates and the getrandom sys_rng feature are accounted for. It has an explicit cargo deny plan, and a git dependency is excluded (allow-git = []).
  5. Permanently open: ✅ All the crates are Apache-2.0 OR MIT.

gonzafg2 added a commit that referenced this pull request Oct 17, 2026
…encies

From claude's review #7 on #174: say what the dependencies add rather
than what the lockfile holds. crypto-common has one locked version on
main (0.2.2), so the statement is unchanged in substance.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: 4b089295-22da-4b07-b519-c3747127483b)

github run

@claude

claude Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

PR Review: docs(adr): ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (#174)

Decision: 🟡 Minor changes
Iteration: Review #3 (1 resolved, 0 open from previous)
Lenses applied: Design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md); Rust and CI lenses do not apply.

Executive summary

ADR-0035 selects RustCrypto/ml-dsa for the ML-DSA-44 half of the composite ssh-mldsa44-ed25519 host key, staying Proposed until a stable release containing RustCrypto/signatures#1386 ships. The security reasoning is sound against the threat model and all five MANIFIESTO commitments, and the previous feature-justification finding is resolved. One Negative consequence is now factually wrong: ADR-0036 was accepted and merged (PR #179) after this ADR was drafted, making the "Two signature majors" bullet false and the "Four new crates" count off by one.

Previous issues

# Issue Status Notes
1 Feature justification incomplete; CryptoRng source unspecified (claude, conf 82) ✅ Resolved a64f2c7 added per-feature rationale and named getrandom::SysRng via the sys_rng feature; verified against current file lines 63–94.

New findings

🟡 Important (should be resolved)

[docs/adr/0035-ml-dsa-crate-rustcrypto.md:194–199] — factual inaccuracy (confidence: 97)

Problem: The "Two signature majors" bullet claims ed25519-dalek 2.x uses signature 2.x, and that the duplication only ends with "the coordinated dalek 3.x bump planned on #109 … not decided here." ADR-0036 ("Move ed25519-dalek and x25519-dalek to 3.x together") was Accepted and implemented in PR #179 after this ADR was drafted. The workspace now has ed25519-dalek = "3.0.0" and a single signature = "3.0.0" entry in Cargo.lock. There will be no signature version duplication when ml-dsa is added.

The same stale state affects the "Four new crates" bullet at lines 167–170: signature 3.0.0 is already in Cargo.lock (it arrived via ADR-0036 / ed25519-dalek 3.x), so adding ml-dsa would bring three new crates (ml-dsa, shake 0.1.0, sponge-cursor 0.1.0), not four.

Fix: (1) Remove the "Two signature majors" bullet entirely — both halves share signature 3.x after ADR-0036. (2) Update "Four new crates" → "Three new crates", drop signature 3.0.0 from that list, and add a note that it is already in Cargo.lock via ADR-0036. (3) Add ADR-0036 to the Related header, since it is now the decision that makes signature 3.x shared.

Anchor: CLAUDE.md ADR/RFC lens ("review the soundness and coherence of the design DECISION"); the Negative section states a non-existent consequence.

Code reference:

- **Four new crates in `Cargo.lock`** with 0.1.1: `ml-dsa`, `shake`
0.1.0, `signature` 3.0.0 and `sponge-cursor` 0.1.0. All four are
RustCrypto crates licensed Apache-2.0 OR MIT, which `deny.toml`
allows. The exact set is re-checked against the pinned release.
(four-crate count) and
0.10.1 is already resolved.
- **Two `signature` majors.** `ml-dsa` uses `signature` 3.x while
`ed25519-dalek` 2.x uses 2.x. `deny.toml` only warns on duplicates
(`multiple-versions = "warn"`). The duplication ends with the
coordinated dalek 3.x bump planned on
[#109](https://github.com/gonzafg2/quantumssh/issues/109); that bump
is its own ADR (subsidiary to RFC-0003) and is not decided here.
(two-majors bullet).

Copilot AI balanced review requested due to automatic review settings October 28, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: 2b31d379-a3f8-40f7-abe5-1c9b11e9a5a8)

github run

@claude

claude Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

PR Review: ADR-0035 — RustCrypto ml-dsa for the composite host key's ML-DSA-44 half (#174)

Decision: 🟢 Approved
Iteration: Review #9 (9 resolved, 0 open)
Lenses applied: Design decision (docs/adr/0035-ml-dsa-crate-rustcrypto.md)

Executive summary

ADR-0035 selects RustCrypto/ml-dsa as the crate for the ML-DSA-44 half of the ssh-mldsa44-ed25519 composite host key. The document passes all five MANIFIESTO commitments and the operative threat-model rules: the crate is unsafe_code = "forbid", the version rule gates the pin on a verifiable constant-time fix (RustCrypto/signatures#1386), RNG failure fails closed on the pre-auth path, and zeroization residuals are scoped within threat-model §4.3's best-effort boundary. After nine previous review rounds, no open issues remain.

Previous issues

# Issue Status Notes
1 Feature justification incomplete — only pkcs8 drop explained in §2 ✅ a64f2c7 — per-feature rationale added for getrandom and alloc
2 Concrete RNG source not named in §3 ✅ a64f2c7 — getrandom::SysRng via sys_rng feature
3 SysRng fallibility not addressed ✅ Disconnect path added: SSH_DISCONNECT_KEY_EXCHANGE_FAILED, never panic
4 Version rule did not exclude pre-releases ✅ "no -rc, -pre or other pre-release" added to Decision §1
5 ACVP conformance vectors not committed as a Decision item ✅ b820b43 — Decision item 5 (two layers: primitive + external framing)
6 SHAKE zeroization gap not documented ✅ b820b43 — recorded under §Negative, scoped to best-effort per threat-model §4.3
7 sign_deterministic wrong for ACVP vectors (should be sign_internal) ✅ 605636e — corrected to sign_internal/verify_internal
8 #[deprecated] ExpandedSigningKey::from_expanded not noted ✅ 644307a — #[allow(deprecated)] in tests only, with fallback path stated
9 Stale "Two signature majors" / "Four new crates" bullets after ADR-0036 merged ✅ Verified in current diff (587b8fe): "Three new crates", ADR-0036 in Related header, signature 3.0.0 correctly attributed to ed25519-dalek 3.0.0 via ADR-0036

New findings

None. The ADR is internally consistent, cross-referenced correctly against RFC-0012, RFC-0006, RFC-0007, ADR-0019, and ADR-0036, and addresses every material risk identified across nine review rounds.


Reviewed at 587b8fe.

@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 587b8fe510

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gonzafg2
gonzafg2 force-pushed the docs/rfc-0012-composite-host-key-cutover branch from e314a04 to 3af52ee Compare October 28, 2026 22:55
gonzafg2 added a commit that referenced this pull request Oct 28, 2026
…ng state

Codex (App) P1 on #174: ml-dsa's sign_randomized creates rnd, rhopp and
the mask y as plain buffers inside the crate (upstream master
signing.rs:316-329, 397-401); its zeroize feature covers only key
structures. RFC-0012 required 'any signing temporaries' in zeroizing
types, which no caller can guarantee for library internals and which is
stricter than threat-model 4.3 (best-effort erasure via zeroize).

Maintainer decision: the normative rule binds every signing temporary
QuantumSSH's own code creates or holds; crate-internal temporaries fall
under 4.3's best effort and the crate ADR records them as a residual.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 force-pushed the docs/rfc-0012-composite-host-key-cutover branch from 3af52ee to f6b04be Compare October 28, 2026 22:57
gonzafg2 added a commit that referenced this pull request Oct 28, 2026
…ng state

Codex (App) P1 on #174: ml-dsa's sign_randomized creates rnd, rhopp and
the mask y as plain buffers inside the crate (upstream master
signing.rs:316-329, 397-401); its zeroize feature covers only key
structures. RFC-0012 required 'any signing temporaries' in zeroizing
types, which no caller can guarantee for library internals and which is
stricter than threat-model 4.3 (best-effort erasure via zeroize).

Maintainer decision: the normative rule binds every signing temporary
QuantumSSH's own code creates or holds; crate-internal temporaries fall
under 4.3's best effort and the crate ADR records them as a residual.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 28, 2026
…5519 before 0.1.0 (#172)

* docs(rfc): RFC-0012 — cut host authentication over to ssh-mldsa44-ed25519 before 0.1.0

Both RFC-0006 adoption gates have fired: the SSHM WG adopted
draft-ietf-sshm-composite-sigs on 2026-08-22, and OpenSSH 10.6
(2026-10-06) enabled ssh-mldsa44-ed25519 under its final name.

RFC-0012 is the implementation RFC RFC-0006 requires. One decision:
the host-key slot carries exactly ssh-mldsa44-ed25519, replacing
ssh-ed25519 in a single cut-over before the 0.1.0 freeze, with no
release offering both. It excludes ssh-mldsa87-p384 (ECDSA P-384 is on
the zero-legacy floor) and delegates the ML-DSA crate, the ADR-0021
slot-2 supersession and the interop client pin (ADR-0034) to three
subsidiary ADRs.

Also updates the threat model (5.2.3, 6.1, 7, 9) with the gates'
status, moves tracking from the closed #42 to #109, and adds the
host-key item to the phase-2 freeze checklist.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(rfc): RFC-0012 — normative key-material handling; atomic profile/interop landing

Addresses the two Codex findings on #172:

- Reference-level now makes threat-model 4.3 explicit for the composite
  key: seeds, expanded ML-DSA key, Ed25519 key and signing temporaries
  are zeroizing, dropped early, and never in Debug, errors, logs or
  panics.
- Ordering applies RFC-0007 section 2: the profile ADR (ADR-0021 slot 2)
  and the interop-client ADR flip to Accepted inside the implementation
  PR together with the ADR-0020 fixtures and the code; only the crate
  ADR may land earlier.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(threat-model): state RFC-0006's two adoption gates as the §7 trigger

Codex review #2 on #172: the pre-existing wording 'a settled IETF standard' contradicted RFC-0006, whose first gate is SSHM WG adoption, and the -00 status RFC-0012 records.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(rfc): RFC-0012 — list threat-model §1 and §2.3 among host-key restatements

opencode review #3 on #172 surfaced threat-model.md:132 (§2.3, 'Ed25519 by default') while refuting it as a finding; it and the §1 default-profile line (58) also describe the shipped host key, so the implementation PR must update them. Only the list changes; both lines stay as they are until the cut-over lands.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs: split §7 host/user-key residual; cite OpenSSH source for the -cert name

claude-review on #172:

- threat-model §7: the classical-signatures bullet covers host and user
  keys; RFC-0012 closes only the host-key half. The closing sentence now
  says so and records that user keys stay ssh-ed25519 as a separate open
  decision (RFC-0006 Future possibilities).
- RFC-0012: ssh-mldsa44-ed25519-cert is the certificate key type OpenSSH
  10.6 defines (ssh-mldsa-eddsa.c:478, myproposal.h:53 at V_10_6_P1); the
  RFC now cites that source and notes it is an OpenSSH name, not a WG
  registration.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(rfc): RFC-0012 — scope the zeroization rule to first-party signing state

Codex (App) P1 on #174: ml-dsa's sign_randomized creates rnd, rhopp and
the mask y as plain buffers inside the crate (upstream master
signing.rs:316-329, 397-401); its zeroize feature covers only key
structures. RFC-0012 required 'any signing temporaries' in zeroizing
types, which no caller can guarantee for library internals and which is
stricter than threat-model 4.3 (best-effort erasure via zeroize).

Maintainer decision: the normative rule binds every signing temporary
QuantumSSH's own code creates or holds; crate-internal temporaries fall
under 4.3's best effort and the crate ADR records them as a residual.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(rfc): RFC-0012 — re-wrap the Restatements paragraph

Cosmetic, from claude's review #9 on #172: one line ran past the file's
wrap width. No wording change.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(rfc): RFC-0012 — the cut-over closes RFC-0006's migration-window example

RFC-0006 scopes the window to host-key signatures, so the CLAUDE.md and
AGENTS.md example no longer names an open window once the cut-over lands.
The implementation PR replaces or drops it.

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
…ML-DSA-44 half (Proposed)

Subsidiary ADR 1 of RFC-0012 (the dependency layer of RFC-0007 section 2),
paralleling ADR-0019. Chooses RustCrypto ml-dsa (pure Rust, forbid,
from_seed + ctx-aware hedged signing) over libcrux-ml-dsa, aws-lc-rs (no
ctx parameter), fips204 and pqcrypto-mldsa (unmaintained).

Version rule: the first release containing RustCrypto/signatures#1386
(constant-time fixes, merged 2026-06-24, unreleased as of 2026-10-11),
pinned exactly; 0.1.1 is rejected because host-key signing is reachable
before authentication. Stays Proposed until that release exists and
flips to Accepted in the PR that adds the dependency.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit fb682ea)
Signed-off-by: Gonzalo Fleming <[email protected]>
… (sys_rng)

claude-review on #174: the feature list justified only pkcs8, and hedged
signing named no concrete CryptoRng.

- Decision 2 now gives each enabled and dropped feature its own reason
  (rand_core gates sign_randomized; getrandom stays off to keep one OS
  randomness path; alloc is unused by the composite's surface).
- Decision 3 names the RNG: getrandom::SysRng from the workspace's
  existing getrandom 0.4 dependency via its sys_rng feature, which
  implements rand_core 0.10 TryCryptoRng with no new crate (rand_core
  0.10.1 is already in Cargo.lock). Verified end to end with ml-dsa 0.1.1
  and getrandom 0.4.3 in a scratch crate.
- Records the rejected sign_internal path (upstream marks it test-only)
  and a first-party adapter.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit a64f2c7)
Signed-off-by: Gonzalo Fleming <[email protected]>
claude-review round 2 on #174:

- Version rule: the first stable (non-pre-release) ml-dsa release that
  contains RustCrypto/signatures#1386.
- Decision 3: SysRng is fallible, so host-key signing becomes fallible
  (HostKey::sign returns Vec<u8> today, host_key.rs:165); an RNG error
  aborts the key exchange with SSH_DISCONNECT_KEY_EXCHANGE_FAILED, the
  path kex.rs already takes for getrandom failures, and never panics.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 100a423)
Signed-off-by: Gonzalo Fleming <[email protected]>
…e erasure gap

opencode review #3 suggestions on #174 (below its threshold, applied):

- Decision 5: the implementation PR runs NIST ACVP ML-DSA-44 keyGen,
  sigVer and deterministic sigGen vectors (and the LAMPS composite
  vectors where published), as ADR-0019 required for ML-KEM.
- Negative: ml-dsa 0.1.1's zeroize feature does not reach its shake
  dependency (declared default-features = false), so the SHAKE sponge
  state is not erased; recorded as within threat-model 4.3's best-effort
  erasure.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit b820b43)
Signed-off-by: Gonzalo Fleming <[email protected]>
opencode review #4 on #174: ACVP sigGen vectors are defined against
FIPS 204's internal interface, so sign_deterministic (external framing)
cannot reproduce them. Decision 5 now names the calls upstream's own
harness uses at ml-dsa/v0.1.1: from_seed for keyGen, sign_internal for
sigGen (deterministic with zeroed rnd and hedged with the vector's rnd),
verify_internal for sigVer, in tests only. The production framing
(sign_randomized with ctx and the composite M') is covered by the LAMPS
composite vectors where published and end to end by the ADR-0020
OpenSSH interop gate.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 605636e)
Signed-off-by: Gonzalo Fleming <[email protected]>
…CVP harness

opencode review #5 suggestion on #174: the ACVP vectors carry expanded signing keys, loaded through ExpandedSigningKey::from_expanded, which upstream deprecates and wraps in allow(deprecated) in its own harness. Item 5 now records the same test-only use and what happens if upstream gates or removes it.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 644307a)
Signed-off-by: Gonzalo Fleming <[email protected]>
…s a residual

Codex (App) P1 on #174: sign_randomized creates rnd, rhopp and the mask
y as plain buffers inside the crate (upstream master signing.rs:316-329,
397-401); the zeroize feature covers only key structures (646-655).

Per the maintainer's decision, RFC-0012 (#172, 5082d25) now scopes its
normative zeroization rule to first-party signing state and asks the
crate ADR to record crate-internal temporaries as a residual under
threat-model 4.3's best-effort erasure. This records them next to the
existing SHAKE-state residual.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 4116313)
Signed-off-by: Gonzalo Fleming <[email protected]>
…encies

From claude's review #7 on #174: say what the dependencies add rather
than what the lockfile holds. crypto-common has one locked version on
main (0.2.2), so the statement is unchanged in substance.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 34c83f4)
Signed-off-by: Gonzalo Fleming <[email protected]>
ed25519-dalek 3.0.0 brought in signature 3.0.0, and ml-dsa 0.1.1 asks
for signature ^3. The dependency adds three crates, not four, and there
is no second signature major to retire. ADR-0036 joins the Related line.

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>
(cherry picked from commit 587b8fe)
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 changed the base branch from docs/rfc-0012-composite-host-key-cutover to main October 28, 2026 23:00
@gonzafg2
gonzafg2 force-pushed the docs/adr-0035-ml-dsa-crate branch from 587b8fe to d9419e6 Compare October 28, 2026 23:00
@gonzafg2
gonzafg2 merged commit 1d707b2 into main Oct 28, 2026
10 of 11 checks passed
@gonzafg2
gonzafg2 deleted the docs/adr-0035-ml-dsa-crate branch December 1, 2026 20:13
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