Cryptographic, math, and data-parsing primitives formally proven in Lean 4.
Lean Toolchain provides a collection of formally verified cryptographic algorithms, mathematical operations, and data parsing utilities. All implementations are proven correct in Lean 4 and can be extracted to high-performance Rust code.
- Formally Verified: All algorithms come with mathematical proofs of correctness
- High Performance: Extracted Rust code matches or exceeds industry standards
- Comprehensive: SHA-256, HMAC, linear algebra, CSV/JSON parsing
- Developer Friendly: Clear documentation, examples, and contribution guidelines
# Clone the repository
git clone https://github.com/SentinelOps-CI/lean-toolchain.git
cd lean-toolchain
# Build the project
lake build
# Run tests
lake testimport LeanToolchain.Crypto.SHA256
import LeanToolchain.Math.Vector
-- SHA-256 hashing
#eval sha256 "hello world"
-- Vector operations
#eval Vec.cons 1 (Vec.cons 2 Vec.nil)lean-toolchain/
├── LeanToolchain/ # Main library
│ ├── Crypto/ # Cryptographic primitives
│ ├── Math/ # Mathematical operations
│ └── Data/ # Data parsing utilities
├── docs/ # Documentation
├── bench/ # Benchmarks
└── scripts/ # Build and release scripts
lake test# Install mkdocs-material
pip install mkdocs-material
# Build docs
mkdocs buildWe welcome contributions! Please see our Contributing Guide and Development Documentation for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Lean 4 - The theorem prover and programming language
- RustCrypto - For reference implementations
- NIST - For cryptographic test vectors