News for hackers. Stuff that matters.
Re:Being Sneaky in C by coryrc on Friday June 12, 2015 @04:34PM (#9708346)
1. Compile without optimization (maybe just the crypto parts, if that's possible). 2. Write all crypto stuff in assembly, link in as static binary.
Re:Being Sneaky in C by TheLoneWolfling on Friday June 12, 2015 @04:43PM (#9708410)
Neither of those work in general.

W.r.t. 1, the compiler's definition of no optimization today is not the same thing as it was last version, or will be next version. For instance, on IA-64 there are things the compiler has to do that are typically considered optimizations.

W.r.t. 2, you have to make sure there is no link-time optimization happening.

Re:Being Sneaky in C by mpu on Saturday June 13, 2015 @10:15AM (#9711056)
Lto does not work on assembly, it only works if some IR is stored in the .o files (like gimple for gcc) iirc.
Re:Being Sneaky in C by TheLoneWolfling on Saturday June 13, 2015 @10:50AM (#9711160)
Currently.

However, that is not an inherent restriction - that is only a restriction on current compilers. It is entirely possible for a compiler to read the assembly of things being linked and optimize based on that.

Re:Being Sneaky in C by epsylon on Saturday June 13, 2015 @04:34AM (#9710351)
You could also dynamically link.
Re:Being Sneaky in C by TheLoneWolfling on Saturday June 13, 2015 @09:06AM (#9710882)
That does not solve the problem. That only hides it and means it will be deadly later.

For instance, when someone runs it in an emulator for backwards compatibility purposes. Or when someone runs it in a JITter. Or even just if the compiler decides to special-case for the existing link target.