Why C Remains the Gold Standard for Cryptographic Software

11 points by tsg


david_chisnall

It’s also worth noting a couple of things about memory safety:

First, cryptography code tends to (intentionally) have very simple data structures and lifetimes. You have a key, some plaintext, some cyphertext, and a context structure. That’s basically it for almost all crypto code. That’s much easier to get right for a lot of arbitrary C code.

Second, there are things like the bounded C model checker that are good at checking this kind of code, so you can write guaranteed memory-safe C code with these structures.

But none of that applies to the protocol bits of something like TLS and there are far fewer good reasons for choosing C there.