News for hackers. Stuff that matters.
Re:Introducing MIR by perflexive on Wednesday April 27, 2016 @05:38PM (#11584785)
I'm surprised to see no mention in the article or on HN about how this might affect writing crypto code in Rust. Maybe it's a little tangential, but I'm dying for constant time operations.

Avoiding branches, etc. in Rust doesn't mean LLVM won't add some as an optimization, which is frustrating to say the least. It would be awesome to be able to define a block - similar to "unsafe" - that tells the compiler to disable optimizations that could introduce non-constant time operations. When I started reading the article, I though maybe this new development would open the door to something like that, but it doesn't appear to be the case.

There's some work to do constant time ops in rust, but it's very experimental and untrustworthy. :/

Re:Introducing MIR by steveklabnik on Wednesday April 27, 2016 @05:40PM (#11584799)
Since this is before the LLVM passes, it doesn't really change anything, and can't.
Re:Introducing MIR by perflexive on Wednesday April 27, 2016 @05:52PM (#11584878)
I have no experience with LLVM internals, but couldn't you split up the code and disable some of LLVM's optimizations on blocks defined by the programmer?

Or do you have to pass the entire program at once to LLVM? Maybe the ability to disable optimizations only on certain functions is possible, idk, but I think it certainly would be nice.

Re:Introducing MIR by steveklabnik on Wednesday April 27, 2016 @07:02PM (#11585317)
I'm not knowledgeable about that, to be honest.