[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"CGZsXdFBvb":3},"# CatCrypt Core\n\n> 🚧 **Under active development.** CatCrypt is still evolving rapidly — APIs,\n> module organization, and dependencies may change between releases.\n\nThe core of CatCrypt: machine-checked foundations for game-based\ncryptographic security proofs in Lean 4 — sub-distributions, a\nstateful-probabilistic program monad, probabilistic relational Hoare\nlogic, state-separated packages, proof automation, forking lemmas, and\nMontgomery-curve mathematics.\n\n📖 **Documentation:** [hosted API reference](https://spitters.github.io/CatCrypt-core/) ·\n[design & influences](DESIGN.md)\n\nThis is the **minimal-basis release**. The universal-composability theory,\nconcurrent UC, quantum verification, the verified compilation pipeline, and\nthe full catalogue of concrete protocols live in separate, larger\ndistributions.\n\nModule names live under the `CatCryptCore.*` root (single entry point:\n`import CatCryptCore`), so the library coexists with any package that has its\nown `CatCrypt.*` module tree. Declared *namespaces* are `CatCrypt.*`:\n`open CatCrypt.Core`, `CatCrypt.Core.SPComp`, etc. Paths in the table below\nare relative to `CatCryptCore/`.\n\n## Contents\n\n| Layer | Modules |\n|---|---|\n| Probability | `Prob/*` — sub-distributions, couplings, support, birthday bound, Schwartz–Zippel |\n| Core | `Core/*` — typed heap, `SPComp` stateful-probabilistic monad, `SPTree` syntactic trees |\n| Relational | `Relational/*` — pRHL judgment, sync/frame/reorder rules |\n| Package | `Package/*` — interface-based package algebra |\n| Category | `Category/*` — Kleisli of SPComp, family bicategory, cocartesian / affine structure |\n| Deep embedding | `Deep/*` — syntactic package calculus with semantic evaluation, `SPComp` → `RawCode` reflection |\n| Bridge | `Bridge/*` — deep-to-shallow semantic bridge |\n| Tactics | `Tactics/*` — pRHL automation (sync, invariant, WP/SP, ProofFrog, lazy sampling, remember/forget, triangle chaining, …) |\n| Crypto foundation | `Crypto/{Game,Advantage,SDist,SecurityDefs,Encryption,HybridArgument,NomAdvantage}.lean` |\n| Forking | `Crypto/ForkingLemma.lean`, `Crypto/GeneralForkingLemma.lean` — Pointcheval–Stern and Bellare–Neven |\n| Up-to-bad | `Crypto/BadEvent.lean` — identical-until-bad / fundamental lemma of game-playing, bad-event union bounds, hybrid + up-to-bad, and lazy/eager sampling (`Tactics/UpToBad.lean` drives it) |\n| Assumptions | `Crypto/Assumptions/*` — DDH, CDH, GapDH, DL, t-SDH, q-SDH, CoCDH, ODH, CR, OWF, PRP, RSA, AEAD, MAC |\n| Curve math | `Crypto/KeyAgreement/{MontgomeryLadder,MontgomeryAsWeierstrass,MontgomeryXOnly,Curve25519}.lean` |\n\n## Build\n\nSee [BUILDING.md](BUILDING.md) for building the library and the documentation.\n\n## Dependencies\n\nPinned in `lakefile.lean` and `lake-manifest.json`:\n\n- [Mathlib](https://github.com/leanprover-community/mathlib4) `v4.30.0`\n- [nominal-lean](https://github.com/spitters/nominal-lean) — the nominal-sets layer (`Nominal/`)\n\n## Documentation\n\n- **API reference:** [doc-gen4](https://spitters.github.io/CatCrypt-core/)\n- **Design and influences:** [DESIGN.md](DESIGN.md) ·\n  **Changelog:** [CHANGELOG.md](CHANGELOG.md) ·\n  **Contributing:** [CONTRIBUTING.md](CONTRIBUTING.md)\n\nTo build the manual or the API reference locally, see [BUILDING.md](BUILDING.md).\n\n## Relation to SSProve\n\nThe program logic, package algebra, and the `ssprove_*` tactic family port\nthe design of [SSProve](https://github.com/SSProve/ssprove), the Coq/Rocq\nframework for modular cryptographic proofs:\n\n> P. G. Haselwarter, E. Rivas, A. Van Muylder, T. Winterhalter, C. Abate,\n> N. Sidorenco, C. Hriţcu, K. Maillard, B. Spitters.\n> *SSProve: A Foundational Framework for Modular Cryptographic Proofs in Coq.*\n> ACM Transactions on Programming Languages and Systems 45(3), 2023.\n> [doi:10.1145/3594735](https://doi.org/10.1145/3594735)\n\n## Related projects\n\n- [hax-lean](https://github.com/spitters/hax-lean) — a partially verified version\n  of [hax](https://github.com/hacspec/hax), a tool for high-assurance translation of\n  a large subset of Rust into formal languages.\n\n## Citing\n\nSee `CITATION.cff`. The accompanying paper:\n\n> B. Spitters. *CatCrypt: From Rust to Cryptographic Security in Lean.*\n> Cryptology ePrint Archive, Paper 2026/604.\n> \u003Chttps://eprint.iacr.org/2026/604.pdf>\n\n## License\n\nMIT. See `LICENSE`.\n",1784995021354]