Typing High-Speed Cryptography against Spectre v1
Basavesh Ammanaghatta Shivakumar, Gilles Barthe, Benjamin Grégoire, Vincent Laporte, Tiago Oliveira, Swarn Priya, Peter Schwabe, Lucas Tabary-Maujean
Abstract
The current gold standard of cryptographic software is to write efficient libraries with systematic protections against timing attacks. In order to meet this goal, cryptographic engineers increasingly use high-assurance cryptography tools. These tools guide programmers and provide rigorous guarantees that can be verified independently by library users. However, high-assurance tools reason about overly simple execution models that elide transient execution leakage. Thus, implementations validated by high-assurance cryptography tools remain potentially vulnerable to transient execution attacks such as Spectre or Meltdown. Moreover, proposed countermeasures are not used in practice due to performance overhead.We propose, analyze, implement and evaluate an approach for writing efficient cryptographic implementations that are protected against Spectre v1 attacks. Our approach ensures speculative constant-time, an information flow property which guarantees that programs are protected against Spectre v1. Speculative constant-time is enforced by means of a (value-dependent) information flow type system. The type system tracks security levels depending on whether execution is misspeculating. We implement our approach in the Jasmin framework for high-assurance cryptography, and use it for protecting all implementations of an experimental cryptographic library that includes highly optimized implementations of symmetric primitives, of elliptic-curve cryptography, and of Kyber, a lattice-based KEM recently selected by NIST for standardization. The performance impact of our protections is very low; for example, less than 1% for Kyber and essentially zero for X25519.
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.
13 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
- Spectector: Principled Detection of Speculative Information Flows cites Spectre Attacks: Exploiting Speculative Execution
- Spectector: Principled Detection of Speculative Information Flows cites ret2spec: Speculative Execution Using Return Stack Buffers
- 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 Meltdown: Reading Kernel Memory from User Space
- SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations cites Preservation of Speculative Constant-Time by Compilation
- Preservation of Speculative Constant-Time by Compilation cites SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations
- ret2spec: Speculative Execution Using Return Stack Buffers cites Spectre Attacks: Exploiting Speculative Execution
- Meltdown: Reading Kernel Memory from User Space cites Spectre Attacks: Exploiting Speculative Execution
- Automated Side-Channel Analysis of Cryptographic Protocol Implementations cites Spectre Attacks: Exploiting Speculative Execution
- Automated Side-Channel Analysis of Cryptographic Protocol Implementations cites Meltdown: Reading Kernel Memory from User Space
- Declassiflow: A Static Analysis for Modeling Non-Speculative Knowledge to Relax Speculative Execution Security Measures cites Spectre Attacks: Exploiting Speculative Execution
- Declassiflow: A Static Analysis for Modeling Non-Speculative Knowledge to Relax Speculative Execution Security Measures cites Spectector: Principled Detection of Speculative Information Flows
- Declassiflow: A Static Analysis for Modeling Non-Speculative Knowledge to Relax Speculative Execution Security Measures cites ret2spec: Speculative Execution Using Return Stack Buffers
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs cites Spectre Attacks: Exploiting Speculative Execution
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs cites Spectector: Principled Detection of Speculative Information Flows
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs cites Meltdown: Reading Kernel Memory from User Space
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs cites HACL: A Verified Modern Cryptographic Library
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs cites Declassiflow: A Static Analysis for Modeling Non-Speculative Knowledge to Relax Speculative Execution Security Measures
- Preservation of Speculative Constant-Time by Compilation cites Spectre Attacks: Exploiting Speculative Execution
- Preservation of Speculative Constant-Time by Compilation cites Spectector: Principled Detection of Speculative Information Flows
Cited by top-tier papers13
- Preservation of Speculative Constant-Time by CompilationSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Benjamin Grégoire et al.POPL 2025 · 8 citations
- SNIP: Speculative Execution and Non-Interference Preservation for Compiler TransformationsSören van der Wall, Roland MeyerPOPL 2025 · 7 citations
- Declassiflow: A Static Analysis for Modeling Non-Speculative Knowledge to Relax Speculative Execution Security MeasuresRutvik Choudhary, Alan Wang, Zirui Neil Zhao, Adam Morrison et al.CCS 2023 · 4 citations
- Automated Side-Channel Analysis of Cryptographic Protocol ImplementationsFaezeh Nasrabadi, Robert Künnemann, Hamed NematiCCS 2026 · 2 citations
- Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic ProgramsAli Hajiabadi, Trevor E. CarlsonISCA 2025 · 2 citations
Builds on16
- Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
- Meltdown: Reading Kernel Memory from User SpaceMoritz Lipp, Michael Schwarz, Daniel Gruss, Thomas Prescher et al.USENIX Security 2018 · 1,456 citations
- ret2spec: Speculative Execution Using Return Stack BuffersGiorgi Maisuradze, Christian RossowCCS 2018 · 282 citations
- HACL*: A Verified Modern Cryptographic LibraryJean Karim Zinzindohoué, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin BeurdoucheCCS 2017 · 258 citations
- Spectector: Principled Detection of Speculative Information FlowsMarco Guarnieri, Boris Köpf, José F. Morales, Jan Reineke et al.S&P 2020 · 177 citations
Related papers
- 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
- High-Assurance Cryptography in the Spectre EraGilles Barthe, Sunjay Cauligi, Benjamin Grégoire, Adrien Koutsos et al.S&P 2021 · 42 citations
- Constant-time foundations for the new spectre eraSunjay Cauligi, Craig Disselkoen, Klaus von Gleissenthall, Dean M. Tullsen et al.PLDI 2020 · 90 citations
- Jasmin: High-Assurance and High-Speed CryptographyJosé Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Arthur Blot et al.CCS 2017 · 157 citations
- (Dis)Proving Spectre Security with Speculation-Passing StyleSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Xingyu Xie et al.OOPSLA 2026
