Skip to content

Conversation

stnolting
Copy link
Owner

New top generic to enable constant-time branches (data-independent timing):

CPU_CONSTT_BR_EN : boolean := false; -- implement constant-time branches
  • When this option is enabled, all conditional branch instructions have identical execution times for taken and not taken branch conditions. Thus, all branches behave as if they were always taken (including a complete CPU pipeline flush). Enabling this feature makes execution times more predictable and makes timing side-channel attacks more difficult.
  • When disabled, not-taken conditional branches are executed faster without clearing the CPU pipeline. Hence, for maximum performance, this feature should be disabled.

@stnolting stnolting self-assigned this Aug 15, 2025
@stnolting stnolting added enhancement New feature or request HW Hardware-related labels Aug 15, 2025
@stnolting stnolting marked this pull request as ready for review August 15, 2025 05:11
@stnolting stnolting merged commit 3e1cbb3 into main Aug 15, 2025
7 checks passed
@stnolting stnolting deleted the constant_time_branches branch August 15, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW Hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant