Ruhr-Uni-Bochum

Protecting cryptographic code against Spectre-RSB (and, in fact, all known Spectre variants)

2025

Konferenz / Journal

Autor*innen

Santiago Arranz Olmos Gilles Barthe Chitchanok Chuengsatiansup Benjamin Grégoire Vincent Laporte Tiago Oliviera Peter Schwabe Yuval Yarom Zhiyuan Zhang

Research Hub

Research Hub B: Eingebettete Sicherheit - CASA 1.0, 2019-2025

Research Challenges

RC 7: Building Secure Systems

Abstract

Spectre attacks void the guarantees of constant-time cryptographic code by leaking secrets during speculative execution. Recent research shows that such code can be protected from Spectre-v1 attacks with minimal overhead, but leaves open the question of protecting against other Spectre variants.

In this work, we design, validate, implement, and verify a new approach to protect cryptographic code against all known classes of Spectre attacks, in particular Spectre-RSB. Our approach combines a new value-dependent information-flow type system that ensures that no secrets leak even under speculative execution and a compiler transformation that enables it on the generated low-level code.

We first prove the soundness of the type system and the correctness of the compiler transformation using the Coq proof assistant. We then implement our approach in the Jasmin framework for high-assurance cryptography and demonstrate that the overhead incurred by all Spectre protections is below 2% for most cryptographic primitives and reaches only about 5–7% for the more complex post-quantum key-encapsulation mechanism Kyber.

Tags

Computer Architecture
Real-world Attacks
Software Implementation
Software Security