logoalt Hacker News

zelphirkalt • today at 7:46 AM • 3 replies • view on HN

Can you explain why it is easier to avoid side-channel timing attacks in assembly?


Replies

jbarberu • today at 7:58 AM

Compilers like to make code go brrr as much as they can. With crypto you want the code to run at a deterministic speed (execution time), regardless of input. With hand written assembly you can (more easily) make sure you have the same cycle count regardless of what the input is.

tecleandor • today at 7:58 AM

I guess it's easier to control the timing of your operations if you write them directly in assembly. Otherwise, the compiler optimizations could change the code in unexpected ways.

HappMacDonald • today at 7:59 AM

At a guess, because it is easier to control timing in assembly than in a higher level language that will compile your source code into whatever shape it feels like

➕ show 1 reply