Compilation to wasm
Compilation to wasm does not seem to work. I've tried on several machines and with several commands. The wasm job also seems to have been skipped in recent commits.
Running the command
cargo build --features wasm --target wasm32-unknown-unknown
fails with
fatal error: 'string.h' file not found
when compiling the files in sys/hacl/c.
Running the command
CC=emcc AR=emar cargo build --features wasm --target wasm32-unknown-unknown
fails with
emcc: error: unsupported target: wasm32-unknown-unknown (emcc only supports wasm64-unknown-emscripten and wasm32-unknown-emscripten)
Trying with the wasm32-unknown-emscripten target simply freezes.
I get similar errors when I try to compile independent packages, which have libcrux as dependency, to wasm.
I'm not sure what else to try to get things to compile, but I suspect the issue with the Emscripten compilation. What is needed to get this working again?
WASM support is currently pretty limited because a lot of the underlying C code uses raw 64-bit pointers. We work on integrating a Rust version directly for the legacy C code (see https://github.com/hacl-star/hacl-star/pull/918). But this is work in progress.
Are you interested in a specific algorithm? We could see if we can expose that in the current version.
I was trying to run HMAC compiled to wasm (cf. this pull request)
I think we could make hmac work, SHA2 should be fine. Do you want to take a stab at it? I'm happy to review or give you more concrete pointer if needed.
@bshvass this is related to getting the bigints to work in rust https://github.com/RustCrypto/crypto-bigint/issues/577#issuecomment-2016550215
@bshvass What is the status of this?
I haven't had time to look at it yet, but might have some time soon. @franziskuskiefer, I can take a stab at it; did you have any concrete pointers?
@bshvass we should probably try with hacl-rs (including hmac and bignum), as it would compile to wasm.
This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.
This issue has been closed due to a lack of activity since being marked as stale. If you believe this issue is still relevant, please reopen it with an update or comment.