logoalt Hacker News

exDM69yesterday at 11:00 AM1 replyview on HN

The project itself is cool and useful but the motivating example of crypto (primitives?) isn't great.

Cryptography is already difficult to write in high level languages without introducing side channels via timing, branch predictor, caches etc.

Cryptography while going through two high level compilers, especially when the code was not designed and written to do so is an exercise fraught with peril.

Tbf, this is just nitpicking about the article, not the project itself


Replies

the8472yesterday at 5:21 PM

It's not possible to correctly implement any cryptographic algorithms in any high-level language with an optimizing backend where timing is not considered an observable/perserved property. Currently this includes anything backed by LLVM or GCC, though there's a proposal to introduce such guarantees through a new builtin in LLVM https://github.com/llvm/llvm-project/pull/166702 though those could still be broken by post-build optimizers, like wasm.