News for hackers. Stuff that matters.
Re:Rust Cryptography Should Be Written in Rust by AlotOfReading on Saturday August 26, 2023 @03:03PM (#37275857)
The subtlety is that eliminating branching isn't sufficient to have constant time code. A simple example is using trigonometric and transcendental opcodes. They don't branch (at the assembly level), but on x86 take variable amounts of time depending on the input operand. Very few algorithms actually use these opcodes though, so a more relevant concern is memory access due to variable latency. Even if you have that nailed down, integer operations like multiplication and especially division can take variable amounts of time depending on the input.

Writing truly constant time code on modern processors ranges is difficult at best, and usually less efficient than variable-time code.

Re:Rust Cryptography Should Be Written in Rust by touisteur on Sunday August 27, 2023 @05:42AM (#37281003)
Add cache misses, bus interference, SMT woes and it quickly becomes harder and harder to write (and check) constant-time (or WCET) properties. Even modern micro-benchmarks are a huge labyrinth of architectural traps.
Re:Rust Cryptography Should Be Written in Rust by brobinson on Wednesday September 06, 2023 @04:06PM (#37410560)
Really interesting information, thank you.