3 ms·
It doesn't seem to stop people from trying though: https://www.bearssl.org/constanttime.html https://www.bearssl.org/constanttime.html (This sort of thing is n
by steveklabnik 6y ago
It doesn't seem to stop people from trying though: https://www.bearssl.org/constanttime.html https://www.bearssl.org/constanttime.html
(This sort of thing is not my area of expertise, but has always made me uneasy...)
- SAI_Peregrinus 6y agoYeah. That sort of thing works, right up until some compiler gets released that optimizes it out. It's "portable C", but the behavior it's trying to produce is non-portable. Especially note his guideline to look at the assembly output. The best guarantee is to simply check that the compiler did what you wanted. There are also some aspects that a compiler is unlikely to alter. EG if you write code with no secret-dependent branches, no normal compiler will insert any secret-dependent branches during optimization. It's generally safe to rely on the compiler not being actively malicious or de-optimizing code.