2 ms·
> To put it in short, C programmers hate needless abstraction and work with raw memory and hand-crafted data structures whenever possible. I wrote Monocypher i
by loup-vaillant 6y ago
> To put it in short, C programmers hate needless abstraction and work with raw memory and hand-crafted data structures whenever possible.
I wrote Monocypher in C for one reason: portability.
From a systems point of view, crypto libraries are trivial: you don't need any dependency, code is pathologically straight-line, there is no almost data structure to speak of beyond arrays of bytes and arrays of words.
Yet I can tell you that if not for portability, Rust would have been a better fit. So I could group buffers and their size in a single argument. So I could provide genuinely high-level interface. So I could use types to avoid silly mistakes and enforce some invariants. Portability won over all that goodness: worst case I can have a Rust wrapper. Heck, someone else already wrote one for me.