Skip to main content

Crate sail_key

Crate sail_key 

Source
Expand description

Content-addressed keys for solver queries.

Two key versions exist:

  • v2, PrefixHasher: the default-mode key (ADR 0008). It binds the mode, the solver identity (including the platform) and every raw byte the solver process received, up to and including the check command.
  • v1, query_key: stack only. It is used for measurement, and is the candidate key for the named opt-in mode (ADR 0010). It is described below.

A v1 QueryKey is a SHA-256 digest that binds:

  • the verification mode, so opt-in modes can never collide with default mode (charter rule 8);
  • the exact solver identity: name, version string and binary hash (rule 2);
  • the complete modelled state at the check: every push level and its commands, every option in effect, set-logic/set-info, and the check command itself (rule 2).

Inputs are length-prefixed before hashing, so distinct inputs cannot produce the same byte stream. No normalization is applied (rule 5). A snapshot the session model could not follow exactly has no key.

Structs§

CommandFrame
Immutable borrow of one actual same-owner command transition. Its key is computed only when requested, without copying the hash for no-output commands.
DeliveredInput
Frozen complete input for one actual solver delivery. This is not yet a clean solver-output or executable-image certificate.
InputDelivery
Independent full-write accounting for one actual solver input pipe. Its closure check binds delivered bytes to the parser session terminal key.
PrefixHasher
The running v2 key of one solver process (ADR 0008).
QueryKey
A content-addressed key for one solver query.
SessionPrefix
One cache session’s jointly owned exact raw transcript and incremental v2 key. Unlike a detached hasher, this API cannot consume another transcript’s feed tokens.
SolverIdentity
The exact identity of a solver binary.

Enums§

Mode
The verification mode a result is produced under.

Functions§

query_key
Derives the key for snapshot under mode on solver, or None if the session model was inexact at that point.
sha256
SHA-256 of a byte string, for solver binary identity and trace digests.