-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save the project #106
Save the project #106
Conversation
This is fantastic. I'm just a bit confused about why you recommend stripping |
Thanks! The reason I stripped |
I see. Blocking the thread for something that may not be useful is not great, but if we don't, we also may become more vulnerable to timing attacks. |
Yeah, that's really the biggest concern I see with this, more so than the degraded asm.js performance. In my other libraries that use this pattern (mceliece.js, ntru.js, rlwe.js, sidh.js, sphincs.js, and xkcd-passphrase), the reason I ended up deciding in favor of startup time + space-efficiency* over the increased timing attack risk is the vanishingly small number of clients that support asm.js and not WebAssembly (with browsers these days being mostly evergreen). Specifically, the following clients would be impacted:
*: In that not caring about strict asm.js compliance allows aggressive minification of the entire JS output. |
Merged into a |
Addresses #105.
I haven't tested any part of this, and as mentioned it'll depend on emscripten-core/emscripten#5296 landing, but this is what I was going for:
Consolidate the whole build back into one file (with no run-time dependencies on external subresources)
Preferentially use
-O3
WebAssembly, with-Oz
asm.js as a fallback for when wasm is unsupported or fails to compileStrip
use asm
from the fallback asm.js build to avoid unneeded AOT compilation; this means that more aggressive minification can be used, but also sucks for clients that support asm.js but not wasmExpose a
sodium.ready
promise to let consuming code know when the emscripten module is initialized and methods are ready to be usedAny thoughts on the general direction / design goals?