Repository navigation
AArch64 vg_x25519_base: wipe only the 1024 bytes of scratch it writes - #2608
Merged
Merged
Conversation
The comb's frame keeps the stack below 1024 bytes of scratch, so the
artifact states written := [("scratch", 1024)], proven from
x25519Base_correct's frame of the scratch's tail, and base() wipes only
VG_X25519_BASE_SCRATCH_WRITTEN bytes on AArch64 instead of 8 KiB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ma2fA9rUTPXEEQjYyCMCRw
alex
force-pushed
the
claude/a64-x25519-base-written
branch
from
October 17, 2026 16:53
05591f1 to
199e955
Compare
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.
Part of #991. Stacked on #2606.
This is the first registration to use
Artifact.written(#2568). On AArch64,vg_x25519_basewrites only the first 1024 bytes of its 8 KiBscratch. Its artifact now says so withwritten := [("scratch", 1024)], and the emitter exportsVG_X25519_BASE_SCRATCH_WRITTEN.x25519::base()then wipes just those bytes, where it used to wipe all 8 KiB. That saves about 80 ns ofvg_zeroizeper call on N2, about 1% ofx25519_base.Other targets still wipe the whole buffer.
Changes
x25519Base_correct(Proof/X25519/AArch64/Base/Main.lean) gains aScratchTailconjunct: whenoutandscratchare disjoint, no byte ofscratchat offset 1024..8191 changes.Outsideframes of the comb, the inversion and the final stores, throughoutside_tail.x25519Base_written(Base/Verified.lean) turns this intoSig.writtenWithinfrom the contract's precondition, usingExec.det.writtenandwrittenOkonly; no tactics.base()wipesVG_X25519_BASE_SCRATCH_WRITTENbytes. Every other target keepssize_of::<[u64; 1024]>(). Each cfg arm runs on its own platform, so coverage is unchanged.No changes to
TCB/orSpec/.Testing
Emit.lean --checkpasses, with the audits.check_lean_imports,check_lean_modules,check_registrations,check_lean_speed,check_variants,check_arch_gatesandcheck_mcdtall pass.cargo fmt --checkand clippy pass on x86-64 and aarch64.Generated by Claude Code