Repository navigation
TCB: a mode a contract may make public (Abi.mode, Abi.withMode) - #4326
Closed
reaperhulk wants to merge 1 commit into
Closed
reaperhulk wants to merge 1 commit into
reaperhulk wants to merge 1 commit into
Conversation
This was referenced Nov 6, 2026
reaperhulk
force-pushed
the
claude/dit-mode
branch
from
November 7, 2026 00:25
f87f7dd to
19b3f36
Compare
`Abi.mode` is the mode the code runs in, on AArch64 PSTATE.DIT, and `A.withMode true` is the calling convention with it public. An `Api` says whether its contracts use it (`pubMode`, false by default), and `Artifact.ofSig` states it: every other artifact's contract is under `A.withMode false`, which is `A`. The structures that restate `ofSig` for variants follow. The Rust code turns data independent timing on for an operation whatever its data, so whether it is on depends on nothing secret; a contract that makes it public lets `vg_dit_enter` skip writing PSTATE.DIT when it is already on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWwnPmAfvKpXDUq9Tjq
reaperhulk
force-pushed
the
claude/dit-mode
branch
from
November 7, 2026 01:11
19b3f36 to
35806e3
Compare
Member
Author
|
Replaced by #4483, which carries this change together with the other DIT TCB change, based on |
An error occurred while trying to automatically change base from
claude/dit-token
to
main
November 8, 2026 16:48
An error occurred while trying to automatically change base from
claude/dit-token
to
main
November 8, 2026 16:49
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.
Trust change (TCB). This is the TCB half of letting
vg_dit_enterskip writing PSTATE.DIT when it is already on. The Spec change (#4327) and the implementation (#4328) are stacked on it. It is stacked on #4210.What changes in
TCB/Abi.mode(TCB/Sig.lean): the mode the code runs in, as a number. On AArch64 it is PSTATE.DIT, 1 or 0 (TCB/AArch64/Target.lean). It defaults to 0 on every other target.Abi.withMode(TCB/Sig.lean):A.withMode trueisAwithpubstrengthened toA.pub s₁ s₂ ∧ A.mode s₁ = A.mode s₂.A.withMode falseisA.Api.pubModeandArtifact.pubMode(TCB/Artifact.lean), both false by default.Artifact.ofSignow states the contract under….withMode pubMode.RegistrationandApi.artifact(TCB/Registration.lean) passpubModefrom theApi.TCB/AArch64/Isa.lean.Why it is sound
Making the mode public only narrows which pairs of runs a contract compares: both runs have DIT on, or both have it off. That is correct because the Rust code (
src/dit.rs) turns DIT on for an operation whatever data it is given, so whether DIT is on depends on nothing secret.What it leaves alone
pubModeis false by default, andA.withMode falsereduces toA, so no existing contract or proof changes meaning. OnlySpec/Dit.leansets it (Spec/Dit: vg_dit_enter's contract makes the mode public #4327).pub. I rejected making PSTATE.DIT public there. That would force every proof composing calls (RelCT,Inline) to carry DIT agreement through its taint analysis, across all AArch64 proofs.Proof-side changes
The four proof structures that restate
ofSigfor variants now say.withMode api.pubMode:Proof/Sha1/X86/Variants/Interface.leanProof/Sha256/X86/Variants/Interface.leanProof/Pbkdf2/Md/{AArch64,X86_64}/Variant.leanTheir instances are unchanged: the default proofs still close them.
Rebased onto main (2026-11-07)
On
main, theArtifactstructure moved fromTCB/Artifact.leanintoTCB/Registration.lean. So theArtifact.pubModefield and the.withMode pubModeinArtifact.ofSigare now there, unchanged in content.Api.pubModestays inTCB/Artifact.lean, inApi. A fulllake buildandEmit.lean --checkat the top of the stack pass.🤖 Generated with Claude Code
https://claude.ai/code/session_015ajQWwnPmAfvKpXDUq9Tjq