Add Lean (Aeneas) extraction of the crypto core - #3
Open
karthikbhargavan wants to merge 1 commit into
Open
Conversation
A third extraction lane alongside F* and ProVerif: a functional-model lifting of the SD-APKE / SD-PKE / Ed25519 crypto core to Lean 4 via the hax aeneas-lean backend (rustc -> charon -> aeneas). - proofs/proverif/hax.py `extract-lean`: runs `cargo hax into aeneas-lean` over the crypto-core `--start-from` set (mirrors the ProVerif targets), injecting a dev hax-lib (pending cryspen/hax#2069 + #2071) via a temporary [patch.crates-io] and restoring Cargo.toml/lock afterwards. - Source: aeneas can't yet translate the `&'static` domain tags, `tagged_preimage`, or the `decrypt_with_sender` trial-decrypt loop, so these are made opaque for the Lean backend only via `#[cfg_attr(hax_backend_lean, hax_lib::opaque)]` — F* and normal builds are unaffected (verified with `cargo check`). `cfg(hax_backend_lean)` added to the workspace check-cfg allowlist. - Snapshot of the generated Lean committed under proofs/aeneas-lean/ (llbc/ and the aeneas error log git-ignored); see its README for the toolchain pins and the upstream aeneas limitations (AeneasVerif/aeneas#392, #464). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds a Lean 4 (Aeneas) extraction of the crypto core, alongside the existing F* and ProVerif lanes — a third, independent lifting of the same Rust via the hax
aeneas-leanbackend (rustc → charon → aeneas).What extracts
The driver mirrors the ProVerif target set. Translated to Lean
defs:message::auth_enc/auth_dec(SD-APKE),metadata::encrypt/decrypt(SD-PKE)sign::sign/verify(Ed25519),encrypt_decrypt::encrypt/decrypt~5k lines of Lean, committed as a snapshot under
proofs/aeneas-lean/.Opaque for the Lean backend only
Aeneas can't yet translate a few constructs, so they're made opaque for the Lean backend only, via
#[cfg_attr(hax_backend_lean, hax_lib::opaque)]— F* and normal builds are unaffected (cargo checkclean):DomainTag::tag&'static [u8]→ "no bottoms in the value"tagged_preimageVecopsdecrypt_with_senderVec<&MessageKeyBundle>Running
Injects the dev hax-lib via a temporary
[patch.crates-io](restored afterwards), so the committed manifest stays on crates.iohax-lib 0.3.7.Depends on (upstream, not yet merged)
Both are injected at extraction time; nothing here changes the F*/ProVerif lanes or normal builds:
into aeneas-leansets target-side--cfg haxsocfg(hax)-gated deps (libcrux) compile under charon.hax_lib::opaque/excludeemit charon's native attributes, enabling thehax_backend_leanmarkers above.Stacked on #2 (ProVerif lane) since it extends the shared
proofs/proverif/hax.py. Seeproofs/aeneas-lean/README.mdfor details.