proofs.rs

Report #2 — Exact 64-bit FNV-1a state updates in the fnv 1.0.7 verification fork

creusot 0.13.0

4 verified claims · 0 findings

Recorded by the author; proofs.rs has not re-run it. How to read a report

nyuichi · 2026-09-25 04:32 UTC

Revision v2 · v1

Overview

For every byte slice and every initial u64 state, FnvHasher::write in the fnv 1.0.7 verification fork processes all bytes in order: XOR the next byte into the state, then multiply by 0x100000001b3 modulo 2^64. Empty input leaves the state unchanged. Each call starts from the previous state, so consecutive writes continue the same byte-by-byte computation.

FnvHasher::default starts at 0xcbf29ce484222325; with_key(k) starts at k; finish returns the current state without changing it. These four methods pass arithmetic, indexing and panic-freedom checks under the verifier's core-operation models, without an input-length bound from a test harness. The result applies to the verification fork's index-based loop, with default features disabled on macOS aarch64. It is not a direct proof of the unmodified crates.io implementation.

Findings (0)

No findings reported.

APIs (4)

Associated functions

impl FnvHasher

pub fn with_key(key: u64) -> FnvHasher

Trait implementations

impl core::default::Default for FnvHasher

pub fn default() -> FnvHasher

impl core::hash::Hasher for FnvHasher

pub fn finish(self: &Self) -> u64
pub fn write(self: &mut Self, bytes: &[u8])

Evidence

https://github.com/nyuichi/rust-crate-proofs/tree/c8d9dc13e4608bf09b104e6472bd8544353738d3

Reproduce

Toolchain source metadata: not recorded.

Run locally

git clone -- https://github.com/nyuichi/rust-crate-proofs report-2-source-1
git -C report-2-source-1 checkout --detach c8d9dc13e4608bf09b104e6472bd8544353738d3
git -C report-2-source-1 submodule update --init --recursive --checkout
cd report-2-source-1/fnv/1.0.7

cargo creusot --no-cache -- --no-default-features

Checks out the recorded source commit from GitHub. Install the report’s tool version before running.

Source on GitHub · SARIF with logs (.json)

Recorded run

Completed · 6 checks passed · 0 failed

2026-09-25T04:28:11.932384+00:00 · 29.8 seconds · Exit code 0

Recorded on the author’s machine.

CheckResultClaim
vc_default_FnvHasher
fnv::<FnvHasher as core::default::Default>::default
fnv/1.0.7/lib.rs:163
PassedClaim #1
vc_with_key
fnv::FnvHasher::with_key
fnv/1.0.7/lib.rs:171
PassedClaim #2
vc_finish_FnvHasher
fnv::<FnvHasher as core::hash::Hasher>::finish
fnv/1.0.7/lib.rs:181
PassedClaim #3
vc_len_u8
fnv::<FnvHasher as core::hash::Hasher>::write
fnv/1.0.7/lib.rs:187
PassedClaim #4
vc_wrapping_mul
fnv::<FnvHasher as core::hash::Hasher>::write
fnv/1.0.7/lib.rs:187
PassedClaim #4
vc_write_FnvHasher
fnv::<FnvHasher as core::hash::Hasher>::write
fnv/1.0.7/lib.rs:187
PassedClaim #4
Execution details
Started
2026-09-25T04:28:11.932384+00:00
Finished
2026-09-25T04:28:41.752015+00:00
Platform
macos aarch64
Rust compiler
rustc 1.98.0-nightly (91fe22da8 2026-06-21) binary: rustc commit-hash: 91fe22da8084a1c9e993d78d4a56f22ab8396236 commit-date: 2026-06-21 host: aarch64-apple-darwin release: 1.98.0-nightly LLVM version: 22.1.7
Working directory
fnv/1.0.7
Environment overrides
None recorded
Git repository
https://github.com/nyuichi/rust-crate-proofs
Git commit
c8d9dc13e4608bf09b104e6472bd8544353738d3
Diagnostics & logs
=== stdout ===
Proved (8 files) ✔

=== stderr ===
warning: Cargo.toml: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024`
warning: `fnv` (manifest) generated 1 warning
   Compiling proc-macro2 v1.0.106
   Compiling quote v1.0.46
   Compiling libc v0.2.189
   Compiling unicode-ident v1.0.24
   Compiling getrandom v0.4.3
   Compiling cfg-if v1.0.5
   Compiling syn v2.0.119
   Compiling uuid v1.26.1
   Compiling pearlite-syn v0.13.0
   Compiling creusot-std-proc v0.13.0
    Checking creusot-std v0.13.0
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"std"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"compiler_builtins"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"libc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"miniz_oxide"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"adler2"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"hashbrown"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"std_detect"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"rustc_demangle"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"cfg_if"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"addr2line"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"gimli"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"object"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"memchr"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"panic_unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:27Z WARN  creusot::metadata] could not read metadata for crate `"creusot_std_proc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
    Checking fnv v1.0.7 (./fnv/1.0.7)
[2026-09-25T04:28:31Z WARN  creusot::metadata] could not read metadata for crate `"core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"std"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"compiler_builtins"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"libc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_core"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"miniz_oxide"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"adler2"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"hashbrown"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"rustc_std_workspace_alloc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"std_detect"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"rustc_demangle"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"cfg_if"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"addr2line"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"gimli"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"object"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"memchr"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"panic_unwind"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[2026-09-25T04:28:32Z WARN  creusot::metadata] could not read metadata for crate `"creusot_std_proc"`: Os { code: 2, kind: NotFound, message: "No such file or directory" }
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 20.06s
Environment

macOS aarch64; --no-default-features; Rust nightly-2026-06-22 (91fe22da8). Creusot 0.13.0 at upstream commit 318615be3b8bbc60d1f6d52469ba5c0bdebed4f1; creusot-std =0.13.0. Why3 54c92f96bb0711d6e991c18f10bfbc08d90d028b, why3find eab37557d3e24e1913a3c4f44bc5528ef497c6c9, Z3 4.16.0 and CVC5 1.3.1. Source: c8d9dc13e4608bf09b104e6472bd8544353738d3, fnv/1.0.7. The attached 2026-09-25 SARIF records cargo creusot --no-cache -- --no-default-features and successful proof sessions. This revision reuses the recorded evidence without rerunning verification.

What is trusted

The four methods contain no local trusted implementation bodies. Their guarantees rely on Creusot's core-operation specifications, including slice access, bitwise XOR and wrapping multiplication, and on the verifier and solvers interpreting those specifications correctly. These library models are assumptions, not proofs of the Rust standard library.

Technical limitations

The fork replaces the upstream iterator loop with an index-based while loop and adds the FNV recurrence and loop invariants. The XOR and wrapping-multiply operations are retained, but this recording does not establish formal equivalence to the published release. It covers --no-default-features, not the std feature or the HashMap, HashSet and BuildHasherDefault implementations behind the crate's type aliases. Exact FNV-1a output does not establish collision resistance or resistance to adversarial hash-table inputs. Machine-readable claims remain panic_contract; the exact state behavior is supported by the source postconditions and recorded proofs.

Tool limitations

Verification is relative to the supplied specifications and trusted contracts. Results apply to the compilation target used for verification. The standard-library specifications do not exclude all panics: Vec capacity overflow in operations such as push, insert, and extend is not ruled out, including for vectors of zero-sized types. Out-of-memory failures are also outside the guarantees. The standard vec! macro is unsupported; verified code must use the Creusot replacement where needed. Reference: https://github.com/creusot-rs/creusot/blob/v0.13.0/guide/src/limitations.md

Updated 2026-09-24 05:03 UTC

creusot 0.13.0 — version details

Dependencies (0)

No direct dependencies.

Comments (0)

No comments.

Sign in to comment.