4 ms·
Most professional cryptographers write code in C. And what is arguably the best crypto library (NaCl) is written in C. Look, safety is a great idea. Unfortunate
by jeffreyrogers 11y ago
Most professional cryptographers write code in C. And what is arguably the best crypto library (NaCl) is written in C. Look, safety is a great idea. Unfortunately, things like cryptography need to be fast if you expect people to use them, and it is impossible to get the fastest levels of performance without using a low level language and dropping to assembly when necessary.
- admax88q 11y agoThis is untrue. Java is very fast once the JIT warms up. The biggest cost to java is the startup time, but for a long running application it's not really an issue. In fact, Java can be faster than C for a long running application, because you avoid problems like memory fragmentation. Garbage collection can compact used objects into smaller sets of memory, improving cache utilization.
- deleted 11y ago[deleted]
- xorcist 11y agoPerformance is not a singular entity. It is very very hard to write sidechannel resistant code in Java, because of the performance characteristics.
- admax88q 11y agoThe parent comment said that they need to write it in C in order for it to be fast enough for people to use it, which is false. As for timing attacks, it's very very hard to write sidechannel resistant code in any language, I don't believe Java is particularly harder. C/C++ is not as deterministic as you would think. http://blog.erratasec.com/2015/03/x86-is-high-level-language.html#.VWcvXa3InK4 http://blog.erratasec.com/2015/03/x86-is-high-level-language...
- sitkack 11y agoCrypto is a only a small part of a project like this. Crypto isn't where a messaging client is going to break. Most likely it will be in parsing data the network. There is no reason to use C for the entire application because NaCl is in C, even if everyone on the project is Daniel J. Bernstein.