Lune

POPL2025Top-tier venue

Preservation of Speculative Constant-Time by Compilation

Santiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Benjamin Grégoire, Vincent Laporte

Abstract

Compilers often weaken or even discard software-based countermeasures commonly used to protect programs against side-channel attacks; worse, they may also introduce vulnerabilities that attackers can exploit. The solution to this problem is to develop compilers that preserve such countermeasures. Prior work establishes that (a mildly modified version of) the CompCert and Jasmin formally verified compilers preserve constant-time, an information flow policy that ensures that programs are protected against timing side-channel attacks. However, nothing is known about preservation of speculative constant-time, a strengthening of the constant-time policy that ensures that programs are protected against Spectre-v1 attacks. We first show that preservation of speculative constant-time fails in practice by providing examples of secure programs whose compilation is not speculative constant-time using GCC (GCC -O0 and GCC -O1) and Jasmin. Then, we define a proof-of-concept compiler that distills some of the critical passes of the Jasmin compiler and use the Coq proof assistant to prove that it preserves speculative constant-time. Finally, we patch the Jasmin speculative constant-time type checker and demonstrate that all cryptographic implementations written in Jasmin can be fixed with minimal impact.

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.

9 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Non-interference Preserving Optimising Compilation cites SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations
  • Non-interference Preserving Optimising Compilation cites Jasmin: High-Assurance and High-Speed Cryptography
  • Spectector: Principled Detection of Speculative Information Flows cites Spectre Attacks: Exploiting Speculative Execution
  • Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and Compilers cites Spectre Attacks: Exploiting Speculative Execution
  • Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and Compilers cites SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations
  • Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and Compilers cites Interaction trees: representing recursive and impure programs in Coq
  • Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and Compilers cites Jasmin: High-Assurance and High-Speed Cryptography
  • Decompiling for Constant-Time Analysis cites Spectre Attacks: Exploiting Speculative Execution
  • Decompiling for Constant-Time Analysis cites Spectector: Principled Detection of Speculative Information Flows
  • Decompiling for Constant-Time Analysis cites SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations
  • Decompiling for Constant-Time Analysis cites SoK: Computer-Aided Cryptography
  • Decompiling for Constant-Time Analysis cites Jasmin: High-Assurance and High-Speed Cryptography
  • SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations cites Spectre Attacks: Exploiting Speculative Execution
  • SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations cites Spectector: Principled Detection of Speculative Information Flows
  • SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations cites SoK: Computer-Aided Cryptography
  • SoK: Computer-Aided Cryptography cites Spectre Attacks: Exploiting Speculative Execution
  • SoK: Computer-Aided Cryptography cites Jasmin: High-Assurance and High-Speed Cryptography
  • KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEM cites Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and Compilers
  • KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEM cites SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations
  • KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEM cites SoK: Computer-Aided Cryptography
  • KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEM cites Interaction trees: representing recursive and impure programs in Coq
  • KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEM cites Jasmin: High-Assurance and High-Speed Cryptography
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. SNIP: Speculative Execution and Non-Interference Preservation for Compiler TransformationsSören van der Wall, Roland MeyerPOPL 2025 · 7 citations
  2. Non-interference Preserving Optimising CompilationJulian Rosemann, Sebastian Hack, Deepak GargOOPSLA 2025 · 1 citation
  3. Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and CompilersOwen Conoly, Andres Erbsen, Adam ChlipalaPLDI 2025 · 1 citation
  4. Decompiling for Constant-Time AnalysisSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Youcef Bouzid et al.OOPSLA 2026 · 1 citation
  5. KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEMSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Benjamin Gregoire et al.CCS 2026 · 1 citation

Builds on30

  1. Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
  2. Spectector: Principled Detection of Speculative Information FlowsMarco Guarnieri, Boris Köpf, José F. Morales, Jan Reineke et al.S&P 2020 · 177 citations
  3. SoK: Computer-Aided CryptographyManuel Barbosa, Gilles Barthe, Karthik Bhargavan, Bruno Blanchet et al.S&P 2021 · 169 citations
  4. Jasmin: High-Assurance and High-Speed CryptographyJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Arthur Blot et al.CCS 2017 · 157 citations
  5. Interaction trees: representing recursive and impure programs in CoqLi-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur et al.POPL 2020 · 133 citations

Related papers

  1. Typing High-Speed Cryptography against Spectre v1Basavesh Ammanaghatta Shivakumar, Gilles Barthe, Benjamin Grégoire, Vincent Laporte et al.S&P 2023
  2. Protecting Cryptographic Code Against Spectre-RSB: (and, in Fact, All Known Spectre Variants)Santiago Arranz-Olmos, Gilles Barthe, Chitchanok Chuengsatiansup, Benjamin Grégoire et al.ASPLOS 2025 · 1 citation
  3. Formal verification of a constant-time preserving C compilerGilles Barthe, Sandrine Blazy, Benjamin Grégoire, Rémi Hutin et al.POPL 2020 · 77 citations
  4. High-Assurance Cryptography in the Spectre EraGilles Barthe, Sunjay Cauligi, Benjamin Grégoire, Adrien Koutsos et al.S&P 2021 · 42 citations
  5. Constant-time foundations for the new spectre eraSunjay Cauligi, Craig Disselkoen, Klaus von Gleissenthall, Dean M. Tullsen et al.PLDI 2020 · 90 citations
Dusk over the sea between two cliffs drawn in fine vertical lines