-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better document thread safety considerations #101
Comments
Thread safety issues are due to
If calling a function once the app starts is really not an option, wrap crypto_sign_keypair, crypto_box_keypair and random number generating functions in locks. |
Thanks for your explanation. I can use Could you please point me to some reference that explains why |
|
facepalm oh, I missed that. One of the design requirements on the NaCl webpage states "Do not use global variables (i.e., static variables or variables defined outside functions) in C NaCl." I wonder what has happened to that worthy resolution. |
Hopefully 0331a0d clarifies it. |
Shouldn't the |
|
Shoul've been more specific.
In normal setting one uses a threading library that inserts memory fences where it is needed. Here we don't have that so |
On Thu, Nov 21, 2013 at 1:48 PM, jirkadanek notifications@github.comwrote:
Wouldn't that leak file descriptors? Why would you want to support that? Tony Arcieri |
It would. And if you are intentionally limiting the number of file descriptors, it will fail. So, call |
I would like to see some clarification in the documentation on the issue of thread safety.
README.md claims that the sodium_init, crypto_sign_keypair, crypto_box_keypair and random number generating functions are not thread safe.
src/libsodium/include/sodium/crypto_box.h says that crypto_box_keypair is thread safe once sodium_init was called.
Issue #31 suggests that all except sodium_init might be thread safe once sodium_init has been called.
The original NaCl library is thread safe.
The desirable state IMO would be that all except sodium_init is thread safe, regardless of whether sodium_init has or has not been called.
The text was updated successfully, but these errors were encountered: