Fast Cryptographic Code via Partial Evaluation
summary
Generates mechanically verified, high-performance cryptographic C from Coq: a verified compiler using partial evaluation, abstract interpretation and normalization-by-evaluation specializes generic modular-arithmetic code to a prime and digit layout and produces C that is 5–10× faster than a generic multiprecision baseline on 64-bit x86. Tooling includes Rupicola for C-like extraction, Bedrock2 for low-level proofs, and a verified x86 validator that checks assembly found by a genetic search; on recent Intel CPUs the search yields new world‑champion implementations.
AI-written summary · about
chapters (27)
- 0:00Intro
- 2:35Outline
- 3:05Web Browsing with SSL Web Server
- 8:05We introduced Fiat Cryptography. Parameters
- 8:57Wide Adoption
- 9:33Correct-by-Construction Cryptography
- 11:57Generated Code
- 12:48Surprising (?) Fact About Modular Arithmetic
- 16:43The Basic Idea
- 17:49Example: Multiplication (for modulus 2127 - 1)
- 22:04Compiling to Low-Level Code
- 23:42Implementation and Experiments
- 24:57Many-Primes Experiment
- 27:32P-256 Mixed Addition
- 28:53Adoption?
- 31:44Did Formal Methods Make a Big Difference?
- 37:42Not all sunshine & roses....
- 38:53Proof by Reflection
- 40:27What is the generic reducer doing?
- 42:27Parametric Higher-Order Abstract Syntax (PHOAS)
- 42:46Normalization by Evaluation (more detail)
- 43:26Not quite outputting plain expressions....
- 45:54Hoare Logic Reordered
- 46:52Rupicola Architecture
- 47:57Rupicola Compilation Example
- 51:02CryptOpt Architecture
- 52:53A Minimal Equivalence Checker
related talks
19mCryptOpt: Verified Compilation with Randomized Program Search for Cryptographic Primitives
29mVale: Verifying High-Performance Cryptographic Assembly Code
59mCoq to C Translation with Partial Evaluation + Counterexample Generation
01h 04mSoftware Verification meets Real-World Cryptography
24mFormally Verified Native Code Generation in an Effectful JIT: Turning the CompCe...
20mFoundational Integration Verification of a Cryptographic Server
24mA CompCert Compiler that Preserves Cryptographic Constant-time
01h 25mIntroduction to Verifiable Computing
