Hacker News new | ask | show | jobs
by m00dy 9 days ago
we don't need many crypto libraries, maybe just one for the whole world, written in Rust and then all functions are math-proofed.
3 comments

A crypto library written in Rust would not be available everywhere, so can not be the only one. And if you formally verify the code, you can also formally verify that it is memory safe, so there is not much point to have it in Rust. Crypto has properties which may be difficult to verify though.

If you want a safe interface that does not require passing random sizes around in extra arguments, this can also be done in C.

it's too late for C/C++ developers.
Rust and C developer there. C++ it's an unrelated beast, don't mix C99 users with these. On C, I compiled Gplaces (A barebones Gemini -protocol- client with Clang hardening CFLAGS and I linked it against BoehmGC. That in 32 bit.

On Rust, it's pure love in 64 bit, I acknowledge that (I use Cosmic DE with Pop!_OS so I can relate) and evcode it's my main IDE, Crabcraft being second. But compiling 'simple' TUI tools on Rust it's impossible on 32 bit, even with ZRAM and a total of 1.5GB of RAM.

If you want half-secure TUI tools on 32 bit Golang it's a saner option than C/C++ and the only actual altual alternative to Rust. For instance AERC can be safer than Mutt to read email, even under a Maildir mailbox and email fetched/sent with isync/msmtp.

It's not just "math-proofed". You need a lot more to be a crypto library.

Like time-constant, and it's hard to be time-constant in a performance optimised language like Rust. LLVM is doing some magic, and you don't want any magic in a crypto library.

You'd probably need a second one for FIPS.