Repository navigation
fix(attestation): hash evidence counts as u64 on every platform - #262
hyperpolymath wants to merge 1 commit into
Conversation
The evidence hash fed files_read to SHA-256 as usize::to_le_bytes, so a 32-bit build hashed 4 bytes where a 64-bit build hashed 8, and the same scan produced different evidence hashes. files_read is now widened to u64 like bytes_read and wall_clock_ms. On 64-bit platforms the bytes, and so every existing hash, are unchanged. The computation moves to a pub evidence_hash function with a known-answer test whose expected value comes from coreutils sha256sum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFaqv6iBXrt3W5Akd1Fq5k
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|



Closes the "
evidence_hashhashesusize::to_le_bytes" follow-up from #247.Problem
EvidenceAccumulator::finalizefedfiles_readto SHA-256 asusize::to_le_bytes. A 32-bit build hashed 4 bytes where a 64-bit build hashed 8, so the same scan produced different evidence hashes on different platforms, and a verifier on another platform couldn't recompute them.Fix
files_readis widened tou64before hashing, likebytes_readandwall_clock_msalready are.attestation::evidence::evidence_hashfunction, so a verifier can recompute it, and the doc comment now states the encoding.Validation
evidence_hash_known_answer. The expected value comes from coreutils, not the crate:cargo fmt --check, pluscargo clippy --locked --all-targets -D warningswith and without--all-features: clean.cargo test --locked --all-features: all suites green (lib: 524 passed).Generated by Claude Code