jedisct1 / libsodium

A modern, portable, easy to use crypto library.

Home Page:https://libsodium.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any way to control parallelism degree in crypto_pwhash?

kalum-deprecated opened this issue · comments

commented

The Argon2 specification says that there is a parallelism degree which defines the number of parallel threads.

The documentation of libsodium also says:

What will be the highest number of threads/processes evaluating the function simultaneously (ideally, no more than 1 per CPU core)?

But, I couldn't find an API for that. Is there any way to control the parallelism degree?

I'm interested in libsodium and my application needs to use that feature.

All in all, thanks you libsodiumdevelopers who make such good crypto library!

Hi,

Although existing hashes with a parallelism > 1 can be verified, crypto_pwhash doesn’t support thread-level parallelism.

Maybe this will be added at some point, for platforms that have support for threads, especially if other algorithms can take advantage of this.

But I’m not really convinced that this is necessary as more threads don’t provide a significant slowdown of the hash computation.