-
Notifications
You must be signed in to change notification settings - Fork 500
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
JavaScript fallback for WebAssembly libraries #6814
Conversation
This commit adds the generation of a JavaScript transpile for the Argon2 WebAssembly file. This is done through wasm2js that's builtin on emcc. Co-authored-by: wec43 <wec@tutao.de>
This commit adds the generation of a JavaScript transpile for the Liboqs WebAssembly file. This is done through wasm2js that's builtin on emcc. Co-authored-by: wec43 <wec@tutao.de>
0f258f4
to
58e8706
Compare
58e8706
to
ea22296
Compare
ea22296
to
050408a
Compare
Co-authored-by: wec43 <wec@tutao.de>
050408a
to
cb53708
Compare
Nice! I think ideally (and I'm not sure if it's in the scope) we wouldn't need to manually take care of every WASM file. In SDK prototype we have successfully used WASM loader: Line 93 in 05b6b82
maybe we need another plugin(s) so that we can automatically generate the fallback and add the code that conditionally loads one or another |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
I don't think compiled wasm/js should be checked in though. We should also explicitly depend on wasm2js my bad, wasm2js is part of the compilation toolchain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, at least.
We should have test notes, though.
We did agree to remove the compiled artifacts, right? |
Also, for documentation purposes, the build system integration/glue generation is tracked at #6835 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another concern, I think right now we will just rollup the fallback JS into the same bundle as the rest of the crypto? it should be separate, maybe it's own chunk
db3470d
to
28ac208
Compare
This allows WASM/JS fallbacks to use the same interface and reduce the extra type casting once initialized.
28ac208
to
8cd93af
Compare
I remember that for this initial implementation we check in the compiled artifacts and after implementing the integration inside the build process we're going to uncheck them. |
9151e2e
to
6712072
Compare
b4d3023
to
fa91cea
Compare
1d2dba5
to
e4e74e1
Compare
pr #6868 has what needs to be merged in, this one can be closed |
Adds the generation of a JavaScript transpile for Argon2 and Liboqs WebAssembly files. This is done through wasm2js that's builtin on emcc.
Closes #6768
Co-authored-by: wec43 wec@tutao.de