jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
994 stars 141 forks source link

WASM support #81

Closed gpalomar closed 7 years ago

gpalomar commented 7 years ago

Hi Frank!

I'm having trouble generating Argon2i hashes using your sumo build. It seems to take a long time to generate them in Chrome whereas in Firefox I have no problems. (Chrome takes approximately x5 more time than Firefox). The problem seems to be that Chrome is not optimizing well ASM while other browsers, such as Firefox, do.

The solution would be to use WASM, which will be supported by Firefox version 52 (currently at version 50) and by Chrome version 57 (currently at version 56). Also, it seems that Emscripten already supports it.

Are there any plans to add WASM support for LibsodiumJS in the future?

Sources: Firefox v52 release notes: https://developer.mozilla.org/en-US/Firefox/Releases/52 Chrome platform status: https://www.chromestatus.com/feature/5453022515691520 Emscripten WASM: https://github.com/kripken/emscripten/wiki/WebAssembly

jedisct1 commented 7 years ago

Yes, WASM is absolutely something we need.

There are still a few things to fix, but it's mostly working, see https://github.com/jedisct1/libsodium/issues/475

jedisct1 commented 7 years ago

By the way, Firefox is currently at version 52. Which does support WASM :)

BurningEnlightenment commented 7 years ago

Firefox is currently at version 52. Which does support WASM

sadly WASM support is disabled in the ESR (Extended Support Release) version 😞

jedisct1 commented 7 years ago

Ready for testing.