Repository navigation
update: the image signature on toyos-crypto's Ed25519; ed25519-dalek is an oracle - #1019
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Review, round 1: #1019 at 269e389 (code 69245a2), stacked on #1016ArchitectureThe image signature now uses the crate. Strictness, checked against RFC 8032 §5.1.3 and §5.1.7 (
|
…is an oracle The owner (2026-10-22): use our own crypto where possible. lib/update verifies with toyos-crypto's strict RFC 8032 Ed25519 in the loader, the updater and the host, and signs with it on the host. ed25519-dalek and the loader's `force-soft` sha2 leave the non-dev graph, and with them the UEFI targets' `curve25519_dalek_backend` cfg. - Signing and a seed's public key are `sign`'s, as signing already was: deriving a public key from a seed handles the secret too. build/ssh, host-only, takes the feature. - The verdicts are verify_strict's on every signature anyone can make and every canonical key. The crate refuses a key whose y is p or more, as RFC 8032 section 5.1.3 requires, where verify_strict accepts it when the point is not small-order. Every key the tree verifies against is one its build minted, which is canonical. `lib/update/tests/ed25519_oracles.rs` holds 2,000 seeded signatures beside RustCrypto and ring, byte for byte, with changed signatures, headers and S + L, and names the encodings where the two verifiers part. - The twelve cases of "Taming the many EdDSAs" (Chalkias et al., 2020) join the crate's differential: every verdict is verify_strict's, and ring's four lenient ones (cases 0, 1, 2 and 11) are pinned. - The loader logs the signature check's counter ticks, which stage 6 asks of each bench. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
…g the owner Review r1 of #1019. The exit asks agreement with verify_strict and with ring; ring accepts four of the twelve speccheck cases verify_strict refuses, so no verifier meets both. That stays the owner's to decide, recorded beside the y >= p difference rather than reworded as done. The loader's verify time on both benches, from the probe boots: 253,975 ticks on the T14 (about 105 us), 122,724 on the AMD bench. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q
269e389 to
9825b99
Compare
|
Response to review r1. The head is 9825b99, rebased onto #1016's e5414b9.
The bench time for the same exit is now recorded: 253,975 counter ticks on the T14 at 2.4192 GHz (about 105 µs), and 122,724 on the AMD bench, which states no counter rate. Suggestions, both taken:
Evidence: https://github.com/ToyOSOrg/evidence/tree/b3e027cb3655b4ffb530ebab66cdd0052d72d31c/pr-1019/r1 Host CI ran at the stack's head (c195cf5): exit 0, 93 steps. |
Review, round 2: #1019 at 9825b99 (rebased onto #1016's e5414b9)Round 1's one required item is resolved. Stage 6's exit ( The range-diff against round 1 shows that the code commits differ only by the rebase. New since round 1:
LAND |
Problem
The owner asked (2026-10-22) for the tree's own crypto wherever possible. The image signature still verified with
ed25519-dalek'sverify_strictin the loader,/system/bin/updateand the host, and signed with it on the host. In the soft-float loader,ed25519-dalekalso neededsha2builtforce-soft, and the UEFI targets setcurve25519_dalek_backendfor it.Change
lib/updateverifies withtoyos-crypto's strict RFC 8032 Ed25519 everywhere. It signs with it on the host, and derives a seed's public key with it there too.sign, as signing already was, because deriving a public key handles the seed.build/sshis host-only and enables the feature.ed25519-dalek2.2.0 is now only a dev-dependency (an oracle). The loader'ssha2dependency and the UEFI targets'curve25519_dalek_backendcfg are gone. The loader's graph has nodalekand nosha2.verify_stricton every signature anyone can make and on every canonical key.verify_strictaccepts such a key when the point is not small-order.lib/update/tests/ed25519_oracles.rsnames the encodings where the two differ, and asserts that the difference is real.ed25519_oracles.rschecks 2,000 seeded seeds and headers against RustCrypto and ring:NOTICEandCOMMITTED_FILES, and run in the crate's differential.verify_strict's.verify_strictand ring. No verifier can meet both, and the issue records this as the owner's to decide.Checks
cargo run -- --ci hostat 69245a2: exit 0, 93 steps green.cargo test -p toyos-update --features sign: all pass, including the RFC 8032 vectors and the OpenSSH-signedsshsig_oracle.sig::verifymade to accept every signature turnssignatures_and_verdicts_match_dalek_and_ringred (exit 101). It was reverted in the same run.cargo run -- --build-onlyfor x86-64 and for AArch64, exit 0.a_bent_supervisor_is_refused_and_the_other_slot_bootspasses on QEMU's x86-64 and AArch64 machines. The loader verifies the slots' signatures with the crate. The AArch64 guest's loader logs the timing line; the x86-64 guest's kernel shows slot A verified before its hash was refused.sourcegate's committed-file check pass.Evidence: https://github.com/ToyOSOrg/evidence/tree/7ef01c1c4a717032f79a0fbace333940e88de66a/pr-1019
Bench readings
The loader's verification time, stage 6's last exit, from the probe boots that timed #1016's SHA-256:
Evidence for review r1: https://github.com/ToyOSOrg/evidence/tree/b3e027cb3655b4ffb530ebab66cdd0052d72d31c/pr-1019/r1
🤖 Generated with Claude Code
https://claude.ai/code/session_01PXEk8BBMDT8tXu4AnENB9Q