[zeromq-dev] curve: libsodium thread safety

Frank Hartmann soundart at gmx.net
Thu May 1 13:37:46 CEST 2014


Hi,

I found the following text in libsodium/README.markdown
----------------------------------------------------------------------
This is not required, however, before any other libsodium functions, it
is recommended to call:

    sodium_init();

This will pick optimized implementations of some primitives, if they
appear to work as expected after running some tests, and these will be
used for subsequent operations.
It will also initialize the pseudorandom number generator.
This function should only be called once, and before performing any other
operations.
Doing so is required to ensure thread safety of all the functions provided by
the library.
----------------------------------------------------------------------


The import part beeing: "is required to ensure thread safety"

The other important part is that libzmq does not seem to call
sodium_init() at all. I have the feeling that multiple zmq threads call
crypto_* functions. Is this indeed the case?

kind regards
  Frank



More information about the zeromq-dev mailing list