Repository navigation
sshserver: russh's p384 on its own bignum backend, host and guest, so no fiat-crypto compiles in - #1005
Conversation
…compiles in The owner ruled on 2026-10-21 that ToyOS takes fiat-crypto as a dependency of no kind. russh's `p384` 0.14.0-rc.8 depends on `fiat-crypto` 0.3.0 unless `cfg(p384_backend = "bignum")` is set (`[target.'cfg(not(p384_backend = "bignum"))'.dependencies]`), and nothing set it, so fiat's P-384 arithmetic was compiled into sshserver. The guest targets now set it, as the UEFI targets already set `curve25519_dalek_backend`. sshserver is the only guest crate that reaches `p384`, and the setting goes with russh at stage 2 of the SSH track, whose exit now says so. `Cargo.lock` still lists fiat-crypto: the lock records every optional target dependency whether or not a build selects it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #1005, round 1 (head 57ea881)ArchitectureThe approach fits. The change does not finish the job, though. It covers only the two guest triples, while ToyOS's own gate still compiles sshserver, and so fiat, for every host. Constant time. On the bignum backend,
Point arithmetic and scalar multiplication come from What actually changes is functional-correctness assurance. Upstream calls fiat "formally verified" and bignum "experimental ... might also have bugs" ( Who uses P-384 in sshserver.
Findings
Verified, no finding
SEND BACK |
…ecorded Review r1 of #1005. `--ci host` compiled sshserver, and so fiat-crypto, for the host test and checked it for Linux and Windows: a build for a triple with no `[target]` table took no flags from the config. `[build] rustflags` is what cargo applies to exactly those builds, and the ToyOS tables, whose flags replace it, carry the cfg as well. The SSH track records the compromise: until stage 2, sshserver's P-384 (client `ecdsa-sha2-nistp384` verification before authentication, and an operator's P-384 host key) runs on the backend upstream calls experimental. The config comment no longer cites the crypto issue, whose record of the ruling lands with #993. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
|
Response to review r1, head 177651f. Evidence: https://github.com/ToyOSOrg/evidence/tree/43e01aa96e4d8fc0d115d08ef827f434fbaebe02/pr-1005/r1
|
…measure russh's `p384` is on its `bignum` backend under #1005, so the fiat record names the dependency as one no guest build selects. The T14's P-256 finding is re-measured on #1000's arithmetic, now on main, with a boot that sets DOITM beside the one that does not. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqpxbTfpvcbx1FJEy3Eny9
#1005 sets `p384_backend = "bignum"` for host and guest builds alike, so the record says that and what held before it, true in either landing order. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
…measure russh's `p384` is on its `bignum` backend under #1005, so the fiat record names the dependency as one no guest build selects. The T14's P-256 finding is re-measured on #1000's arithmetic, now on main, with a boot that sets DOITM beside the one that does not. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqpxbTfpvcbx1FJEy3Eny9
#1005 sets `p384_backend = "bignum"` for host and guest builds alike, so the record says that and what held before it, true in either landing order. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Review of #1005, round 2 (head 177651f)Focused on round 1's four blockers and the new commit, 177651f (+22/−8 across ArchitectureThe fix is now a single flag in two places. Round 1 blockers
New changesThe new comments are accurate and in proportion. I have no new findings. LAND |
Problem
The owner ruled on 2026-10-21 that fiat-crypto is a dependency of no kind. russh's
p3840.14.0-rc.8 depends onfiat-crypto0.3.0 unlesscfg(p384_backend = "bignum")is set:Nothing in the tree set that
cfg. So fiat's P-384 field and scalar arithmetic was compiled intosystem/sshserver: into the guest image, and on every host into--ci host's sshserver test and its Linux, macOS and Windows app builds.Change
.cargo/config.tomlsets--cfg=p384_backend="bignum"in[build] rustflags. Cargo uses those flags for any triple with no[target]table: the host and the host-app triples.[build]'s. This follows the UEFI targets, which already setcurve25519_dalek_backend.p3840.14 (throughrusshandinternal-russh-forked-ssh-key), so the setting goes with russh. The SSH track's stage 2 exit now says.cargo/config.tomlsets nop384_backend.Cargo.lockstill listsfiat-crypto, because a lock records every optional target dependency whether or not a build selects it.toyos-crypto's own fiat dev-dependency goes with #993.Trade-off
Until stage 2, sshserver's P-384 runs on the backend that
p384's documentation calls "experimental ... might also have bugs", where fiat's is formally verified. The SSH track issue records this, with its owner and exit.sshserver uses P-384 in two places:
ecdsa-sha2-nistp384publickey signature, which is untrusted input before authentication.It doesn't negotiate
ecdh-sha2-nistp384, because russh's default order leaves it out.On timing, both backends are constant-time by design for the field and scalar operations, and point arithmetic comes from
primeordereither way (review r1's analysis). Neither is machine-checked for timing.Checks
Guest image,
cargo run -- --build-onlyon main at 27ab916 and at 075db4185, both exit 0:Compiling fiat-crypto v0.3.0, and thex86_64-unknown-toyosp384fingerprint listsfiat_crypto;The guest tables have not changed since.
Host CI,
cargo run -- --ci hostat 177651f: exit 0, 87 steps green.system/sshserverand the apps for Linux, macOS and Windows show no fiat-crypto line. At 075db4185 each of them had one.toyos-crypto, dispatchedandclippy, are main'stoyos-cryptodev-dependency, which toyos-crypto stage 4, the test side: vectors, integer oracle, differential, fuzz, controls, Miri and the constant-time harness #993 removes.Upstream suite,
p3840.14.0-rc.8's own, with its lock aligned to ToyOS's:crypto-bigint0.7.3, and every shared package at ToyOS's version,num-bigint0.3.3 aside, which no build reaches. Under thecfg,cargo test --all-featuresexits 0: 34 + 6 + 11 tests (Wycheproof ECDSA among them) and 2 doctests. The log recordscargo tree -i crypto-bigint.No guest test exercises sshserver's P-384. The change relies on
p384's own suite on that backend.Evidence:
Risks
🤖 Generated with Claude Code
https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q