Consensys / eth-lightwallet

Lightweight JS Wallet for Node and the browser
MIT License
1.46k stars 501 forks source link

value of interruptStep raised to reduce the setTimeout calls #202

Closed Tschuck closed 3 years ago

Tschuck commented 6 years ago

Using scrypt-async-js library can cause an incredible amount of setTimeouts calls. On weaker devices this can lead to the browser only executing the callback of the setTimeouts after 10 - 80 seconds.

With an adjusted "interruptStep" value the number of setTimeouts can be drastically reduced.

https://github.com/ConsenSys/eth-lightwallet/issues/200

Tschuck commented 6 years ago

As an alternativ, Dmitry Chestnykh has implemented a scrypt adjustment for automatic calculation of the interruptStep value. Maybe you can use this implementation in the future.

https://www.stablelib.com/modules/_scrypt_scrypt_.html (see deriveKeyNonBlocking) (source: https://github.com/StableLib/stablelib/tree/master/packages/scrypt)

npm install @stablelib/scrypt

Maybe it will work well for such situations.