3 ms·
> The reason you mainly want branchless code is for security reasons That just isn’t true.
by secondcoming 3y ago
> The reason you mainly want branchless code is for security reasons
That just isn’t true.
- latency-guy2 3y agoWhich part isn't true? I think the qualifier 'mainly' definitely weakens the statement, but I'm struggling to think of how it could certainly be false statement. This is certainly true for at minimum DDoS attacks, and I would absolutely consider that a security risk.
- 2102922286 3y agoWhen implementing cryptographic primitives, you want to avoid branching on secret values. The reason why is that the CPU's branch predictor will attempt to predict the value that you're branching on, and thus something about the values that you're branching on gets revealed if you can see how long a CPU takes to run a task/perform a function. This is more than just a theoretical issue. These channel attacks have been demonstrated in practice, even if the victim CPU is running across the internet.
- secondcoming 3y agoBranchless algos are all over the place outside of security.
- latency-guy2 3y agoDon't care, there's a quote in the OP that this discussion is being limited to.