2 ms·
This is an area where hardware, run-time library, compiler, and cryptography developers have been pulling in multiple directions for a while, and it's nice that
by andrewaylett 4y ago
This is an area where hardware, run-time library, compiler, and cryptography developers have been pulling in multiple directions for a while, and it's nice that the hardware at least is explicitly providing options.
One thing I've always wanted but never seen is a way to be explicit to the compiler what time complexity I require for a specific piece of code. At the moment, we have in some cases library guarantees about how slow an algorithm is allowed to be (in C++ STL, I don't think I've seen guarantees anywhere else?) and compilers will try to manipulate code to make it faster if they can prove the result is the same. But that leaves cryptography developers trying to ensure that the optimiser doesn't do as good a job as it is trying to do.
What we've learned is that telling the compiler what you're trying to achieve is much more straightforward than only giving the compiler part of the information you have then relying on it happening to do the right thing. Being able to set a constant time annotation on source code and have it propagate all the way to the hardware would be really neat.