Skip to content

Add support for Clang 22 __builtin_ct_select #2329

@bhess

Description

@bhess

LLVM/Clang 22 will introduce a new function, __builtin_ct_select, which guarantees constant-time behavior by preventing compiler optimizations that could introduce branching-based timing attacks.

This proposal suggests adding a common interface that uses this built-in when compiled with Clang 22. Using this interface would improve robustness against compiler-induced regressions in constant-time code.

For more background, see: https://blog.trailofbits.com/2025/12/02/introducing-constant-time-support-for-llvm-to-protect-cryptographic-code/

Note: This is future work, as LLVM 22 has not yet been released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    future-workWill not be fixed in current release cycle

    Projects

    Status

    Todo

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions