Repository navigation
PPC64LE: vg_chacha20_poly1305_open_to sharing open's body, and decrypt on PPC64LE - #4427
Merged
Merged
Conversation
Base automatically changed from
claude/determined-gates-p7sa7b-ppc64le-xor
to
main
November 7, 2026 10:19
reaperhulk
force-pushed
the
claude/determined-gates-p7sa7b-ppc64le-open-to
branch
from
November 7, 2026 10:19
b6e372e to
47c1ad4
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 7, 2026
|
This pull request has conflicts with Posted by |
…t on PPC64LE As on RISC-V (#4384): one body serves open and open_to. It reads the source at r7 and writes the destination it finds in r11 at entry, kept in r31 (nonvolatile, saved in the context, which no callee touches, so the taint analysis keeps it public across the calls); the working space grows from 81 to 82 doublewords. seal and open run it in place (inPlace, r11 = r7); open_to enters through toEntry, which takes dst from r9, and tag and work from its stack arguments. The proofs are open's, with the destination equal to or apart from the source (APre.alias), and one relational constant-time proof of the body (open_rel) that both entries use. open_to's working space is wiped after the code: Verified.stackScratchArgsWiped (Proof/Framework/PPC64LE/ StackScratchArgsWipe.lean), PPC64LE's counterpart of RISC-V's. ChaCha20Poly1305::decrypt, its tests and its benchmark now also on little-endian PPC64. No change to TCB/ or Spec/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWwrECv53ESEcwjcHaU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWwrECv53ESEcwjcHaU
reaperhulk
force-pushed
the
claude/determined-gates-p7sa7b-ppc64le-open-to
branch
from
November 7, 2026 10:46
47c1ad4 to
c82b628
Compare
This was referenced Nov 7, 2026
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.
This PR is stacked on #4424, the PPC64LE src/dst ChaCha20 kernel. It is the PPC64LE counterpart of #4384: out-of-place ChaCha20-Poly1305 decryption without a copy. No change to
TCB/orSpec/.Design: one body for
openandopen_toThe decryption code exists once;
openandopen_todiffer only in a short entry block.r7and writes the destination it finds inr11at entry.moveskeeps the destination inr31.r31is nonvolatile and saved in the context, and no callee touches it, so the taint analysis keeps it public across the calls.r30was ruled out becausevg_chacha20_xorreloads it from memory.cryptpassesr7 := r31to the kernel, from source to destination.zeroDatazeroes fromr31.r24–r29andr31, plus LR atsavOff + 56. The working space grows from 81 to 82 doublewords (656 bytes).sealandopenrun the body afterinPlace, which ismr r11, r7. Their frames stay at 688 bytes, and the stack at 848.seal_gather'ssealCodechanges the same way.vg_chacha20_poly1305_open_toruns the body aftertoEntry.toEntrytakesdstfromr9, andtagandworkfrom the stack argumentswithStackScratchArgslays out atr1+96andr1+104. Its frame iswithStackScratchArgsWiped 768 1 82, and its stack is 928.Proofs
APrenow takes membership facts, withop/oRandalias.Inv.frameis over the context, the destination and the stack below.crypt_okgoes through the kernel'sxor_call_to.zeroData_ok,body_okandopen_correctare stated at the destination (CorePost).open_relis one relational proof of the body, which both entries use:open_ct/seal_cton theinPlacecode, andopenTo_ctaftertoEntry.open_to.toEntry_ok,apre_openToandopenTo_okcover the entry and its correctness.openTo_verifiedis the bridge toopenToScratchContract PPC64LE.abi 82 160.openTo_framedgives the frame.Proof/Framework/PPC64LE/StackScratchArgsWipe.lean, PPC64LE's counterpart of RISC-V's:wipeFrom_runandVerified.stackScratchArgsWiped, whosehpostOutmay assume the precondition.wipeFromandwithStackScratchArgsWipedare added inImpl/StackScratch/PPC64LE/Args.lean.Rust
ChaCha20Poly1305::decrypt, its unit testdecrypt_out_of_place, the Wycheproof out-of-place check and the benchmark group are now enabled on little-endian PPC64 as well as RISC-V.Checks
lake buildpasses, andEmit.leanpasses along withEmit.lean --check; the emitter changed onlycrates/verified-garbage-asm-powerpc64leChaCha20-Poly1305.check_lean_public_imports.pypasses, and the static checks pass.cargo test --target powerpc64le-unknown-linux-gnupasses with Wycheproof (676 tests), includingdecrypt_out_of_place.cargo fmt --checkand clippy pass, as does clippy for PPC64LE on the library.openssl-sys. CI's lint job covers it.Benchmarks: not run.
seal/opengain onemrand one more saved register each, plus a word to wipe. A scoped manual Benchmarks run (ChaCha20-Poly1305, PPC64LE) should go with this PR; I have not triggered one.Generated by Claude Code