password-hashes icon indicating copy to clipboard operation
password-hashes copied to clipboard

scrypt: parallel implementation

Open smessmer opened this issue 4 years ago • 2 comments

Looking at the source code, it seems this crate always uses a sequential algorithm and only one core, even when the scrypt parameter p is larger than 1. For p>1, the derivation could be made faster by using a parallel algorithm. Are there plans to implement this?

smessmer avatar Dec 30 '20 03:12 smessmer

Seems like a nice feature to add, potentially leveraging something like rayon as an optional dependency.

tarcieri avatar Dec 30 '20 04:12 tarcieri

pbkdf2 has the parallel feature, which uses rayon for computing long output keys (though AFAIK such keys are usually not used in practice since they do not improve security). A PR which will add a similar feature to scrypt is welcomed!

newpavlov avatar Dec 30 '20 15:12 newpavlov