Skip to content

Functional leakage invariants, and case on its own line - #26

Merged
kristinas merged 2 commits into
mainfrom
kristina-cache
Nov 3, 2026
Merged

kristinas merged 2 commits into
mainfrom
kristina-cache

Conversation

@kristinas

Copy link
Copy Markdown
Contributor

Follows #25. Two commits:

  1. Make the leakage invariants functional, and state that they are.
    • The core's simulator keeps only the memory access of the instruction in its memory stage (SimMemAccess: SimNoAccess, SimLoad size addr, SimStore size addr), the only part of its leak that stage uses. It behaves as before.
    • simInv now requires the simulator's memory access to be the one the core's memory stage determines, and its control lines to be at rest (simInitCtrl).
    • New properties: simInvFunctional (two simulators related to the same system are equal), srvSimInvFunctional and cachedSimInvFunctional (two simulators related to the same server, or to the same cached system, agree at the witness set). They are checked in the three leakage Solvers and in Spec.hs.
  2. Put a case that is a definition's body on its own line. Layout only, across src/, proof/ and test/.

Verification

  • stack test without the solver: 164 of 164. Every solver module type-checks.
  • The solver run of the three leakage Solvers is in progress locally; CI runs the full build with the solver.

🤖 Generated with Claude Code

kristinas and others added 2 commits November 3, 2026 12:25
The core's simulator invariant left parts of the simulator open: its control
lines, and in its memory stage the whole leak of the instruction, of which
the stage only uses whether it loads or stores, at what size and address.
The memory stage now keeps just that (SimMemAccess: SimNoAccess, SimLoad,
SimStore; the field is simStateMeAccess), and simInv pins it to the core's
memory stage and the control lines to simInitCtrl, where every cycle leaves
them. The simulator behaves as before.

New properties: the three leakage invariants are functional. simInvFunctional
(two simulators related to the same system are equal), srvSimInvFunctional
and cachedSimInvFunctional (two simulators related to the same server or
cached system agree at the witness set). Their solver checks are added to the
three leakage Solvers and to Spec.hs.

stack test without the solver passes: 164 of 164; the three leakage Solvers
type-check. The solver run is still to come.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A definition (or let or where binding) whose body is a case now reads

  f x =
    case x of
      A -> ...

instead of starting the case after the =, as most of the code already did.
Layout only, across src/, proof/ and test/; one-line cases stay as they are.

stack test without the solver passes: 164 of 164; every solver module
type-checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kristinas
kristinas merged commit 3b27cea into main Nov 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant