Skip to content

New challenge: Safety of the SipHash implementation behind DefaultHasher - #768

Open
DevinWatson wants to merge 2 commits into
model-checking:mainfrom
DevinWatson:siphash-challenge
Open

DevinWatson wants to merge 2 commits into
model-checking:mainfrom
DevinWatson:siphash-challenge

Conversation

@DevinWatson

Copy link
Copy Markdown

This adds a challenge for library/core/src/hash/sip.rs, the SipHash implementation behind SipHasher,
SipHasher13 and std::hash::DefaultHasher. The file has one unsafe fn and six unsafe blocks that load
bytes 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 stated
type 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 of
scripts/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_str is proved at symbolic length for one string content, with content generality coming from the write proof. I intend to submit it once the challenge is published. I am not related
to 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.

@DevinWatson
DevinWatson requested a review from a team as a code owner November 17, 2026 14:16
@feliperodri feliperodri added the Challenge Proposal Used to tag a challenge proposal PR / Issue label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Challenge Proposal Used to tag a challenge proposal PR / Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants