HACL*: A Verified Modern Cryptographic Library
Jean Karim Zinzindohoué, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin Beurdouche
Abstract
HACL * is a verified portable C cryptographic library that implements modern cryptographic primitives such as the ChaCha20 and Salsa20 encryption algorithms, Poly1305 and HMAC message authentication, SHA-256 and SHA-512 hash functions, the Curve25519 elliptic curve, and Ed25519 signatures. HACL * is written in the F * programming language and then compiled to readable C code. The F * source code for each cryptographic primitive is verified for memory safety, mitigations against timing side-channels, and functional correctness with respect to a succinct high-level specification of the primitive derived from its published standard. The translation from F * to C preserves these properties and the generated C code can itself be compiled via the CompCert verified C compiler or mainstream compilers like GCC or CLANG. When compiled with GCC on 64-bit platforms, our primitives are as fast as the fastest pure C implementations in OpenSSL and Libsodium, significantly faster than the reference C code in TweetNaCl, and between 1.1x-5.7x slower than the fastest hand-optimized vectorized assembly code in SUPERCOP. HACL * implements the NaCl cryptographic API and can be used as a drop-in replacement for NaCl libraries like Libsodium and TweetNaCl. HACL * provides the cryptographic components for a new mandatory ciphersuite in TLS 1.3 and is being developed as the main cryptographic provider for the miTLS verified implementation. Primitives from HACL * are also being integrated within Mozilla's NSS cryptographic library. Our results show that writing fast, verified, and usable C cryptographic libraries is now practical. THE NEED FOR VERIFIED CRYPTO Cryptographic libraries lie at the heart of the trusted computing base of the Internet, and consequently, they are held to a higher standard of correctness, robustness, and security than other distributed applications. Even minor bugs in cryptographic code typically result in CVEs and software updates. For instance, since 2016, OpenSSL has issued 11 CVEs 1 for bugs in its core cryptographic primitives, including 6 memory safety errors, 3 timing side-channel leaks, and 2 incorrect bignum computations. Such flaws may seem difficult to exploit at first, but as Brumley et al. [24] demonstrated, even an innocuous looking arithmetic bug hiding deep inside an elliptic
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
74 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Vale: Verifying High-Performance Cryptographic Assembly Code cites Verifying Constant-Time Implementations
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider cites Vale: Verifying High-Performance Cryptographic Assembly Code
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider cites Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider cites Implementing and Proving the TLS 1.3 Record Layer
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider cites Jasmin: High-Assurance and High-Speed Cryptography
- SoK: Computer-Aided Cryptography cites Vale: Verifying High-Performance Cryptographic Assembly Code
- SoK: Computer-Aided Cryptography cites EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider
- SoK: Computer-Aided Cryptography cites Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises
- SoK: Computer-Aided Cryptography cites Verifying Constant-Time Implementations
- SoK: Computer-Aided Cryptography cites Implementing and Proving the TLS 1.3 Record Layer
- SoK: Computer-Aided Cryptography cites Jasmin: High-Assurance and High-Speed Cryptography
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises cites Vale: Verifying High-Performance Cryptographic Assembly Code
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises cites Jasmin: High-Assurance and High-Speed Cryptography
- Jasmin: High-Assurance and High-Speed Cryptography cites Vale: Verifying High-Performance Cryptographic Assembly Code
- Jasmin: High-Assurance and High-Speed Cryptography cites Verifying Constant-Time Implementations
Cited by top-tier papers74
- SoK: Computer-Aided CryptographyManuel Barbosa, Gilles Barthe, Karthik Bhargavan, Bruno Blanchet et al.S&P 2021 · 169 citations
- Jasmin: High-Assurance and High-Speed CryptographyJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Arthur Blot et al.CCS 2017 · 157 citations
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without CompromisesAndres Erbsen, Jade Philipoom, Jason Gross, Robert Sloan et al.S&P 2019 · 147 citations
- VRASED: A Verified Hardware/Software Co-Design for Remote AttestationIvan De Oliveira Nunes, Karim Eldefrawy, Norrathep Rattanavipanon, Michael Steiner et al.USENIX Security 2019 · 135 citations
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic ProviderJonathan Protzenko, Bryan Parno, Aymeric Fromherz, Chris Hawblitzel et al.S&P 2020 · 114 citations
Builds on3
- Verifying Constant-Time ImplementationsJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, François Dupressoir et al.USENIX Security 2016 · 274 citations
- Vale: Verifying High-Performance Cryptographic Assembly CodeBarry Bond, Chris Hawblitzel, Manos Kapritsos, K. Rustan M. Leino et al.USENIX Security 2017 · 147 citations
- Implementing and Proving the TLS 1.3 Record LayerAntoine Delignat-Lavaud, Cédric Fournet, Markulf Kohlweiss, Jonathan Protzenko et al.S&P 2017 · 20 citations
Related papers
- HACLxN: Verified Generic SIMD Crypto (for all your favourite platforms)Marina Polubelova, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin Beurdouche et al.CCS 2020 · 17 citations
- The Last Mile: High-Assurance and High-Speed Cryptographic ImplementationsJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Benjamin Grégoire et al.S&P 2020 · 67 citations
- Formally Verified Cryptographic Web Applications in WebAssemblyJonathan Protzenko, Benjamin Beurdouche, Denis Merigoux, Karthikeyan BhargavanS&P 2019 · 36 citations
- Verified Cryptographic Code for EverybodyBrett Boston, Samuel Breese, Joey Dodds, Mike Dodds et al.CAV 2021 · 7 citations
- CryptOpt: Verified Compilation with Randomized Program Search for Cryptographic PrimitivesJoel Kuepper, Andres Erbsen, Jason Gross, Owen Conoly et al.PLDI 2023 · 12 citations
