3 ms·
> The randombytes function in NaCl does it right, unfortunately libsodium did their own thing. I don't know what you're talking about. Sodium does the same thi
by pbsd 13y ago
> The randombytes function in NaCl does it right, unfortunately libsodium did their own thing.
I don't know what you're talking about. Sodium does the same thing as NaCl, while also being more portable.
- eliteraspberrie 13y agoNo, libsodium does not do the same thing as NaCl. NaCl: https://gist.github.com/anonymous/9234738 https://gist.github.com/anonymous/9234738 libsodium: https://github.com/jedisct1/libsodium/blob/master/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c https://github.com/jedisct1/libsodium/blob/master/src/libsod...
- pbsd 13y agoI'm aware that the implementations are not strictly equal, but how is libsodium doing it 'wrong'? Is it because it does not partition reads into smaller chunks (avoiding the unspecified >= SSIZE_MAX read)? I consider any reasonable answer a valid bug report. I should also point out that randombytes is technically not part of NaCl. The authors maintain that random byte generation is out of scope for NaCl, and what actually happens is that randombytes.o is bundled separately from libnacl.a [1]. In TweetNacl the randombytes implementation is completely omitted. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=20;bug=694248#20 https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=20;bug=694...
- eliteraspberrie 13y agoDon't take my word for it, check libsodium with Frama-C (as NaCl was) and file the bug report yourself.