Compiler Support for Constant-Time Programs in LLVM
No Thumbnail Available
Date
2025-07-21
Authors
Advisor
Xu, Meng
Asokan, N.
Asokan, N.
Journal Title
Journal ISSN
Volume Title
Publisher
University of Waterloo
Abstract
Side-channel attacks aim to extract sensitive information by monitoring the additional information generated during program execution, such as execution time or power consumption. Certain coding patterns, such as using secret data in control flow and memory addressing instructions, cause the execution time of the program to vary based on secret input, making the program vulnerable to timing-based side-channel attacks. Constant-time programming offers a defense against such attacks; however, it is difficult to implement manually as it requires tracking secret data through complex program logic.
In this thesis, we propose an automated approach to generate constant-time programs based on static analysis and program transformations. First, we use taint tracking to monitor the flow of secret input through the program and mark branching and memory addressing instructions that depend on secret data. Then, we apply program transformation techniques such as branch linearization to remove these dependencies and produce constant-time code. We perform our analysis and transformations on LLVM IR and implement our tool as part of the LLVM Pass Infrastructure.
To evaluate our tool’s effectiveness, we apply our analysis and transformations to programs from the OISA benchmark. We validate our results through BliMe, an architecture performing hardware-enforced taint tracking to prevent side-channel attacks.
Description
Keywords
static analysis, constant-time code, side-channel attacks, program transformations, LLVM