Skip to main content
5 events
when toggle format what by license comment
Sep 19, 2013 at 14:47 comment added CodesInChaos && vs & is only about observable behavior (side-effects), which doesn't include timing. So using & doesn't help in the crypto case, because the compiler is free to optimize it to && if it knows that the right hand side has no side-effects. You need to use code that sufficiently confused the compiler that it doesn't manage to optimize your code, which in practice involves using & on integers not on bools.
Sep 19, 2013 at 14:00 history edited gnat CC BY-SA 3.0
clarified per comments // http://programmers.stackexchange.com/questions/211983/are-there-any-valid-use-cases-for-eager-boolean-evaluation/211991#comment418094_211984
Sep 19, 2013 at 13:13 vote accept Stijn
Sep 19, 2013 at 13:08 comment added Stijn I had to look up both thwarting and cryptographic timing attack, other than that it's a good answer. More information available on Security SE.
Sep 19, 2013 at 13:02 history answered ratchet freak CC BY-SA 3.0