Closed steida closed 2 years ago
Themis doesn't implement any crypto primitives and uses openssl/boringssl/etc as crypto backends. For wasm themis uses BoringSSL and compiles themis library statically linked with boringssl to wasm library. Most of the final size is boringssl's code. Openpgp.js uses pure JS libraries and builtin JS Crypto API (that not calculated as additional size for library :)
Most of the final size is BoringSSL's code.
This is true. However, libthemis.wasm
does not use all of BoringSSL yet it includes it in its entirety.
Unfortunately, at the moment WasmThemis build disables dead-code elimination at link time. Because of that, the resulting binary is much bigger than it could be. DCE is disabled to work around issues with the toolchain, as my attempts to enable link-time optimizations make Emscripten think that all of WasmThemis is dead code that must be eliminated, resulting in an empty WebAssembly module. Help would be appreciated.
I was going to try Themis wasm, but
libthemis.wasm
file is huge. Even gzipped, it has roughly 1 MB. For a comparison, OpenPGP.js has roughly 100kb. Maybe there is a reason for that, but for simple E2EE, 1MB seems to be too much.