Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Sodium crypto library (libsodium.org)
63 points by remx on March 5, 2017 | hide | past | favorite | 14 comments


Not sure why this link was posted again today.

For something new, you may want to look at its little brother instead: https://github.com/jedisct1/libhydrogen/wiki

Anyway, version 1.0.12 will be released soon.


Thanks for your efforts. Looking forward to 1.0.12, which will bring noticeable speed improvements to our application based on current testing.

Also, thanks for not ignoring Windows.


Excellent library, the only thing that's a bit odd is the requirements for instruction sets seem arbitrary. For example aes-gcm requires sse3, blake hashing has full support for various intruction sets and chooses the best one while sha256 doesn't have optimized code for any instruction set. I'm genuinely interested in the reasoning.


You shouldn't look at libsodium as something that provides implementations for AES, SHA256 or whatever specific primitives.

It was designed to provide high-level APIs to perform common operations, abstracting implementation details. And this is what it gets optimized for. The Hydrogen API which libsodium 2.0 will be based on makes this even more obvious.

Low-level primitives are available (or partially available, in minimal builds) only to provide backward compatibility with NaCl, or because the final construction hasn't been chosen yet.

That said, SHA-2 is about 20% faster in version 1.0.12 while remaining portable.


I understand the design of libsodium for sure, but because libsodium is well written I look at it for reference implementations of specific algorithms. In this particular case I needed a zero-dependency sha256 implementation and I turned to libsodium (and was a bit disappointed by the lack of an sse3 optimization.) Would you accept a pull request that folds in intel's reference implementation with sse3 for sha256?

Fun fact, sha256 in openssl pulls in asn1 parsing even after section garbage collection. Yup.


aes is hard(impossible?) to do in constant time without special cpu instructions.


Some imbedded systems don't have sse3. But I guess if you're doing crypto on such hardware and using TLS then you'll want to use chachapoly and not aes-gcm. My question really focuses on it being bizarre that sha256 doesn't have a specialization for sse3.


It's totally possible. Ditto for GCM. But it's slow, which defeats the whole point of using AES.


This is a nice read for anyone who wants to know how the whole NaCl/libsodium relationship works:

https://en.m.wikipedia.org/wiki/NaCl_(software)



Website is down. Here's the page as it was archived in February : https://web.archive.org/web/20170221003148/https://download....


Site is up on my end. Anyways, here's the GH page for anyone interested: https://github.com/jedisct1/libsodium


Yes, seems ok for me too now.


okay, why does it hold any news relavance?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: