Repository navigation
New challenge: Safety of the SipHash implementation behind DefaultHasher - #768
Open
DevinWatson wants to merge 2 commits into
Open
DevinWatson wants to merge 2 commits into
DevinWatson wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a challenge for
library/core/src/hash/sip.rs, the SipHash implementation behindSipHasher,SipHasher13andstd::hash::DefaultHasher. The file has oneunsafe fnand sixunsafeblocks that loadbytes from the caller's message at computed offsets; no challenge, harness or open pull request covers
core::hash. The page asks for an unbounded proof (any message length, any reachable hasher state), a statedtype invariant, and the correctness of the byte buffering. The digest value is left unspecified on purpose, and
the page says so.
Tracking issue: #767
I will renumber the page if another proposal merges first.
Disclosure. Before opening this proposal I prepared a solution privately, with AI assistance, and checked it with
the tools and versions pinned on
main(Rust nightly-2026-10-23, Kani c5e65fdfc3e15ec32293f2a4c07509aebec033c9, the flags ofscripts/run-kani.sh). Figures from that run: 20 harnesses, slowest 100 s,total 593 s of verification time, no unwind attribute, one over-approximating stub (the mixing rounds replaced by an arbitrary state in the Sip24 write proofs; the Sip13 write proof runs with the real rounds), no change to a function body.
Known limits of that solution: message length capped at 2^51 - 1 bytes by the CBMC object model; the digest value is not specified, so seeded faults that only change the mixing state are not caught (4 of 18 tested mutants);
write_stris proved at symbolic length for one string content, with content generality coming from thewriteproof. I intend to submit it once the challenge is published. I am not relatedto any committee member. If the committee decides on a proposer window, a proposer share or a review duty in
#751, I will follow that decision, and I am glad to adjust the criteria in any direction the committee prefers,
including making them harder than my solution meets.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.