3 ms·
When the author pointed out that bitcode may impact security, I expected to read about how compiler optimizations that happen during compilation of LLVM IR to m
by HHad3 8y ago
When the author pointed out that bitcode may impact security, I expected to read about how compiler optimizations that happen during compilation of LLVM IR to machine language may introduce security issues.
However, the article only mentioned that decompilation is easier with LLVM IR, because it is a more high-level language. It certainly is a valid point, but addresses the topic of binary obfuscation instead for algorithmic security.
I'm thus wondering if anyone can shed some light on the real security aspects. For example, let's say that I compile C that is supposed to run in constant time to LLVM IR and submit it to Apple. Does Apple guarantee that their blackbox optimizations do not introduce branches or other factors that may result in variable timing into a constant time algorithm? Can I do anything to ensure that my code will always run in constant time despite unknown optimizations being applied to it in the future?
- esrauch 8y agoIt seems trivially obvious to me that there is no way to guarantee and code you write won't be transformed into any runtime under arbitrary "optimization" (transformation). As in, you can have just a single numberic constant in your code and Apple is permitted to insert a for loop up to that constant.