arXiv:2610.20171cs.CROct 2026

Manuscript Offprint

arXiv:2610.20171

FreeSBee: A Constant-Time Compilation Pipeline

Julian Ganz, David Knothe, David Oswald, Sebastian Reiter, Thorben Schneider, Simon Wegener

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Julian Ganz

David Knothe

Sebastian Reiter

FZI Research Center for Information

Technology

Karlsruhe, Germany

David Oswald

Thorben Schneider

Kasper & Oswald GmbH

Bochum, Germany

Simon Wegener

AbsInt Angewandte Informatik

GmbH

Saarbrücken, Germany

Abstract

Constant-time execution is an important security property, especially for IoT devices, that prevents the leakage of sensitive information over timing side-channels. However, achieving constant-time execution is very hard when going down to the cycle level, at least on realistic devices. A lot of research is concerned with producing tools that either determine whether code is constant-time or that ensure it is compiled into a constant-time binary, with various degrees of accuracy. In this work, we present and evaluate a full workflow for hardening against timing side-channels during compilation. It starts with taint analysis to determine the code locations that depend on sensitive information. These are then the object of automated control-flow transformations inside the compiler to seal possible timing side-channels. We evaluate our workflow in detail on a realistic application running on a RISC-V core using both static timing analysis and statistical methods. Even though we do not reach cycle-accurate constant-time execution, our statistical results suggest that our hardened binary is safe against timing attacks.

ACM Reference Format:

Julian Ganz, David Knothe, Sebastian Reiter, David Oswald, Thorben Schneider, and Simon Wegener. 2026. FreeSBee: A Constant-Time Compilation Pipeline. In Proceedings of Hardware and Architectural Support for Security and Privacy (HASP 2026). ACM, New York, NY, USA, 7 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

1 Introduction

Due to their widespread areas of application, ranging from automotive and medical devices to resource-constrained deployments in smart homes and industrial automation, modern connected embedded systems such as IoT devices must implement strong functional security guarantees. However, even systems with robust security mechanisms in place may leak sensitive information through timing side-channels. These leaks are caused by variances in a program's execution time that depends on confidential data [9]. Therefore, it is essential to ensure that the execution time of a sequence of instructions is independent of sensitive data, such as cryptographic keys.

Software with this property is considered to be “constant-time” with respect to the secrets. Traditional approaches at source code level aim to achieve constant-time behaviour by using well-defined patterns and code guidelines, sometimes with the intention of preventing compiler optimizations that would introduce variances in execution time. However, such approaches often lead to less expressive code that also depends on specific compilers and compilation settings, making them increasingly impractical in real-world applications [12][12].

Modern approaches encompass dedicated validators, compiler passes, or even Domain Specific Languages (DSLs) to enforce constant-time properties after compilation. For example, compilers could be adapted to recognize and respect annotations that express a constant-time requirement with respect to a secret. Such a compiler would avoid optimizations or transformations that introduce execution time variability, but only at the annotated places, and could even eliminate some timing fluctuations that still exist in the code as-is.

In this paper, we present an implementation and evaluation of a modern compiler-based approach to hardening software against timing side-channels. Our approach combines an information-flow analysis with a code transformation pass in the CompCert C Compiler to automatically eliminate execution time fluctuations from a program's sensitive execution paths. The compiler transformation pass that enforces constant-time implementation is validated on a test application using AES crypto functions, employing (a) statistical measurements and (b) static timing analysis at the binary level.

In this work, we mainly consider execution time variability introduced by control flow and, to some extent, caching. We acknowledge possible operand dependent variability in the execution time of individual instructions aside from control-transfer and load/store instructions. However, this work focuses on a workflow that can be deployed without further assumptions or knowledge of the target hardware.