antelle/argon2-browser

Unable to reproduce argon2.wasm file found on website

blake-regalia opened this issue · 5 comments

Building from the master branch with the latest emsdk produces a completely different binary than what is hosted on the demo website. At cursory glance of the WAT formats, the bin from the website (shown on the left) has more exports and seems to target 64-bit platform whereas the output from master (shown on the right) has fewer exports and does not use i64 anywhere.

Screen Shot 2022-12-11 at 18 05 28

The reason I discovered this was because I have not been able to get nearly the same performance (more than 10x slower) compared to the WASM found on the demo site. Was this compiled using different flags? I have tried building on several different platforms but get the same results.

EDIT: I see that the website is CI built via GH workflow, I wonder if the toolchain has changed significantly since then, since I cannot explain the differences.

@blake-regalia Have you ever figured this out? I'm curious too.

no 😢

Ok, so I compiled the latest master branch, and the resulting binary was actually faster than the one on the website. I compiled using the latest emscripten docker image (or in my case podman):
sudo podman run --rm -v $(pwd):/src:Z -u $(id -u):$(id -g) --privileged -it emscripten/emsdk /src/build.sh

Here, only difference is recompilation using latest emscripten:

image

Thanks, i've gotten it to compile correctly now. Although the performance is now the same as the website on my machine at least.