# VellSSLH: Sound Type-Guided Selective Speculative Load Hardening for LLVM IR

DevFeed: [VellSSLH: Sound Type-Guided Selective Speculative Load Hardening for LLVM IR](<https://devfeed.tech/articles/vellsslh-sound-type-guided-selective-speculative-load-hardening-for-llvm-ir-136054.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.18463>)

Author: Swarn Priya

Published: 2026-11-16T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [side channel](<https://devfeed.tech/topics/side-channel.md>), [compiler hardening](<https://devfeed.tech/topics/compiler-hardening.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [data type](<https://devfeed.tech/topics/data-type.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [cryptographic](<https://devfeed.tech/tags/cryptographic.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [hardening](<https://devfeed.tech/tags/hardening.md>), [ir](<https://devfeed.tech/tags/ir.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [llvm-ir](<https://devfeed.tech/tags/llvm-ir.md>), [load](<https://devfeed.tech/tags/load.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [secret](<https://devfeed.tech/tags/secret.md>), [security](<https://devfeed.tech/tags/security.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [ssa](<https://devfeed.tech/tags/ssa.md>), [transformation](<https://devfeed.tech/tags/transformation.md>), [type](<https://devfeed.tech/tags/type.md>), [type-system](<https://devfeed.tech/tags/type-system.md>), [x25519](<https://devfeed.tech/tags/x25519.md>)

## AI overview

VellSSLH selectively inserts speculative load hardening in LLVM IR, using annotated Public and Secret inputs to infer which values may become secret during speculation and protect them where needed. Its extracted checker validates the IR; Rocq proofs establish speculative constant-time security for accepted programs and architectural behavior preservation for a reference transformation. Evaluated optimized variants are rechecked for security but are outside that preservation proof, and binary security still depends on backend and hardware assumptions. On 24 cryptographic entries tested on a bare-metal Intel processor, VellSSLH had 4.03% lower geometric-mean runtime than LLVM SLH (13 comparisons favored VellSSLH, eight favored LLVM SLH, and three were inconclusive). For X25519, it was 22.69% faster than LLVM SLH with 1.86% overhead over unprotected code; it also had 19.65% lower runtime than Ultimate SLH.

## Source excerpt

arXiv:2611.18463v1 Announce Type: new Abstract: Constant-time cryptographic programs written in C can still leak secrets during speculative execution. Mispredicted branches may allow instructions to access secret data and expose it through observable behavior. Speculative load hardening (SLH) addresses these leaks, but protecting values unnecessarily can introduce significant runtime overhead. We present VellSSLH, which selectively inserts speculative load hardening at LLVM IR. Programmers specify Public and Secret inputs in annotated C programs, and our analysis infers which values may become secret during speculation. The transformation then inserts misspeculation-flag operations and protections only where needed. VellSCT, our extracted checker, validates the resulting LLVM IR. We formalize speculative constant-time (SCT) security by extending Vellvm's LLVM semantics with speculative execution, attacker directives, and leakage observations. Our security type system reasons about SSA joins, symbolic values, poison, pointer provenance, and observable faults, and supports declared declassifications and trusted external services. In Rocq, we prove that programs accepted by the checker satisfy SCT, and that a reference hardening transformation preserves architectural behavior. Evaluated optimized variants are rechecked for SCT but are not covered by this preservation proof. Our mechanized guarantees apply at LLVM IR; security of the generated binary additionally depends on backend and hardware assumptions. We evaluate VellSSLH on 24 cryptographic entries on a bare-metal Intel processor. VellSSLH achieves 4.03% lower geometric-mean runtime than LLVM SLH, with 13 comparisons favoring VellSSLH, eight favoring LLVM SLH, and three inconclusive. For X25519, VellSSLH improves runtime by 22.69% over LLVM SLH with only 1.86% overhead over unprotected code. Compared with Ultimate SLH, VellSSLH achieves 19.65% lower runtime.