-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Emit WebAssembly by default #6419
Conversation
…ter mechanism for settings aliases, that ensures we apply any change to all aliases. add basic test ensuring proper output mode in all major optimization modes
…e() and run directly
…_TABLE_* while when emulating in wasm we just have _X
@curiousdannii I agree with you in spirit, a switch to wasm by default feels like it should be at least 1.38. It's just been hard to improve our testing, we have pretty poor coverage on non-linux right now, which makes me uncomfortable to declare 1.38 or merge to master. In any case, though, I think we should merge this PR before 1.38 anyhow, just so we have some time with the change on incoming to stabilize (we'll surely find bugs!). Later on, we can merge it to master and bump to 1.38, and maybe our testing will be better by then too, wishful thinking ;) @caiiiycuk I don't think I can reproduce the problem on chrome 64 or 66: it is slower than firefox, but just a little (0.75 vs 0.5 seconds, it reports). Or is the problem only noticeable in comparison to asm.js? Building locally, I see chrome is indeed slightly slower on wasm, but just 300ms vs 250ms for asm.js. I'm also on Ubuntu 16.04. I mentioned this to @dschuff who said he'd look into it too, maybe he can reproduce it? |
I can confirm that in new beta chrome (v66) for this test initialization time is same as for asm.js and for wasm. But for real project the problem still exists 1.5 sec (asm.js) v 6 sec (wasm). Don't have new test case yet. |
I updated the release proposal in #6174. The new proposal there makes it more practical to merge to master / bump the major version number. If that proposal is accepted, then I'd suggest we land this as follows:
That will give us a reasonably stable version before and after this large change. |
Ok, I think the last comment is the plan then. I'll wait a few days to see if incoming's last tag is stable (1.37.38) or if anyone has any concerns, then move forward if things look good. |
Is this moving forward? |
Hit some unrelated delays due to CI problems, but should land later this week. In more detail: As of an hour ago there is a tagged version (1.37.40) that should be good. If no new issues are found later this week, I'll merge that to master, and then merge this branch to incoming. |
Thanks! |
…n 1.0.17 Alexander Iljin (1): + Alexander Ilin for Factor bindings Anton Maklakov (1): Fix warnings that appeared in GCC7+ (related to -Wimplicit-fallthrough) Daniel Persson (4): Added configuration option to change the configuration flags. Change so all builds will allow full builds. Change so we set depending on a full build flag. I turned it around. David Carlier (1): Provides explicit_memset supports/NetBSD. Emil Bay (1): Missing test for abytes Frank Denis (166): We really don't need an intermediate variable here Use a simple memory pool for benchmarks + #include <limits.h> Sort Make things more explicit Add missing sodium_free() calls in the kdf test Add a memleak checker to the benchmark code Undefine printf if required Disable ssp on HaikuOS Enable 128-bit arithmetic clang+systems with NEON Back to dev mode Do not assume that __clang__ being defined implied __GNUC__ defined as well Prefer the system version of nodejs to the emscripten one Emscripten: bump the memory up for the tests emscripten: stick to the unique randombytes implementation Use default randombytes implementation for tests on emscripten Remove unused LOAD128() and STORE128() macros Extra braces Brace yourself Add extra align statements Lift alignment requirements in crypto_generichash() Require the generichash state to be aligned Static Emscripten: run the tests in benchmark mode Javascript tests: don't call FS.*() if the filesystem module is not present Remove the dummy FS call from the Javascript tests C++ compat emscripten: export Pointer_stringify() for recent emscripten versions emscripten: export _malloc() and _free() emscripten: move the set of exported runtime methods Export setValue, getValue emscripten: malloc() and free() should be exported as library symbols Rather than checking for emscripten, perform a 128-bit mul Restore the __EMSCRIPTEN__ check for 128-bit usage Disable LTO in ios/osx build scripts Use (""::"r"(pnt):"memory") instead of (""::"p"(pnt)) for the barrier Check if we can use inline asm code, not only on x86_64 2018 Check for -mretpoline / -zretpolineplt support Who's still using XCode < 8 ? Check for __aarch64__ instead of __ARM_NEON for 128-bit arithmetic Solaris Studio apparently supports __attribute__() emscripten: do not use closure Revert "Solaris Studio apparently supports __attribute__()" Signatures: do not reject weak public keys if ED25519_COMPAT is defined Swap #ifdef branches for clarity Revert "Check for -mretpoline / -zretpolineplt support" Keep things simple; directly initialize the example RNG from the system one Include <stdint.h> for SIZE_MAX, and <stddef.h> as a dependency Include limits.h for ancient Android NDKs. Sigh. Add retpoline support for clang Use only -mindirect-branch=thunk / -mretpoline for now Embed bitcode in iOS builds wasm bug check: use a function more likely to be present in minimal builds Hide getconf errors Check NPROCESSORS_ONLN in addition to _NPROCESSORS_ONLN + lgtm.yml Introduce pwhash_ntlm() for low-sodium, salt-free password hashing This reverts commit 38b19412e87a679a566a08d5b042b9a8fe56ecc5. zap trailing spaces Visual Studio documentation states that eax/ecx/edx don't need to be Clarify what --disable-asm does Nits Invert (1-y) just before the multiplication by (1+y) for readability memchr() can process its input in any order strnlen() may not be available everywhere xchacha20 test: initialize the full nonce Indent Emscripten: remove -s NO_FILESYSTEM=1 Update ChangeLog Add x25519 test vectors from project wycheproof x25519_ref: ignore the high bit in the small order PK check Remove unneeded trailing commas Add aes256gcm tests from project wycheproof Add chacha20-poly1305 test from Project Wycheproof Update ChangeLog Call misuse() if we ask too much data from the IETF variant of ChaCha20 Add crypto_stream_chacha20_ietf_ext, use _ext suffix everywhere for consistency Don't mix lengths and block sizes Do not count the overhead in xchacha20poly1305_MESSAGEBYTES_MAX Allow ic + mlen to overflow a size_t in chacha20_ietf_xor_ic() Make this warning more difficult to ignore Do not even use untested code in non-production environments Substract the number of blocks, and make similar code more uniform No need to provison for the tag if we are below SIZE_MAX Add getrandom(2) support for FreeBSD 12 TinyC now crashes on Travis when compiling sysrandom Revert "TinyC now crashes on Travis when compiling sysrandom" Revert "Add getrandom(2) support for FreeBSD 12" Add getrandom(2) support for FreeBSD 12 Add a dummy return value Add incomplete nonnull attributes Avoid memset(NULL, _, 0) Make watchos.sh looks like other scripts watchOS arm64 is actually arm64_32 Disable AVX512 when using ancient versions of GCC LONG_LONG_* -> LLONG_* Merge old compiler detection with AVX512f support detection Even in non-deterministic EdDSA, the actual secret key is H(sk). Add unclamped versions of scalarmult_ed25519*() Add tests for unclamped scalars Add crypto_core_ed25519_{scalar_invert, ed25519_scalar_reduce)() Regen emscripten symbols Export crypto_core_ed25519_scalar_reduce, add tests Add crypto_core_ed25519_scalar_random() Correct sc25519_reduce() prototype Add a guideline Use a guard page instead of NULL for opt arguments in tests Add a test for scalar_reduce() Leverage sodium_add() Update ChangeLog Add a crypto_core_ed25519_NONREDUCEDSCALARBYTES constant In prototypes, use pointers, not arrays for consistency Update emscripten symbols Add low-level kx_curve25519 functions Add crypto_kx_ed25519 Regen emscripten symbols ED25519_NONDETERMINISTIC: derive keys from the seed the same way Revert "Add crypto_kx_ed25519" and "Add low-level kx_curve25519 functions" Make allocate_memory() error path less confusing Constify Constify Constify, add missing private include Use unsigned indices ISODATE is not used Remove unused variables Add crypto_core_ed25519_scalar_complement(), _negate(), _add(), _sub() Add sodium_sub(), simplify scalar_complement() and scalar_negate() Regen emscripten symbols Bump to 1.0.17 Don't try to enable retpolines on Emscripten & pnacl Emscripten: enable ALLOW_MEMORY_GROWTH 2019 Consistent initialization Add a test for sodium_sub() Nits More paranoid AVX512 detection C++ compat Make the blake2b and poly1305 state opaque Do not assume that CRYPTO_ALIGN works Add an extra compile-time assertion Avoid negative indices, especially with unsigned types Add comments Add comments, avoid implicit array initialization must -> should Add a conditional to enable retpoline support AVX512 detection has been improved ALLOW_MEMORY_GROWTH is now enabled Improve clarity More tests More tests Bump SODIUM_LIBRARY_VERSION_MINOR Avoid partial array initialization Avoid memory leak and overflow in addition test Add another test Bump .NET version examples Set nonce in randombytes_salsa20_random_stir() instead of random_init() Enable -ftls-model=global-dynamic if available Set tls-model only if TLS is supported local-dynamic is enough 2019 fileinput is not used any more Offline documentation is only available in PDF format now Bump DLL version Nits undef _box_curve25519xchacha20poly1305_messagebytes_max in !sumo builds Ilya Maykov (1): Made sig parameter of crypto_sign_final_verify() const Jakob Rieck (1): Fixes padding for blocksizes > 256 Joseph Ross (1): Add `dist-build` script to build libsodium for WatchOS. Loganaden Velvindron (1): Add spectre v2 migitations for GCC Marco (1): Fix broken link to documentation in README Ruslan Baratov (1): Remove '*.cmake' pattern from .gitignore Ryan Lester (8): updates for latest emscripten Closure fix run-time wasm test before resolving ready fix for emscripten breaking change (emscripten-core/emscripten#6419) iOS fix style consistency fix asm.js fallback fix useBackupModule getRandomValue fix Simon Warta (1): Remove obsolete setting FUNCTION_POINTER_ALIGNMENT SlavSlavov (2): Update Findsodium.cmake Update Findsodium.cmake Tom Auger (1): Use _MESSAGEBYTES_MAX in crypto_aead_xchacha20poly1305 enkore (1): README: link to libsodium-doc repository joshjdevl (1): using POSIX getconf for number of available processors http://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html * Version 1.0.17 - Bug fix: `sodium_pad()` didn't properly support block sizes >= 256 bytes. - JS/WebAssembly: some old iOS versions can't instantiate the WebAssembly module; fall back to Javascript on these. - JS/WebAssembly: compatibility with newer Emscripten versions. - Bug fix: `crypto_pwhash_scryptsalsa208sha256_str_verify()` and `crypto_pwhash_scryptsalsa208sha256_str_needs_rehash()` didn't return `EINVAL` on input strings with a short length, unlike their high-level counterpart. - Added a workaround for Visual Studio 2010 bug causing CPU features not to be detected. - Portability improvements. - Test vectors from Project Wycheproof have been added. - New low-level APIs for arithmetic mod the order of the prime order group: `crypto_core_ed25519_scalar_random()`, `crypto_core_ed25519_scalar_reduce()`, (NEWS truncated at 15 lines) Key imported: --list-packet: # off=0 ctb=99 tag=6 hlen=3 plen=525 :public key packet: version 4, algo 1, created 1423560719, expires 0 pkey[0]: [4096 bits] pkey[1]: [17 bits] keyid: 210627AABA709FE1 # off=528 ctb=b4 tag=13 hlen=2 plen=33 :user ID packet: "Frank Denis <github@pureftpd.org>" # off=563 ctb=88 tag=2 hlen=2 plen=70 :signature packet: algo 17, keyid 926BC5171CDEA439 --fingerprint: pub rsa4096 2015-02-10 [SC] 54A2 B889 2CC3 D6A5 97B9 2B6C 2106 27AA BA70 9FE1 uid [ unknown] Frank Denis (Jedi/Sector One) <pgp@pureftpd.org> uid [ unknown] Frank Denis <github@pureftpd.org> uid [ unknown] Frank Denis <opstrust@pureftpd.org> uid [ unknown] Frank Denis <frank.denis@corp.ovh.com> uid [ unknown] Frank Denis (Jedi/Sector One) <j@pureftpd.org> uid [ unknown] Frank Denis (Jedi/Sector One) <0daydigest@pureftpd.org> sub rsa4096 2015-02-10 [E] sub rsa4096 2015-02-10 [S]
…n 1.0.19 Alcaro (1): core.c: Make _sodium_crit_init static (#1073) Alistair Evans (3): Adds linux-arm64 binary to the generated nuget package (#1067) Adding linux-arm support for the .net build (#1069) Add multi-plat nuget package testing (#1070) Amin Yahyaabadi (1): build: do not define the sodium target when not found by CMake (#1287) Anton Maklakov (1): Fix warnings that appeared in GCC7+ (related to -Wimplicit-fallthrough) Baptiste Jonglez (1): Make sure config.sub and config.guess are executable (#1024) Dan Browne (1): Add tvOS support for Apple XCFramework generation. David CARLIER (1): DragonFlyBSD supports getrandom too since 5.7 Elie Hage (1): Add support for arm64 watchOS (#1211) Emil Bay (2): Missing test for abytes fix crypto_stream_chacha20_ietf tests (#946) Frank Denis (501): Regen autoconf files Use less memory for the pwhash tests Add a compile-time switch to create non-deterministic signatures crypto_sign(): memzero the nonce after use Use the generalized eddsa algorithm for non-deterministic r sign_keygen(): don't hash the secret scalar in non-deterministic mode sk is actually skpk, so use the right size in the prototype Repair crypto_sign_ed25519_seed_keypair() Just use constants instead of macros Update AUTHORS emscripten: actually print the installation prefix memcpy() -> memmove() in case the seed and secret key overlap Fix misleading comment Backport _crypto_sign_ed25519_small_order() changes Regen Makefile.in Don't hardcode the number of rounds Leave and immediately reenter the critical section in sodium_misuse() Tolerate sodium_crit_leave() to be called on an unlocked mutex Ed25519 synthetic nonces: pad to 128 bytes boundaries, not 16. Symbolically clear the round keys after aes256gcm_(en|de)crypt() Remove *.s from .gitignore secretstream test: provide additional data to lift ambiguity on what is being tested Correct argument names in internal prototype Fix format string sign Casts casts We really don't need an intermediate variable here + #include <limits.h> Sort Add missing sodium_free() calls in the kdf test Plug memory leaks in the pwhash_argon2* tests Undefine printf if required Disable ssp on HaikuOS Regen configure Enable 128-bit arithmetic clang+systems with NEON Regen configure Do not assume that __clang__ being defined implied __GNUC__ defined as well Prefer the system version of nodejs to the emscripten one Emscripten: bump the memory up for the tests emscripten: stick to the unique randombytes implementation Use default randombytes implementation for tests on emscripten Remove unused LOAD128() and STORE128() macros Extra braces Static Emscripten: run the tests in benchmark mode Javascript tests: don't call FS.*() if the filesystem module is not present Remove the dummy FS call from the Javascript tests Brace yourself emscripten: export Pointer_stringify() for recent emscripten versions emscripten: export _malloc() and _free() emscripten: move the set of exported runtime methods Export setValue, getValue emscripten: malloc() and free() should be exported as library symbols Regen configure Disable LTO in ios/osx build scripts Use (""::"r"(pnt):"memory") instead of (""::"p"(pnt)) for the barrier Check if we can use inline asm code, not only on x86_64 Regen configure script 2018 Check for -mretpoline / -zretpolineplt support Regen configure Check for __aarch64__ instead of __ARM_NEON for 128-bit arithmetic Regen configure emscripten: do not use closure Revert "Check for -mretpoline / -zretpolineplt support" Regen configure Include <stdint.h> for SIZE_MAX, and <stddef.h> as a dependency Include limits.h for ancient Android NDKs. Sigh. Embed bitcode in iOS builds wasm bug check: use a function more likely to be present in minimal builds build scripts: compile deprecated functions if LIBSODIUM_FULL_BUILD is defined Regen autoconf scripts zap trailing spaces Visual Studio documentation states that eax/ecx/edx don't need to be Clarify what --disable-asm does Nits memchr() can process its input in any order strnlen() may not be available everywhere xchacha20 test: initialize the full nonce Indent Emscripten: remove -s NO_FILESYSTEM=1 Do not count the overhead in xchacha20poly1305_MESSAGEBYTES_MAX Substract the number of blocks, and make similar code more uniform No need to provison for the tag if we are below SIZE_MAX Add a dummy return value Use chacha20_ietf in the tv_ietf test Avoid memset(NULL, _, 0) Disable AVX512 when using ancient versions of GCC Regen ./configure Merge old compiler detection with AVX512f support detection Regen autoconf Even in non-deterministic EdDSA, the actual secret key is H(sk). Regen Makefile.in 2019 Nits More paranoid AVX512 detection Nits undef _box_curve25519xchacha20poly1305_messagebytes_max in !sumo builds Try -ftree-vectorize and -ftree-slp-vectorize for optimized builds Force clear the high bit in _noclamp variants Coverity Scan is having hosting issues Revert "Coverity Scan is having hosting issues" Typo Don't enable the stack protector on unknown operating systems Regen autoconf Trust another safe arc4random() implementation Remove unnecessary brackets raise() may not be available POSIX threads can be available while mutexes are not implemented Regen Travis: run PPC builds Travis: parallelize builds, not checks Update the top-level solution to Visual Studio 2019 Add Visual Studio 2019 builds Build Visual Studio 2019 binaries Appveyor doesn't have Visual Studio 2019 yet Downgrade the TL solution for AppVeyor again sync Update the dotnet-core release script Recompress logo Indent regen-msvc.py Sort .gitignore constcheck: ignore deprecated declarations Additional salsa20 tests Remove useless tests, add more meaningful ones. Just use some test vectors around the counter overflow Be positive Make the stream and stream2 test object code 1000x smaller Regen builds/Makefile.in to include MSVC 2019 files Automatically update config.{sub,guess} in autogen.sh Regen, update config.{guess, sub} Export UTF8ToString Findsodium.cmake didn't properly return the package version Shorten autogen.sh: make config.guess update optional Remove an unreliable scrypt test Support the enterprise version of Visual Studio Update appveyor version Update config.guess Add support for Azure Pipelines Parallelize MinGW32 builds on Azure Pipelines Add Azure Pipelines build status Update status badge Update AppVeyor Nits 10% speedup on AVX2 for BLAKE2b Comment 1.0.18 ChangeLog nits Fix Findsodium.cmake SODIUM_VERSION_STRING regex Revert "scrypt: reject r == 0 and p == 0" Use MAP_CONCEAL on OpenBSD Add explicit "env" command More DEV_MODE Remove useless macros hiding the actual symbol names Rename PBKDF2_SHA256 to escrypt_PBKDF2_SHA256 Rename a few common internal symbols Rename fill_segment_* to argon2_fill_segment_* Rename the remaining unprefixed functions common.h -> private/common.h Update config.guess Style: remove unneeded extern argon2_pick_best_implementation() can be static Indent .travis.yml with prettier lucetc-wasi requires units with --max-heap-size Try to find the WASI libc in the new and the current default locations Nits Disable AVX512 Argon2 implementation on MacOS Revert "Disable AVX512 Argon2 implementation on MacOS" Revert "Revert "Disable AVX512 Argon2 implementation on MacOS"" Update config.sub Try installing wasmtime instead of wasmer Update config.guess Use AC_LINK_IFELSE instead of _COMPILE_IFELSE for cpuid detection Use AC_LINK_IFELSE for everything using inline assembly Add a workaround for broken Xcode 11 beta versions Temporarily disable getentropy()/getrandom() when using ASAN Update wasi-sdk and use rust-beta, currently required to build wasmtime WASI can't read its own writes without an explicit fflush() Add support for Twizzler Revert "Try installing wasmtime instead of wasmer" Install precompiled wasmer The wasmer path is lost between tasks Use -fno-stack-check as an alternative to -ffreestanding Update wasi-sdk Lucet removed the "fast" optimization level Try Lucet as a last option, after wasmer, due to its unstable interface Deprecate crypto_core_ed25519_from_hash() Better getentropy() usability checks Use AX_ADD_FORTIFY_SOURCE Regen Undefine _FORTIFY_SOURCE on MinGW - Required for current MinGW versions Define _FORTIFY_SOURCE only on linux-gnu config.guess fixups Try to build the NuGet packages in the next branch 2020 Set a default page size to 64K (wasm/linux large pages) Remove duplicate -fembed-bitcode Temporarily remove support for Lucet Add wasm3 to the set of supported WebAssembly runtimes update build-aux Remove sandy2x fixed base scalar multiplication travis-ci.org -> travis-ci.com Simplify integerify() Reformat comments Remove XOP stub New automake version Remove useless self inclusion Replace deprecated function in test Pipelines: use wasi-sdk 8, remove vs2015-win2012r2 Apparently, wasi-sdk-9 only works on Ubuntu 18.04 Rename fe25519_scalar_product, use it for all multiplications by A Fix argument order ristretto255_is_canonical(): sync with wasm-crypto One more test vector cannot hurt config.sub update Fix wasi-sdk path Add a scalarmult test to show that the high bit is ignored Simplify scalarmult{2,5} tests config.guess update Update config.sub Additional sc25519 tests Remove unused code Add --fail to curl options Update autogen.sh crypto_box_seal(): copy the key after encryption to support in-place encryption Add extra box_seal() tests Faster sc25519 inversion, with one less squaring Move AC_USE_SYSTEM_EXTENSIONS up Regen Move all build scripts to build-aux Don't use autoreconf Always copy aux files libtoolize copy Print something after auto* are done emscripten: force filesystem inclusion for tests Don't add linker flags with the emscripten target Backport wavm support Don't even include signal.h on WASI Add CodeQL scan Add CodeQL scan Elligator - Faster Chi function Use autogen.sh -s in lgtm box_seal test: don't check empty messages config.guess, config.sub update Disable PIE/PIC/SP/async-unwind on eabi Update config.* to support Apple Silicon Import dist-build/ios-xcframework.s WASI: Put the stack before globals Shorten OSX -> MACOS xcframework: also compile for macOS, rename to apple-xcframework.sh Remove support for Catalyst Bring Catalyst support back, properly forcing cross-compilation Check if the compiler supports the arm64-macos target Validate argon2 lanes before memory cost argon2 - copy raw hash after possible encoding, not before comment config.guess/sub update Shared libraries may not be buildable for Catalyst Include arm64 simulators Remove unused variable in tests emscripten: RUNNING_JS_OPTS has been removed in recent versions Update config.sub Build the watchOS simulators with bitcode Update config.guess MSYS2's CI repository is no more apple-xcframework: add bitcode support to all emulators Update msys2-base Autoconf regen pwhash never supported "in-place" operation - return EINVAL Automake update wasm-ld doesn't support --no-threads any more Bump wasi-sdk version Make the text logo slightly more readable in dark mode Add thumbv7* CPUs CodeQL: remove git checkout HEAD^2 CentOS doesn't exist any more Recognize linux/loongarch Year++ Update msys2 Update config.guess Farewell, Travis Enable GitHub Actions Update config.* Put <meta> tag outside <style> Only run test-globals if it exists Fix typos in comments Braces WASM benchmarks: add lucet and WAMR, update wasmtime & wasmer Add support for SSVM Add support for Node without wasmer-js Remove unused hash2.exp wasm bench: make lucet performance significantly better Update msys2 apt-get update may be required on workflows Move lucet down Regen autoconf Proper check for the check-globals script Add some more base64 decoding tests Regen autoconf files Update some autoconf definitions Fix comment in ristretto255_elligator (#1052) wasi-libc exposes getpid() but it doesn't work without emulation Autoconf update & regen Update project URL and regen autoconf files Format Ubuntu 16.04 has reached EOL and Alpine 3.7 looks really old as well Bump nupkg version Update msys2 Include private/sse2_64_32.h only where SSE2 is required Use assignement + case instead of memcpy() Update config.sub WASI: remove wasi-sdk dependency; build module with zig No need to define the NM and STRIP commands Remove the need for llvm Update msys2 Indent GitHub Actions code qemu is not needed dotnet-core: add aarch64-macos builds Azure Pipelines: build on MSVC 2022 Update Zig to 0.8.1 Add Visual Studio 2022 support wasm-opt: use --strip-debug Revert "wasm-opt: use --strip-debug" 2022 Lucet has reached EOL wasm32-wasi: add /opt/homebrew/bin to the default paths config.sub update Use deterministic signatures for benchmarking edwards25519: faster recovery of the X coordinate Build dotnet core x64 binaries in Ubuntu 16.04 Remove link to offline documentation Sync documentation links with -master Catalyst: iOS 13.1 is the minimum target for Xcode 13 libtool update Add Zig build system azure-pipelines: wasi-sdk is not used any more Simplify scrypt blkcpy()/blkxor() sodium_compare(): cast operands to unsigned int Strip builds scalarmult(): don't use the output as a temporary buffer Update config.sub Win32: SecureZeroMemory may not be available Update build.zig for Zig-current Indent Zig build: enable ARM Crypto Improve AX_CHECK_CATCHABLE_SEGV Regen Azure pipelines: the vs2017-win2016 image doesn't exist any more Azure Pipelines: update Zig to 0.10.0 to compile to WebAssembly/WASI sodium_utils tests: exit() -> _exit() GitHub CI: check compilation with zig cc -mcpu=native -> -mtune=native Nits Repair CFLAGS/ CWFLAGS mixup salsa20: initialize partial block Add -Wno-unknown-pragmas if supported Try using -Ofast / -O3 by default Regen configure script Backport the new AES-GCM implementation to -stable Support memset_explicit() if available dotnet-core: bump GitHub actions versions, and use Ubuntu 18.04 as a base Use current versions of GitHub actions dotnet-core: build on Ubuntu 18.04, don't import backports Current LTS version of Ubuntu is 22.04 -- Test on that one Debian 9 has reached EOL 2 years ago Back to Xenial in order to build code that works on CentOS 7 build.zig: statically compile and install all the tests Add a simple test runner to zig-out/bin/ build.zig: statically compile and install all the tests Add a simple test runner to zig-out/bin/ Use current versions of GitHub actions dotnet core: try to fix build-linux-glibc-arm dotnet core: try fixing run-test-binaries-cross-plat Bump dotnet-core / nuget versions to 1.0.18.3 Stable: check Android support in CI, too build.zig: define a few OS-specific feature macros Windows doesn't have getpid() Tests: disable LTO, strip getrandom() didn't exist on ancient glibc versions getentropy() didn't exist on old glibc versions test/default/run.sh compat with GNU find build.zig: require at least SSE4.1 when targeting x86_64 Ship run.sh test/default/run.sh compat with GNU find build.zig: require at least SSE4.1 when targeting x86_64 Remove unneeded path Compile .NET Linux targets with Zig .NET: use macOS 10.15 as a target instead of 10.13 Bump NuGet pathversion generate-emscripten-symbols.sh: allows the lib path to be overridden Add an AES-GCM test of in-place encryption/decryption Add some additional tests of in-place encryption/decryption On stable, on failed decryption, fill buffer with 0x00 Add a test for aes256gcm_decrypt with long inputs, make it pass Sync the AESNI aes_gcm_decrypt_generic() impl with the ARM one Update the Android NDK Avoid memcmp() with len=0 Update msys2 Don't built shared library for WASI Add the ability to convert tests into benchmarks Add wazero to the list of tested wasm runtimes Remove unused MAX_MEMORY_TESTS constant Running tests with Node requires --experimental-wasm-bigint Node requires an async function to start wasm code Add support for Bun as a WebAssembly runtime Bun requires an absolute path Bun: explicitly print the output of the wasm module to the console Mention that mlock() failing is not a hard error for sodium_malloc() iwasm requires precompilation to get decent speed wasm32-wasi.sh: match the number of iterations from build.zig Skip the misuse handler test when running benchmarks or wasm MSVC: apply patches from Conan to for debugging information 2023 Add a pwhash test with guarded memory; it doesn't hurt apple-xcframework.sh: add the ability to skip simulators On Windows, a ".LIB" file can be either shared or static Use Zig 0.10.1 Azure: update to zig 0.10.1 The --stack-first link option doesn't exist any more Check for iwasm existence before trying to use it Azure Pipelines: use the recommended way to add wasmer to env Update config.sub Use CLOCK_MONOTONIC for benchmarking, if possible emscripten: setting Module.TOTAL_MEMORY doesn't do anything Regen autoconf pwhash: fill output buffer with junk prior to running the actual KDF emscripten: EXTRA_EXPORTED_RUNTIME_METHODS -> EXPORTED_RUNTIME_METHODS emscripten: remove pwhash_* from non-sumo builds emscripten: use different settings for wasm and js builds Remove redundant strip build.zig don't strip in Debug mode Add CITATION.cff Define SODIUM_STATIC for Windows static builds Azure Pipelines: remove WASI CI checks for now sodium_utils{2,3} are not worth running in benchmarks config.sub update Revert "Build correctly with IBT and Shadow Stack (#1289)" Add proper CET support (followup to #1290) (#1291) Remove --experimental-wasm-bigint for the tests using Node config.sub update Update for Zig 0.11 Update CI for Zig 0.11.0 Remove fix for ARM Require/enable AVX for AES256-GCM Build shared libraries again, even on Windows Only create a shared library where we know it works Reorder Update resource.rc Copy libsodium.sln from Visual Studio 2019 to Visual Studio 2022x scrypt_nosse: no need to use void * in integerify() scrypt_integerify_sse: be consistent with the no_sse version scrypt_nosse: Remove the 64-bit version of blkxor() Update m4 scripts Regen Simplify how non-deterministic ed25519 nonces are computed Sync build.zig with 1.0.19 and 1.0.20 Backport aarch64 support for aes256-gcm Add memory fences where supported Support gcc-like and C11-like memory fences Add support for VisionOS Sync wasi-test-wrapper.sh and wintest.bat Add ge25519_clear_cofactor() Move sodium implementations out of their dedicated directory Update msys2 Enable more SIMD optimizations when using Zig .NET: target baseline CPU Downgrade ax_valgrind_check Add Visual Studio 2022 build files to the dist tarballs build.zig: predefine some CPU features .NET: assume at least a Sandybridge CPU for x86_64 .NET packages Define additional capabilities when using Visual Studio Visual Studio: define __ARM_NEON on Windows/ARM Update ChangeLog Remove unused variables Upgrade Android NDK Nits Nits Indent define randombytes_set_implementation argument to be const (#1068) Inline Don't hardcode type sizes Support ARM Morello aarch64: try harder when checking for the crypto extensions Regen Regen Forgotten attribute pop Handle SIGPROT, CHERI's in-address space security exception Use ANDROID_CPU_ARM64_FEATURE_AES for AES detection on Android/aarch64 Bump osx.sh -> macos.sh Add support for HKDF Add AEGIS AEADs Visual Studio: add Windows/ARM64 support Update the ChangeLog Move Appveyor CI scripts to ci/appveyor Remove expected length from the pwhash_str_verify()/needs_rehash() Sync build scripts with 1.0.20 Promote HKDF to minimal builds Port the GCC target changes for aarch64 to aegis Greg Hazel (1): android-build.sh: exit with return code 1 if the NDK is not present Ilya Maykov (1): Relax most __attribute__ ((nonnull)) to allow 0-length inputs to be NULL. Jakob Rieck (1): Fixes padding for blocksizes > 256 Javier Navarro (1): ios: remove the support for bitcode (#1210) Jørgen P. Tjernø (1): Portability improvements (#1105) Loup Vaillant (1): Avoid memmove() call when buffers are already the same. (#935) Luca Boccassi (1): Add -pthread to pkgconfig's Libs.private if enabled Michael Ellery (1): CMake find module fixes for static linking: (#621) Ruslan Baratov (1): Remove '*.cmake' pattern from .gitignore Ryan (1): s/eabi/eabi*/g in configure scripts to support eabihf (#977) Ryan Lester (9): updates for latest emscripten Closure fix run-time wasm test before resolving ready fix for emscripten breaking change (emscripten-core/emscripten#6419) iOS fix asm.js fallback fix useBackupModule getRandomValue fix workaround for error caused by latest emscripten fix for asm.js async loading Scr3amer (3): Define TLS as _Thread_local if the compiler supports C11 (#1304) Do not redefine _mm_roti_epi64 if xop target feature is enabled. (#1305) Add missing undef in _mm_roti_epi64 definition for blake2b-ssse3 (#1306) Sean Mollet (1): Put the packaging line for nuget back in (#1164) Siddhesh Poyarekar (1): Build correctly with IBT and Shadow Stack (#1289) Simon Wachter (1): emscripten: build with NODEJS_CATCH_REJECTION=0 (#1025) Simon Warta (1): Remove obsolete setting FUNCTION_POINTER_ALIGNMENT SlavSlavov (2): Update Findsodium.cmake Update Findsodium.cmake Steve Thomas (1): Clear decrypted block from stack (#1190) Tim Gates (1): docs: fix simple typo, interoperatibility -> interoperability (#1002) Tobias Nießen (1): test: fix two error messages (#1034) Tom Auger (1): Use _MESSAGEBYTES_MAX in crypto_aead_xchacha20poly1305 Yi (1): Update wasi-test-wrapper: SSVM was renamed to WasmEdge (#1179) bas-d (1): Properly check if console exists. bfren (2): [dotnet core] build for linux-musl-arm64 (#1174) Include linux-musl-arm in NuGet packages (#1234) ektrah (7): Build NuGet package using GitHub Actions Update packaging for .NET Core Update packaging for .NET Core Update packaging for .NET Core Update packaging for .NET Core Pack the NuGet package with .NET 5.0 (#1009) Use .NET 6.0 SDK to build and test the NuGet package (#1175) infinitydev (1): Fix build on z/OS using XLC (#1089) martingd (1): Error from argon2_hash() during verify propagated. (#1039) willclarktech (1): Set NODEJS_CATCH_EXIT=0 in emscripten LDFLAGS 谭九鼎 (1): Add -S for curl
This changes the default output from asm.js to WebAssembly. Only the default is changed - we of course still support asm.js, and will for a very long time. But changing the default makes sense as the recommended output for most use cases should be WebAssembly, given it has shipped in all major browsers and platforms and is more efficient than asm.js.
The main changes in this PR are:
Some tricky things:
also_asmjs
as a property and a variable, and check both?) - cc @dschuff./configure
etc., I disabled wasm. This is much simpler, as without wasm we have just a single file, with sync startup, and don't depend on wasm support in the VM (e.g., maybe the VM has no wasm support and the user will build to asm.js later anyhow). But, maybe there is some issue here I am missing.Otherwise, the PR should be mostly straightforward. I split off all the trickier parts I could into separate PRs that have all landed already.