New method protects secret data during processor errors
VellSSLH selectively adds security to code to prevent data leaks while keeping programs fast.
Researchers created VellSSLH to protect secret data in C programs. This tool works at the LLVM IR level. It helps prevent leaks that happen during speculative execution.
Even constant-time cryptographic programs can leak secrets. Mispredicted branches may allow instructions to access secret data. This can expose information through observable behavior during speculation.
Speculative load hardening, or SLH, can fix these leaks. However, protecting every value can make programs run much slower. VellSSLH only inserts protections where they are actually needed.
Programmers label inputs as Public or Secret in annotated C programs. The system then infers which values might become secret during speculation. It inserts a misspeculation-flag and protections only for those specific values.
The researchers used Rocq to prove that programs accepted by the checker satisfy speculative constant-time (SCT) security. They also proved a reference hardening transformation preserves architectural behavior. This ensures the protections do not change the original program behavior during normal execution.
VellSSLH was tested on 24 cryptographic entries using a bare-metal Intel processor. It achieved a 4.03% lower geometric-mean runtime than LLVM SLH. For X25519, it improved runtime by 22.69% over LLVM SLH. This version had only 1.86% overhead compared to unprotected code.
The tool uses a misspeculation flag that is nonspillable. This is done without permanently reserving a physical register at the LLVM backend. The mechanized guarantees apply to the LLVM IR level.
The security of the final binary depends on backend and hardware assumptions. Optimized variants were rechecked for SCT but were not covered by the preservation proof. These variants were also tested functionally.
Key facts
- VellSSLH achieves a 4.03% lower geometric-mean runtime than LLVM SLH.
- The tool uses selective hardening to reduce runtime overhead.
- The system was verified using Rocq to ensure SCT security.
- X25519 runtime improved by 22.69% over LLVM SLH.