We have introduced support for wasm in librats, which can be fully compiled into wasm code, with the help of emscripten.
In wasm mode, we compile the core part of librats as a Main module
and verifiers
, crypto_wrappers
as Side modules
. They are packaged into emscripten's virtual file system, and could be dynamically linked with dlopen()
at runtime.
For third-party libraries such as dcap
(for verifiers/sgx_ecdsa) and openssl
(for crypto_wrappers/openssl), we statically link them into the corresponding Side modules.
Currently we don't support
attesters
in wasm mode.
please type the following command.
source wasm/emscripten/pre_build.sh
cmake -DRATS_BUILD_MODE="wasm" -H. -Bbuild
make -C build
When the compilation is finished, you can find the results in build/wasm, which contain a sample html that can be opened in a browser.