upvote
There’s already a Rust TLS library, rustls, that’s relatively mature (10 years in development, a couple of paid maintainers, robust development and release processes). It’s not a drop-in replacement for OpenSSL, though. There’s a companion project to build an OpenSSL-compatible wrapper API for it, but that’s not as far along. Interestingly, while rustls has a plug-in API that lets you choose your favorite Rust encryption library for the low-level operations (aws-lc-rs, Ring, Graviola, etc), those libraries all tend to contain a lot of assembly … not just for speed, but because it’s easier to avoid side channel timing vulnerabilities in assembly.
reply
Can you explain why it is easier to avoid side-channel timing attacks in assembly?
reply
Compilers like to make code go brrr as much as they can. With crypto you want the code to run at a deterministic speed (execution time), regardless of input. With hand written assembly you can (more easily) make sure you have the same cycle count regardless of what the input is.
reply
I guess it's easier to control the timing of your operations if you write them directly in assembly. Otherwise, the compiler optimizations could change the code in unexpected ways.
reply
At a guess, because it is easier to control timing in assembly than in a higher level language that will compile your source code into whatever shape it feels like
reply
It's still impossible to control actual timing, but easy to ensure control flow isn't data-dependent, which is what you need. Classic example is memcmp. Although you can write the or-then-check-zero memcmp in any high level language and it's very unlikely to compile to data-dependent timing unless your compiler is AGI.
reply
> Although you can write the or-then-check-zero memcmp in any high level language and it's very unlikely to compile to data-dependent timing unless your compiler is AGI.

No need for "AGI", the compiler just needs to have enough value tracking to know that the value saturates (once a bit is set, it never gets unset), and an heuristic to move the comparison inside the loop when it might allow it to do less loop iterations.

(I wrote a Rust crate to do precisely that kind of "constant time memcmp", and the only truly reliable way to do so without help of the compiler, is by using inline assembly as a "black box" to make a few things invisible to the compiler's optimizer. It was inspired by code in the Linux kernel which did the same thing also using inline assembly as a "black box".)

reply
The side channels issue is where rust crypto libraries are currently the weakest
reply
LLMs have a bottleneck, human review. And human review is absolutely required at this stage (the future is unknown). A rust built LLM only reviewed SSL library would be a recipe for disaster.

Beyond that, when it comes to exceptionally complex APIs, forward thinking implementation, and revising the 'way things are done'? These are weak points for LLMs. If you don't know how to write OpenSSL(or its replacement), and don't understand all its quirks, and the entire industry surrounding it, you cannot be the human driving the LLM successfully.

There is no way for a human to catch all the design mistakes an LLM will make, otherwise.

People seem to get upset, when I say this, for reasons I cannot fathom. However, we need to have a mental model of how we trust LLM output, and the 'new junior' is great for that. Especially considering that every day, is a new day for an LLM, its context window always loses yesterday.

So consider LLMs as an eager, intelligent, incredibly well read junior, just out of college. And on their third day of work.

Zero real world experience. Constant review required.

Would you want that junior to design, build, and write test scripts for a library to underpin the entire internet?

reply
> A rust built LLM only reviewed SSL library would be a recipe for disaster.

There was a great quote at this year's OpenSSL conference that went something like "LLMs if left to their own devices will reinvent sendmail".

reply
Is that Zawinsky's law of LLMs?
reply
you don't get credit for that because it is clear you are not very skillful at what AI-bros value most, namely manipulating other nerds...

if you look at the commit history of OpenSSL, you can easily notice how a lot of people started contributing once their clanker got up to speed. They are very happy to rip out weird C and replace it with assembler or intrinsics. Rip out lists of characters formatted as a single string and replace them with array syntax, each char quoted.

reply