14 comments

[ 5.9 ms ] story [ 159 ms ] thread
Let's not. FIPS is bad.

https://archive.ph/9WNhe

There are industries where you have no choice but to use FIPS compliant crypto. Or do they just not get to have pure rust crypto?
So long as I have the option to choose something else, I'm fine with this. some companies don't have a choice so a lack of support simply means rust won't be viable.
Who is fronting the $65K for the lab testing?
Pretty sure it costs a lot more than that...
Having FIPS validated Rust Crypto is great and all but I'm mostly excited about pure rust Crypto :)
Not sure this can be done without using at least a tiny bit of unsafe since many algorithms will be slow without using CPU accelerator instructions. Other algorithms are much more efficiently implemented using vector instruction sets that usually require unsafe.
Unsafe rust is still pure rust
And note that if you implement crypto in Rust by calling out to a C library, that requires the unsafe keyword anyway.
More to the point, often you need assembly to prevent the compiler from sabotaging your carefully constant-time algorithms, replacing your careful length-independent XOR loops with branches and the like.

Performance is a small part of why crypto code is often written in assembly. C is simply too high level, allowing too many optimizations.

For that matter, assembly is too high level, and Intel is adding flags to turn off some of the internal CPU optimizations:

https://www.intel.com/content/www/us/en/developer/articles/t...

Yeah I always thought there should be a compiler annotation for that. It could automatically verify that your code really was constant time too.
100% on board and super happy that `ring` is finally getting some love again (and funding!)

For context: the ring repo's been a bit inactive lately and the v0.17 release looked like it stalled out. Thankfully there's been a burst of activity in the past several weeks so I'm feeling a lot better.

One of the major pain points with FIPS is how long it takes to get through the backlog to start being evaluated and validated. Lots of sitting around for a year+ twiddling fingers waiting for them to get back to you. Once they're looking at your stuff, it's a nice and fast, comprehensive and positive experience, as I understand it.