HACL*: A Verified Modern Cryptographic Library
Jean Karim Zinzindohoué, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin Beurdouche
摘要
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
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 74 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Vale: Verifying High-Performance Cryptographic Assembly Code 引用了 Verifying Constant-Time Implementations
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider 引用了 Vale: Verifying High-Performance Cryptographic Assembly Code
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider 引用了 Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider 引用了 Implementing and Proving the TLS 1.3 Record Layer
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider 引用了 Jasmin: High-Assurance and High-Speed Cryptography
- SoK: Computer-Aided Cryptography 引用了 Vale: Verifying High-Performance Cryptographic Assembly Code
- SoK: Computer-Aided Cryptography 引用了 EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider
- SoK: Computer-Aided Cryptography 引用了 Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises
- SoK: Computer-Aided Cryptography 引用了 Verifying Constant-Time Implementations
- SoK: Computer-Aided Cryptography 引用了 Implementing and Proving the TLS 1.3 Record Layer
- SoK: Computer-Aided Cryptography 引用了 Jasmin: High-Assurance and High-Speed Cryptography
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises 引用了 Vale: Verifying High-Performance Cryptographic Assembly Code
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises 引用了 Jasmin: High-Assurance and High-Speed Cryptography
- Jasmin: High-Assurance and High-Speed Cryptography 引用了 Vale: Verifying High-Performance Cryptographic Assembly Code
- Jasmin: High-Assurance and High-Speed Cryptography 引用了 Verifying Constant-Time Implementations
引用它的顶会 Paper74
- SoK: Computer-Aided CryptographyManuel Barbosa, Gilles Barthe, Karthik Bhargavan, Bruno Blanchet 等S&P 2021 · 169 次引用
- Jasmin: High-Assurance and High-Speed CryptographyJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Arthur Blot 等CCS 2017 · 157 次引用
- Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without CompromisesAndres Erbsen, Jade Philipoom, Jason Gross, Robert Sloan 等S&P 2019 · 147 次引用
- VRASED: A Verified Hardware/Software Co-Design for Remote AttestationIvan De Oliveira Nunes, Karim Eldefrawy, Norrathep Rattanavipanon, Michael Steiner 等USENIX Security 2019 · 135 次引用
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic ProviderJonathan Protzenko, Bryan Parno, Aymeric Fromherz, Chris Hawblitzel 等S&P 2020 · 114 次引用
它引用的 Paper3
- Verifying Constant-Time ImplementationsJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, François Dupressoir 等USENIX Security 2016 · 274 次引用
- Vale: Verifying High-Performance Cryptographic Assembly CodeBarry Bond, Chris Hawblitzel, Manos Kapritsos, K. Rustan M. Leino 等USENIX Security 2017 · 147 次引用
- Implementing and Proving the TLS 1.3 Record LayerAntoine Delignat-Lavaud, Cédric Fournet, Markulf Kohlweiss, Jonathan Protzenko 等S&P 2017 · 20 次引用
相关 Paper
- HACLxN: Verified Generic SIMD Crypto (for all your favourite platforms)Marina Polubelova, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin Beurdouche 等CCS 2020 · 17 次引用
- The Last Mile: High-Assurance and High-Speed Cryptographic ImplementationsJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Benjamin Grégoire 等S&P 2020 · 67 次引用
- Formally Verified Cryptographic Web Applications in WebAssemblyJonathan Protzenko, Benjamin Beurdouche, Denis Merigoux, Karthikeyan BhargavanS&P 2019 · 36 次引用
- Verified Cryptographic Code for EverybodyBrett Boston, Samuel Breese, Joey Dodds, Mike Dodds 等CAV 2021 · 7 次引用
- CryptOpt: Verified Compilation with Randomized Program Search for Cryptographic PrimitivesJoel Kuepper, Andres Erbsen, Jason Gross, Owen Conoly 等PLDI 2023 · 12 次引用
