diff --git a/.gitignore b/.gitignore
index ab2bf5abeef82e3d67fdea5a54ebf40c064e15e0..c842285d3db882666d7f4ba50b6073852d70cf5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ libsodium-nativeclient
 libsodium-nativeclient-*
 libsodium-osx
 libsodium-uninstalled.pc
+libsodium-wasm32-wasi
 libsodium-win32
 libsodium-win64
 libsodium.pc
@@ -76,7 +77,6 @@ src/libsodium/*.def
 src/libsodium/include/sodium/version.h
 stamp-*
 test-driver
-test/default/browser
 test/default/*.asm.js
 test/default/*.res
 test/default/*.trs
@@ -99,15 +99,17 @@ test/default/box_easy
 test/default/box_easy2
 test/default/box_seal
 test/default/box_seed
+test/default/browser
 test/default/chacha20
 test/default/codecs
-test/default/core_ed25519
 test/default/core1
 test/default/core2
 test/default/core3
 test/default/core4
 test/default/core5
 test/default/core6
+test/default/core_ed25519
+test/default/core_ristretto255
 test/default/ed25519_convert
 test/default/generichash
 test/default/generichash2
@@ -128,12 +130,13 @@ test/default/pwhash_scrypt
 test/default/pwhash_scrypt_ll
 test/default/randombytes
 test/default/scalarmult
-test/default/scalarmult_ed25519
 test/default/scalarmult2
 test/default/scalarmult5
 test/default/scalarmult6
 test/default/scalarmult7
 test/default/scalarmult8
+test/default/scalarmult_ed25519
+test/default/scalarmult_ristretto255
 test/default/secretbox
 test/default/secretbox2
 test/default/secretbox7
diff --git a/.travis.yml b/.travis.yml
index a0d298fecef789e2d20b4523ac17bbdd05550a76..291271c7baffc10b2ce6fbfb2a8f6d5c76b7e13d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,22 +12,32 @@ compiler:
 
 install:
  - ./autogen.sh
- - env CC=tcc CFLAGS='-w' ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log
+ - env CC=tcc CFLAGS='-w' CPPFLAGS="-DDEV_MODE=1" ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log
  - make -j $(nproc) && make check && make install
  - env CC=tcc CPPFLAGS='-I/tmp/include' LDFLAGS='-L/tmp/lib' LD_LIBRARY_PATH='/tmp/lib' ./test/constcheck.sh
  - make uninstall
  - make distclean
 
 script:
- - ./configure --disable-dependency-tracking
+ - env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
  - if [ "$TRAVIS_OS_NAME" = 'linux' -a "$CC" = 'gcc' ]; then make -j $(nproc) CFLAGS='-g0' > /dev/null && cp src/libsodium/.libs/libsodium.so lib.so && make clean > /dev/null && make CFLAGS='-g0' CPPFLAGS='-DSODIUM_C99\(X\)=' > /dev/null && cp src/libsodium/.libs/libsodium.so lib-oldc.so && cmp lib.so lib-oldc.so && echo No binary changes && make clean > /dev/null ; fi
  - make distcheck
  - make distclean > /dev/null
- - ./configure --disable-dependency-tracking --enable-minimal
+ - CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --enable-minimal
+ - make -j $(nproc)
  - make check
  - ( echo '#include <sodium.h>' ; echo 'int main(void) { return sodium_init(); }' ) > /tmp/main.c && gcc -Isrc/libsodium/include -Isrc/libsodium/include/sodium $(find src -name '*.c' -o -name '*.S') /tmp/main.c
+ - make distclean > /dev/null
+
+after_success:
+ - CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --host=powerpc-linux-gnu
+ - make -j $(nproc)
+ - env QEMU_LD_PREFIX=/usr/powerpc-linux-gnu make check
+ - make clean > /dev/null
 
 addons:
   apt:
     packages:
       - tcc
+      - qemu-user-static
+      - gcc-powerpc-linux-gnu
diff --git a/AUTHORS b/AUTHORS
index 39e55f6288a951e19a6d63aa0f612b05c7b3a895..f4a4b9d88289663ae7ac218cdf709e7fd5b30f31 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -28,6 +28,13 @@ ed25519                                Daniel J. Bernstein
 
 poly1305                               Daniel J. Bernstein
 
+ristretto                              Mike Hamburg
+                                       Henry de Valence
+                                       Jack Grigg
+                                       George Tankersley
+                                       Filippo Valsorda
+                                       Isis Lovecruft
+
 salsa20                                Daniel J. Bernstein
 
 scrypt                                 Colin Percival
@@ -56,6 +63,7 @@ crypto_box/curve25519xchacha20poly1305 Frank Denis
 
 crypto_core/ed25519                    Daniel J. Bernstein
                                        Adam Langley
+                                       Frank Denis
 
 crypto_core/hchacha20                  Frank Denis
 
@@ -93,6 +101,8 @@ crypto_scalarmult/curve25519/sandy2x   Tung Chou
 
 crypto_scalarmult/ed25519              Frank Denis
 
+crypto_scalarmult/ristretto255         Frank Denis
+
 crypto_secretbox/xsalsa20poly1305      Daniel J. Bernstein
 
 crypto_secretbox/xchacha20poly1305     Frank Denis
diff --git a/ChangeLog b/ChangeLog
index 22702276067eeac98e8644f19d387442b809785d..e696933869dc34583364f88e9cf3cc0e8fe52c48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,33 @@
 
+* Version 1.0.18
+ - The Enterprise versions of Visual Studio are now supported.
+ - Visual Studio 2019 is now supported.
+ - 32-bit binaries for Visual Studio 2010 are now provided.
+ - A test that didn't work properly on Linux systems with overcommit
+memory turned on has been removed. This fixes Ansible builds.
+ - Emscripten: `print` and `printErr` functions are overridden to send
+errors to the console, if there is one.
+ - Emscripten: `UTF8ToString()` is now exported since `Pointer_stringify()`
+has been deprecated.
+ - Libsodium version detection has been fixed in the CMake recipe.
+ - Generic hashing got a 10% speedup on AVX2.
+ - New target: WebAssembly/WASI (compile with `dist-builds/wasm32-wasi.sh`).
+ - New functions to map a hash to an edwards25519 point or get a random point:
+`core_ed25519_from_hash()` and `core_ed25519_random()`.
+ - `crypto_core_ed25519_scalar_mul()` has been implemented for `scalar*scalar`
+`(mod L)` multiplication.
+ - Support for the Ristretto group has been implemented, for compatibility
+with wasm-crypto.
+ - Improvements have been made to the test suite.
+ - Portability improvements has been made.
+ - `getentropy()` is now used on systems providing this system call.
+ - `randombytes_salsa20 has been renamed to `randombytes_internal`.
+ - Support for (p)nacl has been removed.
+ - Most `((nonnull))` attributes have been relaxed to allow 0-length inputs
+to be `NULL`.
+ - The `-ftree-vectorize` and `-ftree-slp-vectorize` compiler switches are
+now used, if available, for optimized builds.
+
 * 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
diff --git a/README.markdown b/README.markdown
index 61a0ec5ddb87dceab2bfa882892104cd86fc2db4..412693d36bb836380dd38bc66080fa5db3abe417 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1,6 +1,7 @@
 [![Build Status](https://travis-ci.org/jedisct1/libsodium.svg?branch=master)](https://travis-ci.org/jedisct1/libsodium?branch=master)
 [![Windows build status](https://ci.appveyor.com/api/projects/status/fu8s2elx25il98hj?svg=true)](https://ci.appveyor.com/project/jedisct1/libsodium)
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/2397/badge.svg)](https://scan.coverity.com/projects/2397)
+[![Azure build status](https://jedisct1.visualstudio.com/Libsodium/_apis/build/status/jedisct1.libsodium?branchName=stable)](https://jedisct1.visualstudio.com/Libsodium/_build/latest?definitionId=3&branchName=stable)
 
 ![libsodium](https://raw.github.com/jedisct1/libsodium/master/logo.png)
 ============
diff --git a/appveyor.yml b/appveyor.yml
index d0398226cd031ce898c422b7d8407934c5a80826..5fdcdc8a46f6f6d34c801178af19a9a135f634ea 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,6 +1,6 @@
-version: 1.0.10.{build}
+version: 1.0.18.{build}
 
-os: Visual Studio 2015
+os: Visual Studio 2017
 
 environment:
   matrix:
@@ -16,8 +16,7 @@ environment:
 matrix:
   fast_finish: false
 
-init:
-  msbuild /version
+init: msbuild /version
 
 build:
   parallel: true
diff --git a/autogen.sh b/autogen.sh
index 394e6f7a1466283aa068694e1110bb84e9717c13..3743f70629668b0e24e200badd8e1cb94ad188f8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-if glibtoolize --version > /dev/null 2>&1; then
+if glibtoolize --version >/dev/null 2>&1; then
   LIBTOOLIZE='glibtoolize'
 else
   LIBTOOLIZE='libtoolize'
@@ -26,11 +26,28 @@ command -v automake >/dev/null 2>&1 || {
   exit 1
 }
 
-if autoreconf --version > /dev/null 2>&1 ; then
-  exec autoreconf -ivf
+if autoreconf --version >/dev/null 2>&1; then
+  autoreconf -ivf
+else
+  $LIBTOOLIZE &&
+    aclocal &&
+    automake --add-missing --force-missing --include-deps &&
+    autoconf
 fi
 
-$LIBTOOLIZE && \
-aclocal && \
-automake --add-missing --force-missing --include-deps && \
-autoconf
+[ -z "$DO_NOT_UPDATE_CONFIG_SCRIPTS" ] &&
+  command -v curl >/dev/null 2>&1 && {
+  echo "Downloading config.guess and config.sub..."
+
+  curl -sL -o config.guess \
+    'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' &&
+    mv -f config.guess build-aux/config.guess
+
+  curl -sL -o config.sub \
+    'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' &&
+    mv -f config.sub build-aux/config.sub
+
+  echo "Done."
+}
+
+rm -f config.guess config.sub
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b688459b788226b7e9beb841e58fdc9b3a898666
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,153 @@
+trigger:
+  - stable
+  - next
+
+pr: none
+
+jobs:
+  - job: "wasi"
+    pool:
+      vmImage: "ubuntu-16.04"
+    steps:
+      - script: |
+          sudo apt-get install build-essential curl cmake
+        displayName: Install system packages
+      - script: |
+          curl https://sh.rustup.rs -sSf | sh -s -- -y
+          source ${HOME}/.cargo/env
+          git clone --recursive https://github.com/wasmerio/wasmer.git
+          (cd wasmer && cargo install --path .)
+        displayName: Install wasmer
+      - script: |
+          curl -sL -o wasi-sdk.deb https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-5/wasi-sdk_5.0_amd64.deb
+          sudo dpkg -i wasi-sdk.deb && rm -f wasi-sdk.deb
+          sudo ln -s /opt/wasi-sdk/share/*sysroot* /opt/wasi-sysroot
+        displayName: Install the WASI SDK
+      - script: |
+          env PATH=/opt/wasi-sdk/bin:${HOME}/.cargo/bin:$PATH dist-build/wasm32-wasi.sh
+        displayName: Compile libsodium
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: libsodium-wasm32-wasi
+          artifactName: libsodium-wasm32-wasi
+
+  - job: "windows"
+    pool:
+      vmImage: "windows-2019"
+    steps:
+      - powershell: |
+          cd builds\msvc\build
+          & .\buildbase.bat ..\vs2019\libsodium.sln 16
+        displayName: Compile it all
+      - powershell: |
+          mkdir bin\include\sodium
+          Copy-Item "src\libsodium\include\sodium\*.h" -Destination "bin\include\sodium" -Recurse
+          Copy-Item "src\libsodium\include\*.h" -Destination "bin\include\"
+        displayName: Copy header files
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: bin
+          artifactName: libsodium
+
+  - job: "windows_old"
+    pool:
+      vmImage: "vs2017-win2016"
+    steps:
+      - powershell: |
+          cd builds\msvc\build
+          & .\buildbase.bat ..\vs2017\libsodium.sln 15
+        displayName: Compile it all
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: bin
+          artifactName: libsodium
+
+  - job: "windows_reallyold"
+    pool:
+      vmImage: "vs2015-win2012r2"
+    steps:
+      - powershell: |
+          cd builds\msvc\build
+          & .\buildbase.bat ..\vs2015\libsodium.sln 14
+          & .\buildbase.bat ..\vs2013\libsodium.sln 12
+          & .\buildbase.bat ..\vs2012\libsodium.sln 11
+          & .\buildbase.bat ..\vs2010\libsodium.sln 10
+        displayName: Compile it all
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: bin
+          artifactName: libsodium
+
+  - job: mingw64
+    pool:
+      vmImage: "windows-2019"
+    steps:
+      - script: |
+          git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
+          %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git
+        displayName: Install MSYS2
+      - script: |
+          set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syuu
+        displayName: Update MSYS2
+      - script: |
+          set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-toolchain
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc
+          %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf
+        displayName: Install Toolchain
+      - script: |
+          set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin
+          set MSYS2_ROOT=%CD:~0,2%\msys64
+          set MSYSTEM=MINGW64
+          %MSYS2_ROOT%\cmd\msystem MINGW64
+          %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win64.sh
+        env:
+          CHERE_INVOKING: yes
+          MSYS2_ARCH: x86_64
+        displayName: Compile libsodium
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: libsodium-win64
+          artifactName: libsodium-win64
+
+  - job: mingw32
+    pool:
+      vmImage: "windows-2019"
+    steps:
+      - script: |
+          git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
+          %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git
+        displayName: Install MSYS2
+      - script: |
+          set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syuu
+        displayName: Update MSYS2
+      - script: |
+          set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-i686-toolchain
+          %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc
+          %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf
+        displayName: Install Toolchain
+      - script: |
+          set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin
+          set MSYS2_ROOT=%CD:~0,2%\msys64
+          set MSYSTEM=MINGW32
+          %MSYS2_ROOT%\cmd\msystem MINGW32
+          %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win32.sh
+        env:
+          CHERE_INVOKING: yes
+          MSYS2_ARCH: x86_64
+        displayName: Compile libsodium
+      - task: PublishBuildArtifacts@1
+        condition: not(canceled())
+        inputs:
+          pathToPublish: libsodium-win32
+          artifactName: libsodium-win32
diff --git a/builds/Makefile.am b/builds/Makefile.am
index 4d0cc4698b3151f204b5bc6eca4023a90734121a..23dfe9d2336fc3d76cfc9df6c6d3e40614b6e92b 100644
--- a/builds/Makefile.am
+++ b/builds/Makefile.am
@@ -62,4 +62,11 @@ EXTRA_DIST = \
 	msvc/vs2017/libsodium/libsodium.xml \
 	msvc/vs2017/libsodium.import.props \
 	msvc/vs2017/libsodium.import.xml \
-	msvc/vs2017/libsodium.sln
+	msvc/vs2017/libsodium.sln \
+	msvc/vs2019/libsodium/libsodium.props \
+	msvc/vs2019/libsodium/libsodium.vcxproj \
+	msvc/vs2019/libsodium/libsodium.vcxproj.filters \
+	msvc/vs2019/libsodium/libsodium.xml \
+	msvc/vs2019/libsodium.import.props \
+	msvc/vs2019/libsodium.import.xml \
+	msvc/vs2019/libsodium.sln
diff --git a/builds/msvc/build/buildall.bat b/builds/msvc/build/buildall.bat
index d4ab14ac08da6580ce5a3f42fc21dc82464c4355..4f0b421103be5a731cb0530f356a24e6cd0ac640 100644
--- a/builds/msvc/build/buildall.bat
+++ b/builds/msvc/build/buildall.bat
@@ -1,5 +1,7 @@
 @ECHO OFF
 
+CALL buildbase.bat ..\vs2019\libsodium.sln 16
+ECHO.
 CALL buildbase.bat ..\vs2017\libsodium.sln 15
 ECHO.
 CALL buildbase.bat ..\vs2015\libsodium.sln 14
diff --git a/builds/msvc/build/buildbase.bat b/builds/msvc/build/buildbase.bat
index bfc70556c4f7d9550423ade1a7802aacf3e11b03..b68cd2ca84e5751f8ebef380e93117ab0ef65fda 100644
--- a/builds/msvc/build/buildbase.bat
+++ b/builds/msvc/build/buildbase.bat
@@ -1,18 +1,44 @@
 @ECHO OFF
-REM Usage: [buildbase.bat ..\vs2013\mysolution.sln 12]
+REM Usage: [buildbase.bat ..\vs2019\mysolution.sln 16]
+
+SETLOCAL enabledelayedexpansion
 
 SET solution=%1
 SET version=%2
 SET log=build_%version%.log
 SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat
-IF %version% == 15 SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
-SET environment="%programfiles(x86)%\%tools%"
-IF NOT EXIST %environment% SET environment="%programfiles%\%tools%"
-IF NOT EXIST %environment% GOTO no_tools
+
+IF %version% == 16 (
+  SET tools=Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
+  SET environment="%programfiles%\!tools!"
+  IF NOT EXIST !environment! (
+    SET environment="%programfiles(x86)%\!tools!"
+    IF NOT EXIST !environment! (
+      SET tools=Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
+    )
+  )
+)
+
+IF %version% == 15 (
+  SET tools=Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
+  SET environment="%programfiles%\!tools!"
+  IF NOT EXIST !environment! (
+    SET environment="%programfiles(x86)%\!tools!"
+    IF NOT EXIST !environment! (
+      SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
+    )
+  )
+)
+SET environment="%programfiles%\!tools!"
+IF NOT EXIST !environment! SET environment="%programfiles(x86)%\!tools!"
+
+ECHO Environment: !environment!
+
+IF NOT EXIST !environment! GOTO no_tools
 
 ECHO Building: %solution%
 
-CALL %environment% x86 > nul
+CALL !environment! x86 > nul
 ECHO Platform=x86
 
 ECHO Configuration=DynDebug
@@ -34,7 +60,7 @@ ECHO Configuration=StaticRelease
 msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% >> %log%
 IF errorlevel 1 GOTO error
 
-CALL %environment% x86_amd64 > nul
+CALL !environment! x86_amd64 > nul
 ECHO Platform=x64
 
 ECHO Configuration=DynDebug
@@ -64,7 +90,7 @@ ECHO *** ERROR, build terminated early, see: %log%
 GOTO end
 
 :no_tools
-ECHO *** ERROR, build tools not found: %tools%
+ECHO *** ERROR, build tools not found: !tools!
 
 :end
 
diff --git a/builds/msvc/resource.rc b/builds/msvc/resource.rc
index db9c5226ebdc463df3777ebc82789e70ed8902aa..feb27d5aa00d466fb505ef15e8b26aef39d0a5d6 100644
--- a/builds/msvc/resource.rc
+++ b/builds/msvc/resource.rc
@@ -4,8 +4,8 @@
 #include "windows.h"
 
 //specify the version numbers for the dll's
-#define LIBSODIUM_VERSION_STRING "1.0.17.0"
-#define LIBSODIUM_VERSION_BIN 1,0,17,0
+#define LIBSODIUM_VERSION_STRING "1.0.18.0"
+#define LIBSODIUM_VERSION_BIN 1,0,18,0
 
 //specify the product name for the dlls based on the platform we are compiling for
 #if defined(x64)
diff --git a/builds/msvc/version.h b/builds/msvc/version.h
index 031d298fbc1084dc9ac721ae275a3cd1ebe4907e..174d9921ed114456dc5cb819ce7a0a28a8c7bfd5 100644
--- a/builds/msvc/version.h
+++ b/builds/msvc/version.h
@@ -4,10 +4,10 @@
 
 #include "export.h"
 
-#define SODIUM_VERSION_STRING "1.0.17"
+#define SODIUM_VERSION_STRING "1.0.18"
 
 #define SODIUM_LIBRARY_VERSION_MAJOR 10
-#define SODIUM_LIBRARY_VERSION_MINOR 2
+#define SODIUM_LIBRARY_VERSION_MINOR 3
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/builds/msvc/vs2010/libsodium/libsodium.vcxproj b/builds/msvc/vs2010/libsodium/libsodium.vcxproj
index ec340a17af86f8e0e3490b74364ed78c194160bd..ad3cb0866bf12b428f1bdf7c1147f1379381e435 100644
--- a/builds/msvc/vs2010/libsodium/libsodium.vcxproj
+++ b/builds/msvc/vs2010/libsodium/libsodium.vcxproj
@@ -126,6 +126,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -138,8 +139,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
@@ -181,6 +181,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -200,7 +201,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
@@ -210,6 +210,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
@@ -217,6 +218,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -227,7 +229,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -246,6 +247,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters
index 079094b915526c92ed1ada9edaf651c4975258f7..055b7476713a28093953ccc7b15e47e9cd878dbe 100644
--- a/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters
+++ b/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters
@@ -171,6 +171,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>crypto_scalarmult</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>crypto_scalarmult\ed25519\ref10</Filter>
     </ClCompile>
@@ -207,11 +210,8 @@
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>randombytes\sysrandom</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>randombytes\salsa20</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
-      <Filter>randombytes\nativeclient</Filter>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
       <Filter>crypto_box</Filter>
@@ -336,6 +336,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>crypto_core\ed25519</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>crypto_core\ed25519\ref10</Filter>
     </ClCompile>
@@ -389,9 +392,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -419,6 +419,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -440,6 +443,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -470,9 +476,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -527,6 +530,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -880,6 +886,12 @@
     <Filter Include="crypto_scalarmult\ed25519\ref10">
       <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
     </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
     <Filter Include="crypto_secretbox">
       <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
     </Filter>
@@ -973,11 +985,8 @@
     <Filter Include="randombytes">
       <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="randombytes\nativeclient">
-      <UniqueIdentifier>{fd98b90f-ba7b-3aa0-a505-935c82ca8023}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="randombytes\salsa20">
-      <UniqueIdentifier>{7450ec6e-c197-3798-9434-1b46c8c4d9af}</UniqueIdentifier>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
     </Filter>
     <Filter Include="randombytes\sysrandom">
       <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
diff --git a/builds/msvc/vs2012/libsodium/libsodium.vcxproj b/builds/msvc/vs2012/libsodium/libsodium.vcxproj
index f140d161f7cf1e292a3d2281b49cf8dcd939324e..0954d10bd5c6950d40b43057af0eb354706a9898 100644
--- a/builds/msvc/vs2012/libsodium/libsodium.vcxproj
+++ b/builds/msvc/vs2012/libsodium/libsodium.vcxproj
@@ -126,6 +126,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -138,8 +139,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
@@ -181,6 +181,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -200,7 +201,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
@@ -210,6 +210,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
@@ -217,6 +218,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -227,7 +229,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -246,6 +247,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters
index 079094b915526c92ed1ada9edaf651c4975258f7..055b7476713a28093953ccc7b15e47e9cd878dbe 100644
--- a/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters
+++ b/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters
@@ -171,6 +171,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>crypto_scalarmult</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>crypto_scalarmult\ed25519\ref10</Filter>
     </ClCompile>
@@ -207,11 +210,8 @@
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>randombytes\sysrandom</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>randombytes\salsa20</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
-      <Filter>randombytes\nativeclient</Filter>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
       <Filter>crypto_box</Filter>
@@ -336,6 +336,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>crypto_core\ed25519</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>crypto_core\ed25519\ref10</Filter>
     </ClCompile>
@@ -389,9 +392,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -419,6 +419,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -440,6 +443,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -470,9 +476,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -527,6 +530,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -880,6 +886,12 @@
     <Filter Include="crypto_scalarmult\ed25519\ref10">
       <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
     </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
     <Filter Include="crypto_secretbox">
       <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
     </Filter>
@@ -973,11 +985,8 @@
     <Filter Include="randombytes">
       <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="randombytes\nativeclient">
-      <UniqueIdentifier>{fd98b90f-ba7b-3aa0-a505-935c82ca8023}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="randombytes\salsa20">
-      <UniqueIdentifier>{7450ec6e-c197-3798-9434-1b46c8c4d9af}</UniqueIdentifier>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
     </Filter>
     <Filter Include="randombytes\sysrandom">
       <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
diff --git a/builds/msvc/vs2013/libsodium/libsodium.vcxproj b/builds/msvc/vs2013/libsodium/libsodium.vcxproj
index cddd4ad62b052acb66a48bf24047db69eb217d75..91d7a7c7e66f45a7069f6dfed6f0be6c85cff4c2 100644
--- a/builds/msvc/vs2013/libsodium/libsodium.vcxproj
+++ b/builds/msvc/vs2013/libsodium/libsodium.vcxproj
@@ -126,6 +126,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -138,8 +139,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
@@ -181,6 +181,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -200,7 +201,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
@@ -210,6 +210,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
@@ -217,6 +218,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -227,7 +229,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -246,6 +247,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters
index 079094b915526c92ed1ada9edaf651c4975258f7..055b7476713a28093953ccc7b15e47e9cd878dbe 100644
--- a/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters
+++ b/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters
@@ -171,6 +171,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>crypto_scalarmult</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>crypto_scalarmult\ed25519\ref10</Filter>
     </ClCompile>
@@ -207,11 +210,8 @@
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>randombytes\sysrandom</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>randombytes\salsa20</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
-      <Filter>randombytes\nativeclient</Filter>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
       <Filter>crypto_box</Filter>
@@ -336,6 +336,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>crypto_core\ed25519</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>crypto_core\ed25519\ref10</Filter>
     </ClCompile>
@@ -389,9 +392,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -419,6 +419,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -440,6 +443,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -470,9 +476,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -527,6 +530,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -880,6 +886,12 @@
     <Filter Include="crypto_scalarmult\ed25519\ref10">
       <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
     </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
     <Filter Include="crypto_secretbox">
       <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
     </Filter>
@@ -973,11 +985,8 @@
     <Filter Include="randombytes">
       <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="randombytes\nativeclient">
-      <UniqueIdentifier>{fd98b90f-ba7b-3aa0-a505-935c82ca8023}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="randombytes\salsa20">
-      <UniqueIdentifier>{7450ec6e-c197-3798-9434-1b46c8c4d9af}</UniqueIdentifier>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
     </Filter>
     <Filter Include="randombytes\sysrandom">
       <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
diff --git a/builds/msvc/vs2015/libsodium/libsodium.vcxproj b/builds/msvc/vs2015/libsodium/libsodium.vcxproj
index 230086a924207ed6c3870590cdc674b272e618bd..f97869dd6ecb33b522da7806321d5ac594d2e605 100644
--- a/builds/msvc/vs2015/libsodium/libsodium.vcxproj
+++ b/builds/msvc/vs2015/libsodium/libsodium.vcxproj
@@ -126,6 +126,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -138,8 +139,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
@@ -181,6 +181,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -200,7 +201,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
@@ -210,6 +210,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
@@ -217,6 +218,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -227,7 +229,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -246,6 +247,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters
index 079094b915526c92ed1ada9edaf651c4975258f7..055b7476713a28093953ccc7b15e47e9cd878dbe 100644
--- a/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters
+++ b/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters
@@ -171,6 +171,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>crypto_scalarmult</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>crypto_scalarmult\ed25519\ref10</Filter>
     </ClCompile>
@@ -207,11 +210,8 @@
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>randombytes\sysrandom</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>randombytes\salsa20</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
-      <Filter>randombytes\nativeclient</Filter>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
       <Filter>crypto_box</Filter>
@@ -336,6 +336,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>crypto_core\ed25519</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>crypto_core\ed25519\ref10</Filter>
     </ClCompile>
@@ -389,9 +392,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -419,6 +419,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -440,6 +443,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -470,9 +476,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -527,6 +530,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -880,6 +886,12 @@
     <Filter Include="crypto_scalarmult\ed25519\ref10">
       <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
     </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
     <Filter Include="crypto_secretbox">
       <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
     </Filter>
@@ -973,11 +985,8 @@
     <Filter Include="randombytes">
       <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="randombytes\nativeclient">
-      <UniqueIdentifier>{fd98b90f-ba7b-3aa0-a505-935c82ca8023}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="randombytes\salsa20">
-      <UniqueIdentifier>{7450ec6e-c197-3798-9434-1b46c8c4d9af}</UniqueIdentifier>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
     </Filter>
     <Filter Include="randombytes\sysrandom">
       <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
diff --git a/builds/msvc/vs2017/libsodium/libsodium.vcxproj b/builds/msvc/vs2017/libsodium/libsodium.vcxproj
index 8a175e0be83b740750e2043c9f7b11ebaa943620..b216959de65e712d918b3329ade53761a3d36865 100644
--- a/builds/msvc/vs2017/libsodium/libsodium.vcxproj
+++ b/builds/msvc/vs2017/libsodium/libsodium.vcxproj
@@ -126,6 +126,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -138,8 +139,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
@@ -181,6 +181,7 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -200,7 +201,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
@@ -210,6 +210,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
@@ -217,6 +218,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -227,7 +229,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -246,6 +247,7 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters
index 079094b915526c92ed1ada9edaf651c4975258f7..055b7476713a28093953ccc7b15e47e9cd878dbe 100644
--- a/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters
+++ b/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters
@@ -171,6 +171,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>crypto_scalarmult</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>crypto_scalarmult\ed25519\ref10</Filter>
     </ClCompile>
@@ -207,11 +210,8 @@
     <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>randombytes\sysrandom</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>randombytes\salsa20</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
-      <Filter>randombytes\nativeclient</Filter>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
       <Filter>crypto_box</Filter>
@@ -336,6 +336,9 @@
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>crypto_core\ed25519</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>crypto_core\ed25519\ref10</Filter>
     </ClCompile>
@@ -389,9 +392,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -419,6 +419,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -440,6 +443,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -470,9 +476,6 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>include\sodium</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -527,6 +530,9 @@
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>include\sodium</Filter>
     </ClInclude>
@@ -880,6 +886,12 @@
     <Filter Include="crypto_scalarmult\ed25519\ref10">
       <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
     </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
     <Filter Include="crypto_secretbox">
       <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
     </Filter>
@@ -973,11 +985,8 @@
     <Filter Include="randombytes">
       <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="randombytes\nativeclient">
-      <UniqueIdentifier>{fd98b90f-ba7b-3aa0-a505-935c82ca8023}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="randombytes\salsa20">
-      <UniqueIdentifier>{7450ec6e-c197-3798-9434-1b46c8c4d9af}</UniqueIdentifier>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
     </Filter>
     <Filter Include="randombytes\sysrandom">
       <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
diff --git a/builds/msvc/vs2019/libsodium.import.props b/builds/msvc/vs2019/libsodium.import.props
new file mode 100644
index 0000000000000000000000000000000000000000..b3d7e4fd88d8688705914f5396d2a41c930490e4
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium.import.props
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup Label="Globals">
+    <_PropertySheetDisplayName>Libsodium Import Settings</_PropertySheetDisplayName>
+  </PropertyGroup>
+
+  <!-- User Interface -->
+
+  <ItemGroup Label="BuildOptionsExtension">
+    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)libsodium.import.xml" />
+  </ItemGroup>
+
+  <!-- Linkage -->
+
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libsodium\src\libsodium\include;$(ProjectDir)..\..\..\..\..\libsodium\src\libsodium\include\sodium\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions Condition="'$(Linkage-libsodium)' == 'static' Or '$(Linkage-libsodium)' == 'ltcg'">SODIUM_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies Condition="'$(Linkage-libsodium)' != ''">advapi32.lib;libsodium.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Debug')) != -1">$(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libsodium)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories Condition="$(Configuration.IndexOf('Release')) != -1">$(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libsodium)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+
+  <!-- Copy -->
+
+  <Target Name="Linkage-libsodium-dynamic" AfterTargets="AfterBuild" Condition="'$(Linkage-libsodium)' == 'dynamic'">
+    <Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
+          SourceFiles="$(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libsodium.dll"
+          DestinationFiles="$(TargetDir)libsodium.dll"
+          SkipUnchangedFiles="true" />
+    <Copy Condition="$(Configuration.IndexOf('Debug')) != -1"
+          SourceFiles="$(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Debug\$(PlatformToolset)\dynamic\libsodium.pdb"
+          DestinationFiles="$(TargetDir)libsodium.pdb"
+          SkipUnchangedFiles="true" />
+    <Copy Condition="$(Configuration.IndexOf('Release')) != -1"
+          SourceFiles="$(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Release\$(PlatformToolset)\dynamic\libsodium.dll"
+          DestinationFiles="$(TargetDir)libsodium.dll"
+          SkipUnchangedFiles="true" />
+  </Target>
+
+  <!-- Messages -->
+
+  <Target Name="libsodium-info" BeforeTargets="AfterBuild" Condition="'$(Linkage-libsodium)' == 'dynamic'">
+    <Message Text="Copying libsodium.dll -&gt; $(TargetDir)libsodium.dll" Importance="high"/>
+    <Message Text="Copying libsodium.pdb -&gt; $(TargetDir)libsodium.pdb" Importance="high" Condition="$(Configuration.IndexOf('Debug')) != -1" />
+  </Target>
+
+</Project>
\ No newline at end of file
diff --git a/builds/msvc/vs2019/libsodium.import.xml b/builds/msvc/vs2019/libsodium.import.xml
new file mode 100644
index 0000000000000000000000000000000000000000..dbcf4e5ab06541c4f4d379cd2318350166fe6452
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium.import.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
+  <Rule Name="libsodium-linkage-uiextension" PageTemplate="tool" DisplayName="Local Dependencies" SwitchPrefix="/" Order="1">
+    <Rule.Categories>
+      <Category Name="libsodium" DisplayName="libsodium" />
+    </Rule.Categories>
+    <Rule.DataSource>
+      <DataSource Persistence="ProjectFile" ItemType="" />
+    </Rule.DataSource>
+    <EnumProperty Name="Linkage-libsodium" DisplayName="Linkage" Description="How libsodium will be linked into the output of this project" Category="libsodium">
+      <EnumValue Name="" DisplayName="Not linked" />
+      <EnumValue Name="dynamic" DisplayName="Dynamic (DLL)" />
+      <EnumValue Name="static" DisplayName="Static (LIB)" />
+      <EnumValue Name="ltcg" DisplayName="Static using link time compile generation (LTCG)" />
+    </EnumProperty>
+  </Rule>
+</ProjectSchemaDefinitions>
\ No newline at end of file
diff --git a/builds/msvc/vs2019/libsodium.sln b/builds/msvc/vs2019/libsodium.sln
new file mode 100644
index 0000000000000000000000000000000000000000..0f3f73069541b013ae6fadf2db072ecce611dc62
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium.sln
@@ -0,0 +1,52 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.4
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "libsodium\libsodium.vcxproj", "{A185B162-6CB6-4502-B03F-B56F7699A8D9}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		DynDebug|Win32 = DynDebug|Win32
+		DynDebug|x64 = DynDebug|x64
+		DynRelease|Win32 = DynRelease|Win32
+		DynRelease|x64 = DynRelease|x64
+		LtcgDebug|Win32 = LtcgDebug|Win32
+		LtcgDebug|x64 = LtcgDebug|x64
+		LtcgRelease|Win32 = LtcgRelease|Win32
+		LtcgRelease|x64 = LtcgRelease|x64
+		StaticDebug|Win32 = StaticDebug|Win32
+		StaticDebug|x64 = StaticDebug|x64
+		StaticRelease|Win32 = StaticRelease|Win32
+		StaticRelease|x64 = StaticRelease|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|Win32.Build.0 = DebugDLL|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|x64.ActiveCfg = DebugDLL|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|x64.Build.0 = DebugDLL|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|x64.Build.0 = ReleaseDLL|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|x64.Build.0 = DebugLTCG|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|Win32.Build.0 = DebugLIB|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|x64.ActiveCfg = DebugLIB|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|x64.Build.0 = DebugLIB|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64
+		{A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|x64.Build.0 = ReleaseLIB|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/builds/msvc/vs2019/libsodium/libsodium.props b/builds/msvc/vs2019/libsodium/libsodium.props
new file mode 100644
index 0000000000000000000000000000000000000000..5a23903c4aabb5745a43330b282c50b93299106d
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium/libsodium.props
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup Label="Globals">
+    <_PropertySheetDisplayName>Libsodium Common Settings</_PropertySheetDisplayName>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
+  </PropertyGroup>
+
+  <!-- User Interface -->
+
+  <ItemGroup Label="BuildOptionsExtension">
+    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(ProjectName).xml" />
+  </ItemGroup>
+
+  <!-- Configuration -->
+
+  <ItemDefinitionGroup>
+    <PreBuildEvent>
+      <Command>copy "$(BuildRoot)version.h" "$(RepoRoot)src\libsodium\include\sodium\"</Command>
+    </PreBuildEvent>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(RepoRoot)src\libsodium\include;$(RepoRoot)src\libsodium\include\sodium\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4146;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+      <EnablePREfast>false</EnablePREfast>
+      <PreprocessorDefinitions>inline=__inline;NATIVE_LITTLE_ENDIAN;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">SODIUM_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">SODIUM_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions Condition="'$(Option-amd64asm)' == 'true'">HAVE_AMD64_ASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+
+  <!-- Messages -->
+
+  <Target Name="CustomInfo" BeforeTargets="PrepareForBuild">
+    <Message Text="Will copy $(BuildRoot)version.h -&gt; $(RepoRoot)src\libsodium\include\sodium\version.h" Importance="high"/>
+  </Target>
+
+  <Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
+    <Message Text="Option-amd64asm   : $(Option-amd64asm)" Importance="high"/>
+  </Target>
+
+  <ItemDefinitionGroup>
+    <Link>
+      <AdditionalDependencies>advapi32.lib</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+</Project>
diff --git a/builds/msvc/vs2019/libsodium/libsodium.vcxproj b/builds/msvc/vs2019/libsodium/libsodium.vcxproj
new file mode 100644
index 0000000000000000000000000000000000000000..ce824a9cc5841e91cd4f8612bd4ae9b73c42e835
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium/libsodium.vcxproj
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{A185B162-6CB6-4502-B03F-B56F7699A8D9}</ProjectGuid>
+    <ProjectName>libsodium</ProjectName>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="DebugDLL|Win32">
+      <Configuration>DebugDLL</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseDLL|Win32">
+      <Configuration>ReleaseDLL</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugDLL|x64">
+      <Configuration>DebugDLL</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseDLL|x64">
+      <Configuration>ReleaseDLL</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugLTCG|Win32">
+      <Configuration>DebugLTCG</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseLTCG|Win32">
+      <Configuration>ReleaseLTCG</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugLTCG|x64">
+      <Configuration>DebugLTCG</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseLTCG|x64">
+      <Configuration>ReleaseLTCG</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugLIB|Win32">
+      <Configuration>DebugLIB</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseLIB|Win32">
+      <Configuration>ReleaseLIB</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="DebugLIB|x64">
+      <Configuration>DebugLIB</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="ReleaseLIB|x64">
+      <Configuration>ReleaseLIB</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Configuration">
+    <ConfigurationType Condition="$(Configuration.IndexOf('DLL')) == -1">StaticLibrary</ConfigurationType>
+    <ConfigurationType Condition="$(Configuration.IndexOf('DLL')) != -1">DynamicLibrary</ConfigurationType>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets">
+    <Import Project="$(ProjectDir)..\..\properties\$(Configuration).props" />
+    <Import Project="$(ProjectDir)..\..\properties\Output.props" />
+    <Import Project="$(ProjectDir)$(ProjectName).props" />
+  </ImportGroup>
+  <ItemGroup>
+    <None Include="..\..\..\..\packaging\nuget\package.bat" />
+    <None Include="..\..\..\..\packaging\nuget\package.config" />
+    <None Include="..\..\..\..\packaging\nuget\package.gsl" />
+    <None Include="..\..\..\..\packaging\nuget\package.nuspec" />
+    <None Include="..\..\..\..\packaging\nuget\package.targets" />
+  </ItemGroup>
+  <ItemGroup>
+    <Xml Include="..\..\..\..\packaging\nuget\package.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\crypto_generichash.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\generichash_blake2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ssse3.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-avx2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-sse41.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\generichash_blake2b.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kx\crypto_kx.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\crypto_sign.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\sign_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\obsolete.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\sign.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\keypair.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\open.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\crypto_secretbox.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\crypto_secretbox_easy.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\xsalsa20poly1305\secretbox_xsalsa20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\xchacha20poly1305\secretbox_xchacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\crypto_pwhash.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blake2b-long.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-core.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-avx512f.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-ssse3.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\pwhash_argon2i.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\pwhash_argon2id.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-avx2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-encoding.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\scrypt_platform.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\crypto_scrypt-common.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pwhash_scryptsalsa208sha256.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pbkdf2-sha256.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\nosse\pwhash_scryptsalsa208sha256_nosse.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\sse\pwhash_scryptsalsa208sha256_sse.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_verify\sodium\verify.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\crypto_auth.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha512\auth_hmacsha512.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha512256\auth_hmacsha512256.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe_frombytes_sandy2x.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_invert.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\crypto_onetimeauth.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xsalsa20poly1305\box_curve25519xsalsa20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_curve25519xchacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\codecs.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\runtime.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\core.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\utils.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\version.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\crypto_stream.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\xchacha20\stream_xchacha20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\stream_chacha20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\ref\chacha20_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-avx2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-ssse3.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\stream_salsa20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\ref\salsa20_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-avx2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-sse2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6\salsa20_xmm6.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa2012\stream_salsa2012.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa2012\ref\stream_salsa2012_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa208\stream_salsa208.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa208\ref\stream_salsa208_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\xsalsa20\stream_xsalsa20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\crypto_hash.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha512\hash_sha512.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha512\cp\hash_sha512_cp.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha256\hash_sha256.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha256\cp\hash_sha256_cp.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\xchacha20poly1305\sodium\aead_xchacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\aes256gcm\aesni\aead_aes256gcm_aesni.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\chacha20poly1305\sodium\aead_chacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretstream\xchacha20poly1305\secretstream_xchacha20poly1305.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\salsa\ref\core_salsa_ref.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hchacha20\core_hchacha20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-sse2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-avx2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ssse3.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-sse41.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-avx2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-sse41.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\sign_ed25519_ref10.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa2012.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\utils.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_hchacha20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha256.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_chacha20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_sysrandom.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\runtime.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa208.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_chacha20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xsalsa20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_hsalsa20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign_ed25519.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ed25519.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xsalsa20poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash_blake2b.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign_edwards25519sha512batch.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10_fe_25_5.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10_fe_51.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\sse2_64_32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\common.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\mutex.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\chacha20_ietf_ext.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\implementations.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-ref.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-avx2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-ssse3.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-encoding.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blake2b-long.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-avx512f.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-core.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\crypto_scrypt.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pbkdf2-sha256.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash_ref.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna64.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna32.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\stream_chacha20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\ref\chacha20_ref.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u4.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-ssse3.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u0.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u1.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-avx2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u8.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\stream_salsa20.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\ref\salsa20_ref.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u4.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u0.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u1.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-avx2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u8.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-sse2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6\salsa20_xmm6.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\constants.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\fe.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\base2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\base.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\constants.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\fe.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\base2.h" />
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\base.h" />
+    <ClInclude Include="..\..\resource.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="..\..\resource.rc">
+    </ResourceCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
diff --git a/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters b/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters
new file mode 100644
index 0000000000000000000000000000000000000000..055b7476713a28093953ccc7b15e47e9cd878dbe
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters
@@ -0,0 +1,998 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <None Include="..\..\..\..\packaging\nuget\package.bat">
+      <Filter>packaging</Filter>
+    </None>
+    <None Include="..\..\..\..\packaging\nuget\package.gsl">
+      <Filter>packaging</Filter>
+    </None>
+    <None Include="..\..\..\..\packaging\nuget\package.nuspec">
+      <Filter>packaging</Filter>
+    </None>
+    <None Include="..\..\..\..\packaging\nuget\package.targets">
+      <Filter>packaging</Filter>
+    </None>
+    <None Include="..\..\..\..\packaging\nuget\package.config">
+      <Filter>packaging</Filter>
+    </None>
+    <Xml Include="..\..\..\..\packaging\nuget\package.xml">
+      <Filter>packaging</Filter>
+    </Xml>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="..\..\resource.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\crypto_generichash.c">
+      <Filter>crypto_generichash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\generichash_blake2.c">
+      <Filter>crypto_generichash\blake2b</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ref.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ssse3.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-avx2.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-sse41.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\generichash_blake2b.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-ref.c">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kx\crypto_kx.c">
+      <Filter>crypto_kx</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\crypto_sign.c">
+      <Filter>crypto_sign</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\sign_ed25519.c">
+      <Filter>crypto_sign\ed25519</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\obsolete.c">
+      <Filter>crypto_sign\ed25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\sign.c">
+      <Filter>crypto_sign\ed25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\keypair.c">
+      <Filter>crypto_sign\ed25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\open.c">
+      <Filter>crypto_sign\ed25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\crypto_secretbox.c">
+      <Filter>crypto_secretbox</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\crypto_secretbox_easy.c">
+      <Filter>crypto_secretbox</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\xsalsa20poly1305\secretbox_xsalsa20poly1305.c">
+      <Filter>crypto_secretbox\xsalsa20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretbox\xchacha20poly1305\secretbox_xchacha20poly1305.c">
+      <Filter>crypto_secretbox\xchacha20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\crypto_pwhash.c">
+      <Filter>crypto_pwhash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blake2b-long.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-core.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-avx512f.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-ref.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-ssse3.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\pwhash_argon2i.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\pwhash_argon2id.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-fill-block-avx2.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-encoding.c">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\scrypt_platform.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\crypto_scrypt-common.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pwhash_scryptsalsa208sha256.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pbkdf2-sha256.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\nosse\pwhash_scryptsalsa208sha256_nosse.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256\nosse</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\sse\pwhash_scryptsalsa208sha256_sse.c">
+      <Filter>crypto_pwhash\scryptsalsa208sha256\sse</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_verify\sodium\verify.c">
+      <Filter>crypto_verify\sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\crypto_auth.c">
+      <Filter>crypto_auth</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha512\auth_hmacsha512.c">
+      <Filter>crypto_auth\hmacsha512</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha512256\auth_hmacsha512256.c">
+      <Filter>crypto_auth\hmacsha512256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c">
+      <Filter>crypto_auth\hmacsha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c">
+      <Filter>crypto_kdf</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
+      <Filter>crypto_kdf\blake2b</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
+      <Filter>crypto_shorthash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c">
+      <Filter>crypto_shorthash\siphash24</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c">
+      <Filter>crypto_shorthash\siphash24</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c">
+      <Filter>crypto_shorthash\siphash24\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c">
+      <Filter>crypto_shorthash\siphash24\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
+      <Filter>crypto_scalarmult</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>crypto_scalarmult\ristretto255\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
+      <Filter>crypto_scalarmult\ed25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c">
+      <Filter>crypto_scalarmult\curve25519</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe_frombytes_sandy2x.c">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_invert.c">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.c">
+      <Filter>crypto_scalarmult\curve25519\ref10</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\crypto_onetimeauth.c">
+      <Filter>crypto_onetimeauth</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.c">
+      <Filter>crypto_onetimeauth\poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.c">
+      <Filter>crypto_onetimeauth\poly1305\donna</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c">
+      <Filter>crypto_onetimeauth\poly1305\sse2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\randombytes.c">
+      <Filter>randombytes</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
+      <Filter>randombytes\sysrandom</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\randombytes\internal\randombytes_internal_random.c">
+      <Filter>randombytes\internal</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_easy.c">
+      <Filter>crypto_box</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box_seal.c">
+      <Filter>crypto_box</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\crypto_box.c">
+      <Filter>crypto_box</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xsalsa20poly1305\box_curve25519xsalsa20poly1305.c">
+      <Filter>crypto_box\curve25519xsalsa20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_curve25519xchacha20poly1305.c">
+      <Filter>crypto_box\curve25519xchacha20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_box\curve25519xchacha20poly1305\box_seal_curve25519xchacha20poly1305.c">
+      <Filter>crypto_box\curve25519xchacha20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\codecs.c">
+      <Filter>sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\runtime.c">
+      <Filter>sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\core.c">
+      <Filter>sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\utils.c">
+      <Filter>sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\sodium\version.c">
+      <Filter>sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\crypto_stream.c">
+      <Filter>crypto_stream</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\xchacha20\stream_xchacha20.c">
+      <Filter>crypto_stream\xchacha20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\stream_chacha20.c">
+      <Filter>crypto_stream\chacha20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\ref\chacha20_ref.c">
+      <Filter>crypto_stream\chacha20\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-avx2.c">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-ssse3.c">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\stream_salsa20.c">
+      <Filter>crypto_stream\salsa20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\ref\salsa20_ref.c">
+      <Filter>crypto_stream\salsa20\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-avx2.c">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-sse2.c">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6\salsa20_xmm6.c">
+      <Filter>crypto_stream\salsa20\xmm6</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa2012\stream_salsa2012.c">
+      <Filter>crypto_stream\salsa2012</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa2012\ref\stream_salsa2012_ref.c">
+      <Filter>crypto_stream\salsa2012\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa208\stream_salsa208.c">
+      <Filter>crypto_stream\salsa208</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\salsa208\ref\stream_salsa208_ref.c">
+      <Filter>crypto_stream\salsa208\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_stream\xsalsa20\stream_xsalsa20.c">
+      <Filter>crypto_stream\xsalsa20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\crypto_hash.c">
+      <Filter>crypto_hash</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha512\hash_sha512.c">
+      <Filter>crypto_hash\sha512</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha512\cp\hash_sha512_cp.c">
+      <Filter>crypto_hash\sha512\cp</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha256\hash_sha256.c">
+      <Filter>crypto_hash\sha256</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_hash\sha256\cp\hash_sha256_cp.c">
+      <Filter>crypto_hash\sha256\cp</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\xchacha20poly1305\sodium\aead_xchacha20poly1305.c">
+      <Filter>crypto_aead\xchacha20poly1305\sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\aes256gcm\aesni\aead_aes256gcm_aesni.c">
+      <Filter>crypto_aead\aes256gcm\aesni</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_aead\chacha20poly1305\sodium\aead_chacha20poly1305.c">
+      <Filter>crypto_aead\chacha20poly1305\sodium</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_secretstream\xchacha20poly1305\secretstream_xchacha20poly1305.c">
+      <Filter>crypto_secretstream\xchacha20poly1305</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\salsa\ref\core_salsa_ref.c">
+      <Filter>crypto_core\salsa\ref</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hchacha20\core_hchacha20.c">
+      <Filter>crypto_core\hchacha20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c">
+      <Filter>crypto_core\hsalsa20</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c">
+      <Filter>crypto_core\hsalsa20\ref2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ed25519.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>crypto_core\ed25519</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
+      <Filter>crypto_core\ed25519\ref10</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-sse2.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-avx2.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-ssse3.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-load-sse41.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-avx2.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_generichash\blake2b\ref\blake2b-compress-sse41.h">
+      <Filter>crypto_generichash\blake2b\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_sign\ed25519\ref10\sign_ed25519_ref10.h">
+      <Filter>crypto_sign\ed25519\ref10</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium.h">
+      <Filter>include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa2012.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\utils.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_hchacha20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha512.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\core.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\export.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash_siphash24.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash_sha256.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kx.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_hash.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha256.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_32.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xchacha20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa208.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_auth_hmacsha512256.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_chacha20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_sysrandom.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\runtime.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_salsa208.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_aead_aes256gcm.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_salsa2012.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_16.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_chacha20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_stream_xsalsa20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_hsalsa20.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign_ed25519.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_onetimeauth.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretbox.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_ed25519.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xsalsa20poly1305.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash_blake2b.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_sign_edwards25519sha512batch.h">
+      <Filter>include\sodium</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10_fe_25_5.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\ed25519_ref10_fe_51.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\sse2_64_32.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\common.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\mutex.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\chacha20_ietf_ext.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\include\sodium\private\implementations.h">
+      <Filter>include\sodium\private</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-ref.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-avx2.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-ssse3.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-encoding.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blake2b-long.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\blamka-round-avx512f.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\argon2\argon2-core.h">
+      <Filter>crypto_pwhash\argon2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\crypto_scrypt.h">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_pwhash\scryptsalsa208sha256\pbkdf2-sha256.h">
+      <Filter>crypto_pwhash\scryptsalsa208sha256</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash_ref.h">
+      <Filter>crypto_shorthash\siphash24\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.h">
+      <Filter>crypto_scalarmult\curve25519</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\consts_namespace.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_namespace.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base_namespace.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\fe51_namespace.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\sandy2x\ladder_base.h">
+      <Filter>crypto_scalarmult\curve25519\sandy2x</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_scalarmult\curve25519\ref10\x25519_ref10.h">
+      <Filter>crypto_scalarmult\curve25519\ref10</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\onetimeauth_poly1305.h">
+      <Filter>crypto_onetimeauth\poly1305</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna.h">
+      <Filter>crypto_onetimeauth\poly1305\donna</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna64.h">
+      <Filter>crypto_onetimeauth\poly1305\donna</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\donna\poly1305_donna32.h">
+      <Filter>crypto_onetimeauth\poly1305\donna</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.h">
+      <Filter>crypto_onetimeauth\poly1305\sse2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\stream_chacha20.h">
+      <Filter>crypto_stream\chacha20</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\ref\chacha20_ref.h">
+      <Filter>crypto_stream\chacha20\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u4.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-ssse3.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u0.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u1.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\chacha20_dolbeau-avx2.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\chacha20\dolbeau\u8.h">
+      <Filter>crypto_stream\chacha20\dolbeau</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\stream_salsa20.h">
+      <Filter>crypto_stream\salsa20</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\ref\salsa20_ref.h">
+      <Filter>crypto_stream\salsa20\ref</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u4.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u0.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u1.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-avx2.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\u8.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6int\salsa20_xmm6int-sse2.h">
+      <Filter>crypto_stream\salsa20\xmm6int</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_stream\salsa20\xmm6\salsa20_xmm6.h">
+      <Filter>crypto_stream\salsa20\xmm6</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\constants.h">
+      <Filter>crypto_core\ed25519\ref10\fe_25_5</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\fe.h">
+      <Filter>crypto_core\ed25519\ref10\fe_25_5</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\base2.h">
+      <Filter>crypto_core\ed25519\ref10\fe_25_5</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_25_5\base.h">
+      <Filter>crypto_core\ed25519\ref10\fe_25_5</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\constants.h">
+      <Filter>crypto_core\ed25519\ref10\fe_51</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\fe.h">
+      <Filter>crypto_core\ed25519\ref10\fe_51</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\base2.h">
+      <Filter>crypto_core\ed25519\ref10\fe_51</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\..\src\libsodium\crypto_core\ed25519\ref10\fe_51\base.h">
+      <Filter>crypto_core\ed25519\ref10\fe_51</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="crypto_aead">
+      <UniqueIdentifier>{a6837e41-3751-38c9-bb90-dd59d5f4af7b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\aes256gcm">
+      <UniqueIdentifier>{3e53394c-b59c-30cc-ae69-a4f46f9edfa3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\aes256gcm\aesni">
+      <UniqueIdentifier>{7eb51140-a50f-3f50-b379-83677a82496c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\chacha20poly1305">
+      <UniqueIdentifier>{1f4d6dd1-517f-3eeb-b974-2304ada5e67a}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\chacha20poly1305\sodium">
+      <UniqueIdentifier>{b145288f-68ad-3e79-93cb-e36537b20e26}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\xchacha20poly1305">
+      <UniqueIdentifier>{3122f223-e6c2-3ab1-ad85-ca289b47419e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_aead\xchacha20poly1305\sodium">
+      <UniqueIdentifier>{2720c2c8-c517-356e-83ed-c2997ab782c3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_auth">
+      <UniqueIdentifier>{0a3af0f3-56f7-3551-a64e-6284feccc423}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_auth\hmacsha256">
+      <UniqueIdentifier>{64e89b4f-eec9-38c9-90f2-4881bf5e84c0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_auth\hmacsha512">
+      <UniqueIdentifier>{0c0b4001-ae11-3d0f-8e73-75ac9b6e1ae8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_auth\hmacsha512256">
+      <UniqueIdentifier>{f5065d74-beda-3e1e-819a-f606279c7fe9}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_box">
+      <UniqueIdentifier>{f7aedb93-94a6-3ede-9374-ff41daca4841}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_box\curve25519xchacha20poly1305">
+      <UniqueIdentifier>{0e7473c9-9c69-36b3-ab6c-d953647a15a6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_box\curve25519xsalsa20poly1305">
+      <UniqueIdentifier>{d75db64c-eb08-3f10-9b99-1b6e6827f348}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core">
+      <UniqueIdentifier>{73194d5d-588a-342f-bee6-f28b4486f20b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\ed25519">
+      <UniqueIdentifier>{7c5e6f81-e4ce-3018-a776-a1f125072d73}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\ed25519\ref10">
+      <UniqueIdentifier>{76990c08-d692-367f-b286-c728a8cad6bf}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\ed25519\ref10\fe_25_5">
+      <UniqueIdentifier>{bf04f786-7862-3bde-aeba-ed82ee59ca22}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\ed25519\ref10\fe_51">
+      <UniqueIdentifier>{98b6126a-3725-3707-a4cc-ff3af657cba0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\hchacha20">
+      <UniqueIdentifier>{8b704d11-af1f-30c0-9981-479da6d88dc3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\hsalsa20">
+      <UniqueIdentifier>{342e684b-4e18-311c-953c-8391a544a04f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\hsalsa20\ref2">
+      <UniqueIdentifier>{c6b8e28c-7c54-3af7-bee3-2948ba7b2082}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\salsa">
+      <UniqueIdentifier>{4e9a1d6b-ee07-3bbc-ad78-6d0ba0e6d9d3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_core\salsa\ref">
+      <UniqueIdentifier>{eb259fd9-56f0-32db-a903-6bc1549a7326}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_generichash">
+      <UniqueIdentifier>{e53b6258-fcdd-34c8-96c5-44510a34a390}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_generichash\blake2b">
+      <UniqueIdentifier>{8bd3b558-2d08-3c3a-81ca-22677dde943b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_generichash\blake2b\ref">
+      <UniqueIdentifier>{16a8dd41-b0ab-39a7-80c8-3052d8b63811}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_hash">
+      <UniqueIdentifier>{d7ec3690-bae7-3653-8c53-66a3142cfcfa}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_hash\sha256">
+      <UniqueIdentifier>{722ef422-8c03-3008-ba2a-3a7e91c6647c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_hash\sha256\cp">
+      <UniqueIdentifier>{8c7d8b62-7b4f-3eb9-85b7-18e8d925be14}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_hash\sha512">
+      <UniqueIdentifier>{8fb6a906-dbd6-3746-9b0f-f49e7028daec}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_hash\sha512\cp">
+      <UniqueIdentifier>{f2d6a22b-dd67-3561-90a4-88696169cb7b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_kdf">
+      <UniqueIdentifier>{aaf59186-1c0d-33cf-a34d-93e14bb87226}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_kdf\blake2b">
+      <UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_kx">
+      <UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_onetimeauth">
+      <UniqueIdentifier>{323c0a15-3c1d-39b2-9ec1-299deb299497}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_onetimeauth\poly1305">
+      <UniqueIdentifier>{52c2080d-37c0-34c2-864a-c201c728e5d8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_onetimeauth\poly1305\donna">
+      <UniqueIdentifier>{ff618a41-caeb-3a18-ad36-d34b049a8f50}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_onetimeauth\poly1305\sse2">
+      <UniqueIdentifier>{ffc3712d-dfe0-3b51-8257-f5ffc9c9cea3}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_pwhash">
+      <UniqueIdentifier>{f54b65b6-71cf-3ab3-9c8c-f89c81846836}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_pwhash\argon2">
+      <UniqueIdentifier>{1bd97a78-befa-3805-8e9c-80d7c1aff37b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_pwhash\scryptsalsa208sha256">
+      <UniqueIdentifier>{e785f104-1212-37bf-8511-cc518b9ace66}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_pwhash\scryptsalsa208sha256\nosse">
+      <UniqueIdentifier>{447b993f-59fb-3efd-8c59-a1712c97dfe8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_pwhash\scryptsalsa208sha256\sse">
+      <UniqueIdentifier>{cdb8d233-06b0-3872-a62b-c1ccf4cb4314}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult">
+      <UniqueIdentifier>{402a1c5a-d499-333a-a2fa-acd0e6a3c2b2}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\curve25519">
+      <UniqueIdentifier>{77f5a2e9-2ef1-3a72-b63c-88e8e4b92678}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\curve25519\ref10">
+      <UniqueIdentifier>{6c9c7c30-0808-3fad-8a88-944d7645e5d5}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\curve25519\sandy2x">
+      <UniqueIdentifier>{5d2fb1a2-f063-32db-a81a-41f79e36fd23}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ed25519">
+      <UniqueIdentifier>{7bec6074-fbc7-330b-9e18-7dc3e868569a}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ed25519\ref10">
+      <UniqueIdentifier>{834d4827-81e4-3de3-baa1-a216763f11d6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255">
+      <UniqueIdentifier>{52bf28eb-7ffd-399a-be35-0df3e8e99c15}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_scalarmult\ristretto255\ref10">
+      <UniqueIdentifier>{39cc576f-4b54-3d71-b14c-27445bc4b138}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_secretbox">
+      <UniqueIdentifier>{b9b02bee-5c1f-36d2-b97d-983f865a4cc6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_secretbox\xchacha20poly1305">
+      <UniqueIdentifier>{41f1f35b-4639-3424-be85-7dfba02f3c5e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_secretbox\xsalsa20poly1305">
+      <UniqueIdentifier>{8bf11d29-2f5a-3f10-8ae6-82229d19c5b0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_secretstream">
+      <UniqueIdentifier>{62f7ae38-4ce6-3976-acc3-47c462db4fbe}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_secretstream\xchacha20poly1305">
+      <UniqueIdentifier>{e07a28cd-775a-3798-bfdb-97842d3614d6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_shorthash">
+      <UniqueIdentifier>{bb073c16-adc8-3cff-80b9-99cf5a28de6c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_shorthash\siphash24">
+      <UniqueIdentifier>{63de0ec8-ecde-35e3-8b97-6e9e4da342ee}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_shorthash\siphash24\ref">
+      <UniqueIdentifier>{29925210-53eb-342c-8527-7ebc173e668f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_sign">
+      <UniqueIdentifier>{b2f989b6-87a6-3388-a35c-2d0d59cb4236}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_sign\ed25519">
+      <UniqueIdentifier>{bc6466a1-57b0-3a35-9973-ad488a4bef8c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_sign\ed25519\ref10">
+      <UniqueIdentifier>{5599d9ab-b5b2-3310-b541-ae0fb70eecf1}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream">
+      <UniqueIdentifier>{eaedd08a-46f8-3d12-9e8d-bb3ee3ead5f6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\chacha20">
+      <UniqueIdentifier>{806b6ff3-578b-308a-a359-0f5ed8472ecc}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\chacha20\dolbeau">
+      <UniqueIdentifier>{5a1d852e-67bb-3dc1-9ec5-99ef74b7faca}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\chacha20\ref">
+      <UniqueIdentifier>{33e45d9c-e12a-3e76-9ef2-4f5510244a5b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa20">
+      <UniqueIdentifier>{048ba2a8-b22b-346c-9886-668b63c88c68}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa20\ref">
+      <UniqueIdentifier>{f08a312f-f8a3-350b-87ab-1f79d33e513f}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa20\xmm6">
+      <UniqueIdentifier>{c403f690-cd22-3ed4-9cc7-3f46e73081fd}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa20\xmm6int">
+      <UniqueIdentifier>{c34d03f5-cf47-39fe-a5ad-5eb917006203}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa2012">
+      <UniqueIdentifier>{4da0c5ca-33d1-34e0-9689-12e69ae2dbd6}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa2012\ref">
+      <UniqueIdentifier>{dd6b294c-5871-386c-92ec-aa46fcc411d4}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa208">
+      <UniqueIdentifier>{07aca978-0547-329a-b70b-29aa579cacc5}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\salsa208\ref">
+      <UniqueIdentifier>{f171fa05-35c4-32a0-b035-b5d6680ab714}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\xchacha20">
+      <UniqueIdentifier>{ede2279c-1ba7-3d62-8345-733c6c1965e7}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_stream\xsalsa20">
+      <UniqueIdentifier>{9c15151b-10dc-3dfe-b97b-a7d8c6b58920}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_verify">
+      <UniqueIdentifier>{49fb9272-ffe2-3993-b562-b19d5f2c9b40}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="crypto_verify\sodium">
+      <UniqueIdentifier>{80669cf5-3c9c-3c60-b409-9d8fb305bc77}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="include">
+      <UniqueIdentifier>{96da72eb-3aa0-3850-83eb-32788f91e5bd}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="include\sodium">
+      <UniqueIdentifier>{56bb40fc-d381-3a9e-925b-681774c48dde}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="include\sodium\private">
+      <UniqueIdentifier>{fde88485-0fe6-3b22-9480-1d2b49fade53}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="randombytes">
+      <UniqueIdentifier>{ef090484-4db4-3dc2-aca7-c59bab1db23b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="randombytes\internal">
+      <UniqueIdentifier>{14c126fd-bb91-37ea-b807-b60c386be601}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="randombytes\sysrandom">
+      <UniqueIdentifier>{ac56c38f-7e17-3b79-bf47-58e9476b3b89}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="sodium">
+      <UniqueIdentifier>{5dfc520b-f690-3d5f-a86a-8b667f2e7490}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+</Project>
diff --git a/builds/msvc/vs2019/libsodium/libsodium.xml b/builds/msvc/vs2019/libsodium/libsodium.xml
new file mode 100644
index 0000000000000000000000000000000000000000..808ccb9fec1e4111fcf4f35fafae4431398cacf7
--- /dev/null
+++ b/builds/msvc/vs2019/libsodium/libsodium.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
+  <Rule Name="libsodium-uiextension" PageTemplate="tool" DisplayName="Sodium Options" SwitchPrefix="/" Order="1">
+    <Rule.Categories>
+      <Category Name="amd64asm" DisplayName="amd64asm" />
+    </Rule.Categories>
+    <Rule.DataSource>
+      <DataSource Persistence="ProjectFile" ItemType="" />
+    </Rule.DataSource>
+    <EnumProperty Name="Option-amd64asm" DisplayName="Enable AMD64 Assembly" Description="Enable the AMD64 Assembly build option" Category="amd64asm">
+      <EnumValue Name="" DisplayName="No" />
+      <EnumValue Name="true" DisplayName="Yes" />
+    </EnumProperty>
+  </Rule>
+</ProjectSchemaDefinitions>
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
index e3d6ce5acb3c341345610a816eb32188fc05e73b..9e2de27c0b7df34bd0f7bafd61aa8f12bd24d41e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.65])
-AC_INIT([libsodium],[1.0.17],
+AC_INIT([libsodium],[1.0.18],
   [https://github.com/jedisct1/libsodium/issues],
   [libsodium],
   [https://github.com/jedisct1/libsodium])
@@ -15,9 +15,9 @@ AM_DEP_TRACK
 AC_SUBST(VERSION)
 
 SODIUM_LIBRARY_VERSION_MAJOR=10
-SODIUM_LIBRARY_VERSION_MINOR=2
-DLL_VERSION=23
-SODIUM_LIBRARY_VERSION=25:0:2
+SODIUM_LIBRARY_VERSION_MINOR=3
+DLL_VERSION=24
+SODIUM_LIBRARY_VERSION=26:0:3
 #                       | | |
 #                +------+ | +---+
 #                |        |     |
@@ -36,6 +36,7 @@ AC_SUBST(DLL_VERSION)
 
 AC_LANG_ASSERT(C)
 LX_CFLAGS=${CFLAGS-NONE}
+PKGCONFIG_LIBS_PRIVATE=""
 
 dnl Path check
 
@@ -59,7 +60,7 @@ AC_ARG_ENABLE(ssp,
 ])
 
 AC_ARG_ENABLE(asm,
-[AS_HELP_STRING(--disable-asm,[Do not compile assembly code -- As a side effect, this disables CPU-specific implementations on non-Windows platforms. Only for use with targets such as WebAssembly and NativeClient.])],
+[AS_HELP_STRING(--disable-asm,[Do not compile assembly code -- As a side effect, this disables CPU-specific implementations on non-Windows platforms. Only for use with targets such as WebAssembly.])],
 [
   AS_IF([test "x$enableval" = "xno"], [
     enable_asm="no"
@@ -81,10 +82,6 @@ AS_IF([test "x$EMSCRIPTEN" != "x"], [
     unset EMSCRIPTEN
   ])
 ])
-AS_IF([test "$host_os" = "nacl" -o "$host_os" = "pnacl"], [
-  enable_asm="no"
-  AC_MSG_WARN([compiling to Native Client - asm implementations disabled])
-])
 
 AC_ARG_ENABLE(pie,
 [AS_HELP_STRING(--disable-pie,Do not produce position independent executables)],
@@ -124,11 +121,25 @@ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
 
 AS_IF([test "x$withval" = "xyes"], [
   AX_PTHREAD([
-    AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
-    with_threads="yes"
-    LIBS="$PTHREAD_LIBS $LIBS"
-    CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-    CC="$PTHREAD_CC"])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+        #include <pthread.h>
+      ]], [[
+        pthread_mutex_t mutex;
+
+        pthread_mutex_lock(&mutex);
+        pthread_mutex_unlock(&mutex)
+      ]]
+    )], [
+        AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files])
+        with_threads="yes"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        PKGCONFIG_LIBS_PRIVATE="$PTHREAD_LIBS $PTHREAD_CFLAGS $PKGCONFIG_LIBS_PRIVATE"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        CC="$PTHREAD_CC"
+      ])
+    ],
+    [ AC_MSG_NOTICE(pthread mutexes are not available) ]
+  )
 ], [with_threads="no"])
 
 AC_ARG_WITH(safecode,
@@ -185,12 +196,15 @@ AC_ARG_ENABLE(opt,
 [
   AS_IF([test "x$enableval" = "xyes"], [
     AX_CHECK_COMPILE_FLAG([-Ofast], [CFLAGS="$CFLAGS -Ofast"])
+    AX_CHECK_COMPILE_FLAG([-ftree-vectorize], [CFLAGS="$CFLAGS -ftree-vectorize"])
+    AX_CHECK_COMPILE_FLAG([-ftree-slp-vectorize], [CFLAGS="$CFLAGS -ftree-slp-vectorize"])
     AX_CHECK_COMPILE_FLAG([-fomit-frame-pointer], [CFLAGS="$CFLAGS -fomit-frame-pointer"])
     AX_CHECK_COMPILE_FLAG([-march=native], [CFLAGS="$CFLAGS -march=native"])
   ])
 ])
 
-AC_SUBST([MAINT])
+AC_SUBST(MAINT)
+AC_SUBST(PKGCONFIG_LIBS_PRIVATE)
 
 AX_VALGRIND_CHECK
 
@@ -201,7 +215,7 @@ AM_PROG_AS
 AC_USE_SYSTEM_EXTENSIONS
 AC_C_VARARRAYS
 
-AC_CHECK_DEFINE([__native_client__], [NATIVECLIENT="yes"], [])
+AC_CHECK_DEFINE([__wasi__], [WASI="yes"], [])
 
 AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [
   AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2],
@@ -273,7 +287,7 @@ AS_CASE([$host_os],
 AS_IF([test "x$enable_ssp" != "xno"],[
 
 AS_CASE([$host_os],
-  [cygwin*|mingw*|msys|pw32*|cegcc*|haiku], [ ],
+  [cygwin*|mingw*|msys|pw32*|cegcc*|haiku|none], [ ],
   [*], [
     AX_CHECK_COMPILE_FLAG([-fstack-protector], [
       AX_CHECK_LINK_FLAG([-fstack-protector],
@@ -350,7 +364,7 @@ AC_CHECK_TOOL([AR], [ar], [ar])
 
 dnl Checks for headers
 
-AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
+AS_IF([test "x$EMSCRIPTEN" = "x"], [
 
   oldcflags="$CFLAGS"
   AX_CHECK_COMPILE_FLAG([-mmmx], [CFLAGS="$CFLAGS -mmmx"])
@@ -426,9 +440,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
   AX_CHECK_COMPILE_FLAG([-mavx], [CFLAGS="$CFLAGS -mavx"])
   AC_MSG_CHECKING(for AVX instructions set)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding AVX opcodes
-#endif
 #pragma GCC target("avx")
 #include <immintrin.h>
 ]], [[ _mm256_zeroall(); ]])],
@@ -442,9 +453,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
   AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS="$CFLAGS -mavx2"])
   AC_MSG_CHECKING(for AVX2 instructions set)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding AVX2 opcodes
-#endif
 #pragma GCC target("avx2")
 #include <immintrin.h>
 ]], [[
@@ -457,9 +465,6 @@ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ));
      AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS_AVX2="-mavx2"])
      AC_MSG_CHECKING(if _mm256_broadcastsi128_si256 is correctly defined)
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding AVX2 opcodes
-#endif
 #pragma GCC target("avx2")
 #include <immintrin.h>
      ]], [[ __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128()); ]])],
@@ -475,9 +480,6 @@ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ));
   AX_CHECK_COMPILE_FLAG([-mavx512f], [CFLAGS="$CFLAGS -mavx512f"])
   AC_MSG_CHECKING(for AVX512F instructions set)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding AVX512F opcodes
-#endif
 #pragma GCC target("avx512f")
 #include <immintrin.h>
 ]], [[
@@ -511,9 +513,6 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7),
   AX_CHECK_COMPILE_FLAG([-mpclmul], [CFLAGS="$CFLAGS -mpclmul"])
   AC_MSG_CHECKING(for AESNI instructions set and PCLMULQDQ)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding AESNI opcodes
-#endif
 #pragma GCC target("aes")
 #pragma GCC target("pclmul")
 #include <wmmintrin.h>
@@ -531,9 +530,6 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7),
   AX_CHECK_COMPILE_FLAG([-mrdrnd], [CFLAGS="$CFLAGS -mrdrnd"])
   AC_MSG_CHECKING(for RDRAND)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __native_client__
-# error NativeClient detected - Avoiding RDRAND opcodes
-#endif
 #pragma GCC target("rdrnd")
 #include <immintrin.h>
 ]], [[ unsigned long long x; _rdrand64_step(&x); ]])],
@@ -558,7 +554,7 @@ AC_SUBST(CFLAGS_AESNI)
 AC_SUBST(CFLAGS_PCLMUL)
 AC_SUBST(CFLAGS_RDRAND)
 
-AC_CHECK_HEADERS([sys/mman.h intrin.h])
+AC_CHECK_HEADERS([sys/mman.h sys/random.h intrin.h])
 
 AC_MSG_CHECKING([if _xgetbv() is available])
 AC_LINK_IFELSE(
@@ -696,7 +692,7 @@ AM_CONDITIONAL([HAVE_TI_MODE], [test $HAVE_TI_MODE_V = 1])
 AC_SUBST(HAVE_TI_MODE_V)
 
 HAVE_CPUID_V=0
-AS_IF([test "$enable_asm" != "no" -o "$host_alias" = "x86_64-nacl"],[
+AS_IF([test "$enable_asm" != "no"],[
   AC_MSG_CHECKING(for cpuid instruction)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
 unsigned int cpu_info[4];
@@ -713,7 +709,7 @@ __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" :
 AC_SUBST(HAVE_CPUID_V)
 
 asm_hide_symbol="unsupported"
-AS_IF([test "$enable_asm" != "no" -o "$host_os" = "nacl"],[
+AS_IF([test "$enable_asm" != "no"],[
   AC_MSG_CHECKING(if the .private_extern asm directive is supported)
   AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
 __asm__ __volatile__ (".private_extern dummy_symbol \n"
@@ -799,9 +795,50 @@ dnl Checks for functions and headers
 AC_FUNC_ALLOCA
 AS_IF([test "x$EMSCRIPTEN" = "x"],[
   AC_CHECK_FUNCS([arc4random arc4random_buf])
-  AC_CHECK_FUNCS([mmap mlock madvise mprotect memset_s explicit_bzero explicit_memset nanosleep])
+  AC_CHECK_FUNCS([mmap mlock madvise mprotect])
+
+  AC_MSG_CHECKING(for getrandom with a standard API)
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_RANDOM_H
+# include <sys/random.h>
+#endif
+]], [[
+unsigned char buf;
+(void) getrandom((void *) &buf, 1U, 0U);
+  ]])],
+  [AC_MSG_RESULT(yes)
+   AC_CHECK_FUNCS([getrandom])],
+  [AC_MSG_RESULT(no)
+  ])
+
+  AC_MSG_CHECKING(for getentropy with a standard API)
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_RANDOM_H
+# include <sys/random.h>
+#endif
+]], [[
+#ifdef __APPLE__
+# error getentropy() is currently disabled on Apple operating systems
+#endif
+
+unsigned char buf;
+(void) getentropy((void *) &buf, 1U);
+  ]])],
+  [AC_MSG_RESULT(yes)
+   AC_CHECK_FUNCS([getentropy])],
+  [AC_MSG_RESULT(no)
+  ])
 ])
-AC_CHECK_FUNCS([posix_memalign getpid])
+AC_CHECK_FUNCS([posix_memalign getpid nanosleep])
+AC_CHECK_FUNCS([memset_s explicit_bzero explicit_memset])
 
 AC_SUBST([LIBTOOL_EXTRA_FLAGS])
 
@@ -812,8 +849,7 @@ AS_IF([test "x$EMSCRIPTEN" != "x"],[
 ])
 AC_SUBST(TEST_LDFLAGS)
 AM_CONDITIONAL([EMSCRIPTEN], [test "x$EMSCRIPTEN" != "x"])
-
-AM_CONDITIONAL([NATIVECLIENT], [test "x$NATIVECLIENT" != "x"])
+AM_CONDITIONAL([WASI], [test "x$WASI" != "x"])
 
 AC_DEFINE([CONFIGURED], [1], [the build system was properly configured])
 
diff --git a/contrib/Findsodium.cmake b/contrib/Findsodium.cmake
index 0667920c255b100b89e26581734a9eae188c14ae..a124f1c85af5dc4a75e46f959f0e534f6d65e53d 100644
--- a/contrib/Findsodium.cmake
+++ b/contrib/Findsodium.cmake
@@ -1,107 +1,101 @@
 # Written in 2016 by Henrik Steffen Gaßmann <henrik@gassmann.onl>
 #
-# To the extent possible under law, the author(s) have dedicated all
-# copyright and related and neighboring rights to this software to the
-# public domain worldwide. This software is distributed without any warranty.
+# To the extent possible under law, the author(s) have dedicated all copyright
+# and related and neighboring rights to this software to the public domain
+# worldwide. This software is distributed without any warranty.
 #
-# You should have received a copy of the CC0 Public Domain Dedication
-# along with this software. If not, see
+# You should have received a copy of the CC0 Public Domain Dedication along with
+# this software. If not, see
 #
-#     http://creativecommons.org/publicdomain/zero/1.0/
+# http://creativecommons.org/publicdomain/zero/1.0/
 #
-########################################################################
+# ##############################################################################
 # Tries to find the local libsodium installation.
 #
-# On Windows the sodium_DIR environment variable is used as a default
-# hint which can be overridden by setting the corresponding cmake variable.
+# On Windows the sodium_DIR environment variable is used as a default hint which
+# can be overridden by setting the corresponding cmake variable.
 #
 # Once done the following variables will be defined:
 #
-#   sodium_FOUND
-#   sodium_INCLUDE_DIR
-#   sodium_LIBRARY_DEBUG
-#   sodium_LIBRARY_RELEASE
-#
+# sodium_FOUND sodium_INCLUDE_DIR sodium_LIBRARY_DEBUG sodium_LIBRARY_RELEASE
+# sodium_VERSION_STRING
 #
 # Furthermore an imported "sodium" target is created.
 #
 
-if (CMAKE_C_COMPILER_ID STREQUAL "GNU"
-    OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-    set(_GCC_COMPATIBLE 1)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
+  set(_GCC_COMPATIBLE 1)
 endif()
 
 # static library option
-if (NOT DEFINED sodium_USE_STATIC_LIBS)
-    option(sodium_USE_STATIC_LIBS "enable to statically link against sodium" OFF)
+if(NOT DEFINED sodium_USE_STATIC_LIBS)
+  option(sodium_USE_STATIC_LIBS "enable to statically link against sodium" OFF)
 endif()
 if(NOT (sodium_USE_STATIC_LIBS EQUAL sodium_USE_STATIC_LIBS_LAST))
-    unset(sodium_LIBRARY CACHE)
-    unset(sodium_LIBRARY_DEBUG CACHE)
-    unset(sodium_LIBRARY_RELEASE CACHE)
-    unset(sodium_DLL_DEBUG CACHE)
-    unset(sodium_DLL_RELEASE CACHE)
-    set(sodium_USE_STATIC_LIBS_LAST ${sodium_USE_STATIC_LIBS} CACHE INTERNAL "internal change tracking variable")
+  unset(sodium_LIBRARY CACHE)
+  unset(sodium_LIBRARY_DEBUG CACHE)
+  unset(sodium_LIBRARY_RELEASE CACHE)
+  unset(sodium_DLL_DEBUG CACHE)
+  unset(sodium_DLL_RELEASE CACHE)
+  set(sodium_USE_STATIC_LIBS_LAST
+      ${sodium_USE_STATIC_LIBS}
+      CACHE INTERNAL "internal change tracking variable")
 endif()
 
-
-########################################################################
+# ##############################################################################
 # UNIX
-if (UNIX)
-    # import pkg-config
-    find_package(PkgConfig QUIET)
-    if (PKG_CONFIG_FOUND)
-        pkg_check_modules(sodium_PKG QUIET libsodium)
-    endif()
+if(UNIX)
+  # import pkg-config
+  find_package(PkgConfig QUIET)
+  if(PKG_CONFIG_FOUND)
+    pkg_check_modules(sodium_PKG QUIET libsodium)
+  endif()
 
-    if(sodium_USE_STATIC_LIBS)
-        if (sodium_PKG_STATIC_LIBRARIES)
-            foreach(_libname ${sodium_PKG_STATIC_LIBRARIES})
-                if (NOT _libname MATCHES "^lib.*\\.a$") # ignore strings already ending with .a
-                    list(INSERT sodium_PKG_STATIC_LIBRARIES 0 "lib${_libname}.a")
-                endif()
-            endforeach()
-            list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES)
-        else()
-            # if pkgconfig for libsodium doesn't provide
-            # static lib info, then override PKG_STATIC here..
-            set(sodium_PKG_STATIC_LIBRARIES libsodium.a)
+  if(sodium_USE_STATIC_LIBS)
+    if(sodium_PKG_STATIC_LIBRARIES)
+      foreach(_libname ${sodium_PKG_STATIC_LIBRARIES})
+        if(NOT _libname MATCHES "^lib.*\\.a$") # ignore strings already ending
+                                               # with .a
+          list(INSERT sodium_PKG_STATIC_LIBRARIES 0 "lib${_libname}.a")
         endif()
-
-        set(XPREFIX sodium_PKG_STATIC)
+      endforeach()
+      list(REMOVE_DUPLICATES sodium_PKG_STATIC_LIBRARIES)
     else()
-        if (sodium_PKG_LIBRARIES STREQUAL "")
-            set(sodium_PKG_LIBRARIES sodium)
-        endif()
+      # if pkgconfig for libsodium doesn't provide static lib info, then
+      # override PKG_STATIC here..
+      set(sodium_PKG_STATIC_LIBRARIES libsodium.a)
+    endif()
 
-        set(XPREFIX sodium_PKG)
+    set(XPREFIX sodium_PKG_STATIC)
+  else()
+    if(sodium_PKG_LIBRARIES STREQUAL "")
+      set(sodium_PKG_LIBRARIES sodium)
     endif()
 
-    find_path(sodium_INCLUDE_DIR sodium.h
-        HINTS ${${XPREFIX}_INCLUDE_DIRS}
-    )
-    find_library(sodium_LIBRARY_DEBUG NAMES ${${XPREFIX}_LIBRARIES}
-        HINTS ${${XPREFIX}_LIBRARY_DIRS}
-    )
-    find_library(sodium_LIBRARY_RELEASE NAMES ${${XPREFIX}_LIBRARIES}
-        HINTS ${${XPREFIX}_LIBRARY_DIRS}
-    )
+    set(XPREFIX sodium_PKG)
+  endif()
 
+  find_path(sodium_INCLUDE_DIR sodium.h HINTS ${${XPREFIX}_INCLUDE_DIRS})
+  find_library(sodium_LIBRARY_DEBUG
+               NAMES ${${XPREFIX}_LIBRARIES}
+               HINTS ${${XPREFIX}_LIBRARY_DIRS})
+  find_library(sodium_LIBRARY_RELEASE
+               NAMES ${${XPREFIX}_LIBRARIES}
+               HINTS ${${XPREFIX}_LIBRARY_DIRS})
 
-########################################################################
-# Windows
-elseif (WIN32)
-    set(sodium_DIR "$ENV{sodium_DIR}" CACHE FILEPATH "sodium install directory")
-    mark_as_advanced(sodium_DIR)
+  # ############################################################################
+  # Windows
+elseif(WIN32)
+  set(sodium_DIR "$ENV{sodium_DIR}" CACHE FILEPATH "sodium install directory")
+  mark_as_advanced(sodium_DIR)
 
-    find_path(sodium_INCLUDE_DIR sodium.h
-        HINTS ${sodium_DIR}
-        PATH_SUFFIXES include
-    )
+  find_path(sodium_INCLUDE_DIR sodium.h
+            HINTS ${sodium_DIR}
+            PATH_SUFFIXES include)
 
-    if (MSVC)
-        # detect target architecture
-        file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/arch.c" [=[
+  if(MSVC)
+    # detect target architecture
+    file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/arch.c" [=[
             #if defined _M_IX86
             #error ARCH_VALUE x86_32
             #elif defined _M_X64
@@ -109,180 +103,191 @@ elseif (WIN32)
             #endif
             #error ARCH_VALUE unknown
         ]=])
-        try_compile(_UNUSED_VAR "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/arch.c"
-            OUTPUT_VARIABLE _COMPILATION_LOG
-        )
-        string(REGEX REPLACE ".*ARCH_VALUE ([a-zA-Z0-9_]+).*" "\\1" _TARGET_ARCH "${_COMPILATION_LOG}")
+    try_compile(_UNUSED_VAR "${CMAKE_CURRENT_BINARY_DIR}"
+                "${CMAKE_CURRENT_BINARY_DIR}/arch.c"
+                OUTPUT_VARIABLE _COMPILATION_LOG)
+    string(REGEX
+           REPLACE ".*ARCH_VALUE ([a-zA-Z0-9_]+).*"
+                   "\\1"
+                   _TARGET_ARCH
+                   "${_COMPILATION_LOG}")
 
-        # construct library path
-        if (_TARGET_ARCH STREQUAL "x86_32")
-            string(APPEND _PLATFORM_PATH "Win32")
-        elseif(_TARGET_ARCH STREQUAL "x86_64")
-            string(APPEND _PLATFORM_PATH "x64")
-        else()
-            message(FATAL_ERROR "the ${_TARGET_ARCH} architecture is not supported by Findsodium.cmake.")
-        endif()
-        string(APPEND _PLATFORM_PATH "/$$CONFIG$$")
+    # construct library path
+    if(_TARGET_ARCH STREQUAL "x86_32")
+      string(APPEND _PLATFORM_PATH "Win32")
+    elseif(_TARGET_ARCH STREQUAL "x86_64")
+      string(APPEND _PLATFORM_PATH "x64")
+    else()
+      message(
+        FATAL_ERROR
+          "the ${_TARGET_ARCH} architecture is not supported by Findsodium.cmake."
+        )
+    endif()
+    string(APPEND _PLATFORM_PATH "/$$CONFIG$$")
 
-        if (MSVC_VERSION LESS 1900)
-            math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60")
-        else()
-            math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50")
-        endif()
-        string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}")
+    if(MSVC_VERSION LESS 1900)
+      math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60")
+    else()
+      math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50")
+    endif()
+    string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}")
 
-        if (sodium_USE_STATIC_LIBS)
-            string(APPEND _PLATFORM_PATH "/static")
-        else()
-            string(APPEND _PLATFORM_PATH "/dynamic")
-        endif()
+    if(sodium_USE_STATIC_LIBS)
+      string(APPEND _PLATFORM_PATH "/static")
+    else()
+      string(APPEND _PLATFORM_PATH "/dynamic")
+    endif()
 
-        string(REPLACE "$$CONFIG$$" "Debug" _DEBUG_PATH_SUFFIX "${_PLATFORM_PATH}")
-        string(REPLACE "$$CONFIG$$" "Release" _RELEASE_PATH_SUFFIX "${_PLATFORM_PATH}")
+    string(REPLACE "$$CONFIG$$"
+                   "Debug"
+                   _DEBUG_PATH_SUFFIX
+                   "${_PLATFORM_PATH}")
+    string(REPLACE "$$CONFIG$$"
+                   "Release"
+                   _RELEASE_PATH_SUFFIX
+                   "${_PLATFORM_PATH}")
 
-        find_library(sodium_LIBRARY_DEBUG libsodium.lib
-            HINTS ${sodium_DIR}
-            PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}
-        )
-        find_library(sodium_LIBRARY_RELEASE libsodium.lib
-            HINTS ${sodium_DIR}
-            PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}
-        )
-        if (NOT sodium_USE_STATIC_LIBS)
-            set(CMAKE_FIND_LIBRARY_SUFFIXES_BCK ${CMAKE_FIND_LIBRARY_SUFFIXES})
-            set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
-            find_library(sodium_DLL_DEBUG libsodium
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}
-            )
-            find_library(sodium_DLL_RELEASE libsodium
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}
-            )
-            set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BCK})
-        endif()
-
-    elseif(_GCC_COMPATIBLE)
-        if (sodium_USE_STATIC_LIBS)
-            find_library(sodium_LIBRARY_DEBUG libsodium.a
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES lib
-            )
-            find_library(sodium_LIBRARY_RELEASE libsodium.a
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES lib
-            )
-        else()
-            find_library(sodium_LIBRARY_DEBUG libsodium.dll.a
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES lib
-            )
-            find_library(sodium_LIBRARY_RELEASE libsodium.dll.a
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES lib
-            )
+    find_library(sodium_LIBRARY_DEBUG libsodium.lib
+                 HINTS ${sodium_DIR}
+                 PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX})
+    find_library(sodium_LIBRARY_RELEASE libsodium.lib
+                 HINTS ${sodium_DIR}
+                 PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX})
+    if(NOT sodium_USE_STATIC_LIBS)
+      set(CMAKE_FIND_LIBRARY_SUFFIXES_BCK ${CMAKE_FIND_LIBRARY_SUFFIXES})
+      set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+      find_library(sodium_DLL_DEBUG libsodium
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX})
+      find_library(sodium_DLL_RELEASE libsodium
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX})
+      set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BCK})
+    endif()
 
-            file(GLOB _DLL
-                LIST_DIRECTORIES false
-                RELATIVE "${sodium_DIR}/bin"
-                "${sodium_DIR}/bin/libsodium*.dll"
-            )
-            find_library(sodium_DLL_DEBUG ${_DLL} libsodium
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES bin
-            )
-            find_library(sodium_DLL_RELEASE ${_DLL} libsodium
-                HINTS ${sodium_DIR}
-                PATH_SUFFIXES bin
-            )
-        endif()
+  elseif(_GCC_COMPATIBLE)
+    if(sodium_USE_STATIC_LIBS)
+      find_library(sodium_LIBRARY_DEBUG libsodium.a
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES lib)
+      find_library(sodium_LIBRARY_RELEASE libsodium.a
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES lib)
     else()
-        message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
-    endif()
+      find_library(sodium_LIBRARY_DEBUG libsodium.dll.a
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES lib)
+      find_library(sodium_LIBRARY_RELEASE libsodium.dll.a
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES lib)
 
+      file(GLOB _DLL
+           LIST_DIRECTORIES false
+           RELATIVE "${sodium_DIR}/bin"
+           "${sodium_DIR}/bin/libsodium*.dll")
+      find_library(sodium_DLL_DEBUG ${_DLL} libsodium
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES bin)
+      find_library(sodium_DLL_RELEASE ${_DLL} libsodium
+                   HINTS ${sodium_DIR}
+                   PATH_SUFFIXES bin)
+    endif()
+  else()
+    message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
+  endif()
 
-########################################################################
-# unsupported
+  # ############################################################################
+  # unsupported
 else()
-    message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
+  message(FATAL_ERROR "this platform is not supported by FindSodium.cmake")
 endif()
 
-
-########################################################################
+# ##############################################################################
 # common stuff
 
 # extract sodium version
-if (sodium_INCLUDE_DIR)
-    set(_VERSION_HEADER "${_INCLUDE_DIR}/sodium/version.h")
-    if (EXISTS _VERSION_HEADER)
-        file(READ "${_VERSION_HEADER}" _VERSION_HEADER_CONTENT)
-        string(REGEX REPLACE ".*#[ \t]*define[ \t]*SODIUM_VERSION_STRING[ \t]*\"([^\n]*)\".*" "\\1"
-            sodium_VERSION "${_VERSION_HEADER_CONTENT}")
-        set(sodium_VERSION "${sodium_VERSION}" PARENT_SCOPE)
-    endif()
+if(sodium_INCLUDE_DIR)
+  set(_VERSION_HEADER "${sodium_INCLUDE_DIR}/sodium/version.h")
+  if(EXISTS "${_VERSION_HEADER}")
+    file(READ "${_VERSION_HEADER}" _VERSION_HEADER_CONTENT)
+    string(
+      REGEX
+      REPLACE
+        ".*#[ \t]*define[ \t]*sodium_VERSION_STRING_STRING[ \t]*\"([^\n]*)\".*"
+        "\\1"
+        sodium_VERSION_STRING
+        "${_VERSION_HEADER_CONTENT}")
+    set(sodium_VERSION_STRING "${sodium_VERSION_STRING}")
+  endif()
 endif()
 
 # communicate results
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(sodium
-    REQUIRED_VARS
-        sodium_LIBRARY_RELEASE
-        sodium_LIBRARY_DEBUG
-        sodium_INCLUDE_DIR
-    VERSION_VAR
-        sodium_VERSION
-)
+                                  REQUIRED_VARS
+                                  sodium_LIBRARY_RELEASE
+                                  sodium_LIBRARY_DEBUG
+                                  sodium_INCLUDE_DIR
+                                  VERSION_VAR
+                                  sodium_VERSION_STRING)
 
 # mark file paths as advanced
 mark_as_advanced(sodium_INCLUDE_DIR)
 mark_as_advanced(sodium_LIBRARY_DEBUG)
 mark_as_advanced(sodium_LIBRARY_RELEASE)
-if (WIN32)
-    mark_as_advanced(sodium_DLL_DEBUG)
-    mark_as_advanced(sodium_DLL_RELEASE)
+if(WIN32)
+  mark_as_advanced(sodium_DLL_DEBUG)
+  mark_as_advanced(sodium_DLL_RELEASE)
 endif()
 
 # create imported target
 if(sodium_USE_STATIC_LIBS)
-    set(_LIB_TYPE STATIC)
+  set(_LIB_TYPE STATIC)
 else()
-    set(_LIB_TYPE SHARED)
+  set(_LIB_TYPE SHARED)
 endif()
 add_library(sodium ${_LIB_TYPE} IMPORTED)
 
-set_target_properties(sodium PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"
-    IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-)
+set_target_properties(sodium
+                      PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+                                 "${sodium_INCLUDE_DIR}"
+                                 IMPORTED_LINK_INTERFACE_LANGUAGES
+                                 "C")
 
-if (sodium_USE_STATIC_LIBS)
-    set_target_properties(sodium PROPERTIES
-        INTERFACE_COMPILE_DEFINITIONS "SODIUM_STATIC"
-        IMPORTED_LOCATION "${sodium_LIBRARY_RELEASE}"
-        IMPORTED_LOCATION_DEBUG "${sodium_LIBRARY_DEBUG}"
-    )
+if(sodium_USE_STATIC_LIBS)
+  set_target_properties(sodium
+                        PROPERTIES INTERFACE_COMPILE_DEFINITIONS
+                                   "SODIUM_STATIC"
+                                   IMPORTED_LOCATION
+                                   "${sodium_LIBRARY_RELEASE}"
+                                   IMPORTED_LOCATION_DEBUG
+                                   "${sodium_LIBRARY_DEBUG}")
 else()
-    if (UNIX)
-        set_target_properties(sodium PROPERTIES
-            IMPORTED_LOCATION "${sodium_LIBRARY_RELEASE}"
-            IMPORTED_LOCATION_DEBUG "${sodium_LIBRARY_DEBUG}"
-        )
-    elseif (WIN32)
-        set_target_properties(sodium PROPERTIES
-            IMPORTED_IMPLIB "${sodium_LIBRARY_RELEASE}"
-            IMPORTED_IMPLIB_DEBUG "${sodium_LIBRARY_DEBUG}"
-        )
-        if (NOT (sodium_DLL_DEBUG MATCHES ".*-NOTFOUND"))
-            set_target_properties(sodium PROPERTIES
-                IMPORTED_LOCATION_DEBUG "${sodium_DLL_DEBUG}"
-            )
-        endif()
-        if (NOT (sodium_DLL_RELEASE MATCHES ".*-NOTFOUND"))
-            set_target_properties(sodium PROPERTIES
-                IMPORTED_LOCATION_RELWITHDEBINFO "${sodium_DLL_RELEASE}"
-                IMPORTED_LOCATION_MINSIZEREL "${sodium_DLL_RELEASE}"
-                IMPORTED_LOCATION_RELEASE "${sodium_DLL_RELEASE}"
-            )
-        endif()
+  if(UNIX)
+    set_target_properties(sodium
+                          PROPERTIES IMPORTED_LOCATION
+                                     "${sodium_LIBRARY_RELEASE}"
+                                     IMPORTED_LOCATION_DEBUG
+                                     "${sodium_LIBRARY_DEBUG}")
+  elseif(WIN32)
+    set_target_properties(sodium
+                          PROPERTIES IMPORTED_IMPLIB
+                                     "${sodium_LIBRARY_RELEASE}"
+                                     IMPORTED_IMPLIB_DEBUG
+                                     "${sodium_LIBRARY_DEBUG}")
+    if(NOT (sodium_DLL_DEBUG MATCHES ".*-NOTFOUND"))
+      set_target_properties(sodium
+                            PROPERTIES IMPORTED_LOCATION_DEBUG
+                                       "${sodium_DLL_DEBUG}")
+    endif()
+    if(NOT (sodium_DLL_RELEASE MATCHES ".*-NOTFOUND"))
+      set_target_properties(sodium
+                            PROPERTIES IMPORTED_LOCATION_RELWITHDEBINFO
+                                       "${sodium_DLL_RELEASE}"
+                                       IMPORTED_LOCATION_MINSIZEREL
+                                       "${sodium_DLL_RELEASE}"
+                                       IMPORTED_LOCATION_RELEASE
+                                       "${sodium_DLL_RELEASE}")
     endif()
+  endif()
 endif()
diff --git a/dist-build/Makefile.am b/dist-build/Makefile.am
index 63a8298f52a8278148a3220cc5a4a1d11f8e5059..79949e74e2f9856fb588bd6f8c84dd5a10dbe88c 100644
--- a/dist-build/Makefile.am
+++ b/dist-build/Makefile.am
@@ -12,7 +12,5 @@ EXTRA_DIST = \
 	ios.sh \
 	msys2-win32.sh \
 	msys2-win64.sh \
-	nativeclient-pnacl.sh \
-	nativeclient-x86.sh \
-	nativeclient-x86_64.sh \
-	watchos.sh
+	watchos.sh \
+	wasm32-wasi.sh
diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh
index d98ddead581465874b702302761308e8d289f8d0..76917504a4ab6120ba12191640358e3b44d266f7 100755
--- a/dist-build/android-build.sh
+++ b/dist-build/android-build.sh
@@ -33,6 +33,12 @@ export CC=${CC:-"${HOST_COMPILER}-clang"}
 
 rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}"
 
+echo
+echo "Warnings related to headers being present but not usable are due to functions"
+echo "that didn't exist in the specified minimum API version level."
+echo "They can be safely ignored."
+echo
+
 echo
 if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then
   echo "Building for platform [${NDK_PLATFORM}], retaining compatibility with platform [${NDK_PLATFORM_COMPAT}]"
diff --git a/dist-build/emscripten-symbols.def b/dist-build/emscripten-symbols.def
index d4a6ff04fe597be079c5178fc8de60aba0ef047c..b1761c5d31d9d70197462aff84bd180f6c31a9b1 100644
--- a/dist-build/emscripten-symbols.def
+++ b/dist-build/emscripten-symbols.def
@@ -145,12 +145,16 @@ _crypto_box_seedbytes 1 1
 _crypto_box_zerobytes 0 1
 _crypto_core_ed25519_add 0 1
 _crypto_core_ed25519_bytes 0 1
+_crypto_core_ed25519_from_hash 0 1
 _crypto_core_ed25519_from_uniform 0 1
+_crypto_core_ed25519_hashbytes 0 1
 _crypto_core_ed25519_is_valid_point 0 1
 _crypto_core_ed25519_nonreducedscalarbytes 0 1
+_crypto_core_ed25519_random 0 1
 _crypto_core_ed25519_scalar_add 0 1
 _crypto_core_ed25519_scalar_complement 0 1
 _crypto_core_ed25519_scalar_invert 0 1
+_crypto_core_ed25519_scalar_mul 0 1
 _crypto_core_ed25519_scalar_negate 0 1
 _crypto_core_ed25519_scalar_random 0 1
 _crypto_core_ed25519_scalar_reduce 0 1
@@ -168,6 +172,24 @@ _crypto_core_hsalsa20_constbytes 0 1
 _crypto_core_hsalsa20_inputbytes 0 1
 _crypto_core_hsalsa20_keybytes 0 1
 _crypto_core_hsalsa20_outputbytes 0 1
+_crypto_core_ristretto255_add 0 1
+_crypto_core_ristretto255_bytes 0 1
+_crypto_core_ristretto255_from_hash 0 1
+_crypto_core_ristretto255_hashbytes 0 1
+_crypto_core_ristretto255_is_valid_point 0 1
+_crypto_core_ristretto255_nonreducedscalarbytes 0 1
+_crypto_core_ristretto255_random 0 1
+_crypto_core_ristretto255_scalar_add 0 1
+_crypto_core_ristretto255_scalar_complement 0 1
+_crypto_core_ristretto255_scalar_invert 0 1
+_crypto_core_ristretto255_scalar_mul 0 1
+_crypto_core_ristretto255_scalar_negate 0 1
+_crypto_core_ristretto255_scalar_random 0 1
+_crypto_core_ristretto255_scalar_reduce 0 1
+_crypto_core_ristretto255_scalar_sub 0 1
+_crypto_core_ristretto255_scalarbytes 0 1
+_crypto_core_ristretto255_sub 0 1
+_crypto_core_ristretto255_uniformbytes 0 1
 _crypto_core_salsa20 0 1
 _crypto_core_salsa2012 0 1
 _crypto_core_salsa2012_constbytes 0 1
@@ -371,6 +393,10 @@ _crypto_scalarmult_ed25519_bytes 0 1
 _crypto_scalarmult_ed25519_noclamp 0 1
 _crypto_scalarmult_ed25519_scalarbytes 0 1
 _crypto_scalarmult_primitive 0 1
+_crypto_scalarmult_ristretto255 0 1
+_crypto_scalarmult_ristretto255_base 0 1
+_crypto_scalarmult_ristretto255_bytes 0 1
+_crypto_scalarmult_ristretto255_scalarbytes 0 1
 _crypto_scalarmult_scalarbytes 1 1
 _crypto_secretbox 0 1
 _crypto_secretbox_boxzerobytes 0 1
diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh
index a5a23e70ba0f605bc3484bd0e9f4a9df6c53fad6..63bb997992206f47c2fd98948b4c9c7ac6048781 100755
--- a/dist-build/emscripten.sh
+++ b/dist-build/emscripten.sh
@@ -2,11 +2,11 @@
 
 export MAKE_FLAGS='-j4'
 export EXPORTED_FUNCTIONS_STANDARD='["_malloc","_free","_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_keygen","_crypto_aead_chacha20poly1305_ietf_messagebytes_max","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_keygen","_crypto_aead_chacha20poly1305_messagebytes_max","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_aead_xchacha20poly1305_ietf_abytes","_crypto_aead_xchacha20poly1305_ietf_decrypt","_crypto_aead_xchacha20poly1305_ietf_decrypt_detached","_crypto_aead_xchacha20poly1305_ietf_encrypt","_crypto_aead_xchacha20poly1305_ietf_encrypt_detached","_crypto_aead_xchacha20poly1305_ietf_keybytes","_crypto_aead_xchacha20poly1305_ietf_keygen","_crypto_aead_xchacha20poly1305_ietf_messagebytes_max","_crypto_aead_xchacha20poly1305_ietf_npubbytes","_crypto_aead_xchacha20poly1305_ietf_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_keybytes","_crypto_auth_keygen","_crypto_auth_verify","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_messagebytes_max","_crypto_box_noncebytes","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_generichash","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_keygen","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_kdf_bytes_max","_crypto_kdf_bytes_min","_crypto_kdf_contextbytes","_crypto_kdf_derive_from_key","_crypto_kdf_keybytes","_crypto_kdf_keygen","_crypto_kx_client_session_keys","_crypto_kx_keypair","_crypto_kx_publickeybytes","_crypto_kx_secretkeybytes","_crypto_kx_seed_keypair","_crypto_kx_seedbytes","_crypto_kx_server_session_keys","_crypto_kx_sessionkeybytes","_crypto_pwhash","_crypto_pwhash_alg_argon2i13","_crypto_pwhash_alg_argon2id13","_crypto_pwhash_alg_default","_crypto_pwhash_bytes_max","_crypto_pwhash_bytes_min","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_max","_crypto_pwhash_memlimit_min","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_max","_crypto_pwhash_opslimit_min","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_passwd_max","_crypto_pwhash_passwd_min","_crypto_pwhash_saltbytes","_crypto_pwhash_str","_crypto_pwhash_str_alg","_crypto_pwhash_str_needs_rehash","_crypto_pwhash_str_verify","_crypto_pwhash_strbytes","_crypto_pwhash_strprefix","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_scalarbytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_keygen","_crypto_secretbox_macbytes","_crypto_secretbox_messagebytes_max","_crypto_secretbox_noncebytes","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_secretstream_xchacha20poly1305_abytes","_crypto_secretstream_xchacha20poly1305_headerbytes","_crypto_secretstream_xchacha20poly1305_init_pull","_crypto_secretstream_xchacha20poly1305_init_push","_crypto_secretstream_xchacha20poly1305_keybytes","_crypto_secretstream_xchacha20poly1305_keygen","_crypto_secretstream_xchacha20poly1305_messagebytes_max","_crypto_secretstream_xchacha20poly1305_pull","_crypto_secretstream_xchacha20poly1305_push","_crypto_secretstream_xchacha20poly1305_rekey","_crypto_secretstream_xchacha20poly1305_statebytes","_crypto_secretstream_xchacha20poly1305_tag_final","_crypto_secretstream_xchacha20poly1305_tag_message","_crypto_secretstream_xchacha20poly1305_tag_push","_crypto_secretstream_xchacha20poly1305_tag_rekey","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_shorthash_keygen","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_final_create","_crypto_sign_final_verify","_crypto_sign_init","_crypto_sign_keypair","_crypto_sign_messagebytes_max","_crypto_sign_open","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_statebytes","_crypto_sign_update","_crypto_sign_verify_detached","_randombytes","_randombytes_buf","_randombytes_buf_deterministic","_randombytes_close","_randombytes_random","_randombytes_seedbytes","_randombytes_stir","_randombytes_uniform","_sodium_base642bin","_sodium_base64_encoded_len","_sodium_bin2base64","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_minimal","_sodium_library_version_major","_sodium_library_version_minor","_sodium_pad","_sodium_unpad","_sodium_version_string"]'
-export EXPORTED_FUNCTIONS_SUMO='["_malloc","_free","_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_keygen","_crypto_aead_chacha20poly1305_ietf_messagebytes_max","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_keygen","_crypto_aead_chacha20poly1305_messagebytes_max","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_aead_xchacha20poly1305_ietf_abytes","_crypto_aead_xchacha20poly1305_ietf_decrypt","_crypto_aead_xchacha20poly1305_ietf_decrypt_detached","_crypto_aead_xchacha20poly1305_ietf_encrypt","_crypto_aead_xchacha20poly1305_ietf_encrypt_detached","_crypto_aead_xchacha20poly1305_ietf_keybytes","_crypto_aead_xchacha20poly1305_ietf_keygen","_crypto_aead_xchacha20poly1305_ietf_messagebytes_max","_crypto_aead_xchacha20poly1305_ietf_npubbytes","_crypto_aead_xchacha20poly1305_ietf_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_hmacsha256","_crypto_auth_hmacsha256_bytes","_crypto_auth_hmacsha256_final","_crypto_auth_hmacsha256_init","_crypto_auth_hmacsha256_keybytes","_crypto_auth_hmacsha256_keygen","_crypto_auth_hmacsha256_statebytes","_crypto_auth_hmacsha256_update","_crypto_auth_hmacsha256_verify","_crypto_auth_hmacsha512","_crypto_auth_hmacsha512256","_crypto_auth_hmacsha512256_bytes","_crypto_auth_hmacsha512256_final","_crypto_auth_hmacsha512256_init","_crypto_auth_hmacsha512256_keybytes","_crypto_auth_hmacsha512256_keygen","_crypto_auth_hmacsha512256_statebytes","_crypto_auth_hmacsha512256_update","_crypto_auth_hmacsha512256_verify","_crypto_auth_hmacsha512_bytes","_crypto_auth_hmacsha512_final","_crypto_auth_hmacsha512_init","_crypto_auth_hmacsha512_keybytes","_crypto_auth_hmacsha512_keygen","_crypto_auth_hmacsha512_statebytes","_crypto_auth_hmacsha512_update","_crypto_auth_hmacsha512_verify","_crypto_auth_keybytes","_crypto_auth_keygen","_crypto_auth_primitive","_crypto_auth_verify","_crypto_box","_crypto_box_afternm","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_boxzerobytes","_crypto_box_curve25519xchacha20poly1305_beforenm","_crypto_box_curve25519xchacha20poly1305_beforenmbytes","_crypto_box_curve25519xchacha20poly1305_detached","_crypto_box_curve25519xchacha20poly1305_detached_afternm","_crypto_box_curve25519xchacha20poly1305_easy","_crypto_box_curve25519xchacha20poly1305_easy_afternm","_crypto_box_curve25519xchacha20poly1305_keypair","_crypto_box_curve25519xchacha20poly1305_macbytes","_crypto_box_curve25519xchacha20poly1305_messagebytes_max","_crypto_box_curve25519xchacha20poly1305_noncebytes","_crypto_box_curve25519xchacha20poly1305_open_detached","_crypto_box_curve25519xchacha20poly1305_open_detached_afternm","_crypto_box_curve25519xchacha20poly1305_open_easy","_crypto_box_curve25519xchacha20poly1305_open_easy_afternm","_crypto_box_curve25519xchacha20poly1305_publickeybytes","_crypto_box_curve25519xchacha20poly1305_seal","_crypto_box_curve25519xchacha20poly1305_seal_open","_crypto_box_curve25519xchacha20poly1305_sealbytes","_crypto_box_curve25519xchacha20poly1305_secretkeybytes","_crypto_box_curve25519xchacha20poly1305_seed_keypair","_crypto_box_curve25519xchacha20poly1305_seedbytes","_crypto_box_curve25519xsalsa20poly1305","_crypto_box_curve25519xsalsa20poly1305_afternm","_crypto_box_curve25519xsalsa20poly1305_beforenm","_crypto_box_curve25519xsalsa20poly1305_beforenmbytes","_crypto_box_curve25519xsalsa20poly1305_boxzerobytes","_crypto_box_curve25519xsalsa20poly1305_keypair","_crypto_box_curve25519xsalsa20poly1305_macbytes","_crypto_box_curve25519xsalsa20poly1305_messagebytes_max","_crypto_box_curve25519xsalsa20poly1305_noncebytes","_crypto_box_curve25519xsalsa20poly1305_open","_crypto_box_curve25519xsalsa20poly1305_open_afternm","_crypto_box_curve25519xsalsa20poly1305_publickeybytes","_crypto_box_curve25519xsalsa20poly1305_secretkeybytes","_crypto_box_curve25519xsalsa20poly1305_seed_keypair","_crypto_box_curve25519xsalsa20poly1305_seedbytes","_crypto_box_curve25519xsalsa20poly1305_zerobytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_messagebytes_max","_crypto_box_noncebytes","_crypto_box_open","_crypto_box_open_afternm","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_primitive","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_box_zerobytes","_crypto_core_ed25519_add","_crypto_core_ed25519_bytes","_crypto_core_ed25519_from_uniform","_crypto_core_ed25519_is_valid_point","_crypto_core_ed25519_nonreducedscalarbytes","_crypto_core_ed25519_scalar_add","_crypto_core_ed25519_scalar_complement","_crypto_core_ed25519_scalar_invert","_crypto_core_ed25519_scalar_negate","_crypto_core_ed25519_scalar_random","_crypto_core_ed25519_scalar_reduce","_crypto_core_ed25519_scalar_sub","_crypto_core_ed25519_scalarbytes","_crypto_core_ed25519_sub","_crypto_core_ed25519_uniformbytes","_crypto_core_hchacha20","_crypto_core_hchacha20_constbytes","_crypto_core_hchacha20_inputbytes","_crypto_core_hchacha20_keybytes","_crypto_core_hchacha20_outputbytes","_crypto_core_hsalsa20","_crypto_core_hsalsa20_constbytes","_crypto_core_hsalsa20_inputbytes","_crypto_core_hsalsa20_keybytes","_crypto_core_hsalsa20_outputbytes","_crypto_core_salsa20","_crypto_core_salsa2012","_crypto_core_salsa2012_constbytes","_crypto_core_salsa2012_inputbytes","_crypto_core_salsa2012_keybytes","_crypto_core_salsa2012_outputbytes","_crypto_core_salsa208","_crypto_core_salsa208_constbytes","_crypto_core_salsa208_inputbytes","_crypto_core_salsa208_keybytes","_crypto_core_salsa208_outputbytes","_crypto_core_salsa20_constbytes","_crypto_core_salsa20_inputbytes","_crypto_core_salsa20_keybytes","_crypto_core_salsa20_outputbytes","_crypto_generichash","_crypto_generichash_blake2b","_crypto_generichash_blake2b_bytes","_crypto_generichash_blake2b_bytes_max","_crypto_generichash_blake2b_bytes_min","_crypto_generichash_blake2b_final","_crypto_generichash_blake2b_init","_crypto_generichash_blake2b_init_salt_personal","_crypto_generichash_blake2b_keybytes","_crypto_generichash_blake2b_keybytes_max","_crypto_generichash_blake2b_keybytes_min","_crypto_generichash_blake2b_keygen","_crypto_generichash_blake2b_personalbytes","_crypto_generichash_blake2b_salt_personal","_crypto_generichash_blake2b_saltbytes","_crypto_generichash_blake2b_statebytes","_crypto_generichash_blake2b_update","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_keygen","_crypto_generichash_primitive","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_hash_primitive","_crypto_hash_sha256","_crypto_hash_sha256_bytes","_crypto_hash_sha256_final","_crypto_hash_sha256_init","_crypto_hash_sha256_statebytes","_crypto_hash_sha256_update","_crypto_hash_sha512","_crypto_hash_sha512_bytes","_crypto_hash_sha512_final","_crypto_hash_sha512_init","_crypto_hash_sha512_statebytes","_crypto_hash_sha512_update","_crypto_kdf_blake2b_bytes_max","_crypto_kdf_blake2b_bytes_min","_crypto_kdf_blake2b_contextbytes","_crypto_kdf_blake2b_derive_from_key","_crypto_kdf_blake2b_keybytes","_crypto_kdf_bytes_max","_crypto_kdf_bytes_min","_crypto_kdf_contextbytes","_crypto_kdf_derive_from_key","_crypto_kdf_keybytes","_crypto_kdf_keygen","_crypto_kdf_primitive","_crypto_kx_client_session_keys","_crypto_kx_keypair","_crypto_kx_primitive","_crypto_kx_publickeybytes","_crypto_kx_secretkeybytes","_crypto_kx_seed_keypair","_crypto_kx_seedbytes","_crypto_kx_server_session_keys","_crypto_kx_sessionkeybytes","_crypto_onetimeauth","_crypto_onetimeauth_bytes","_crypto_onetimeauth_final","_crypto_onetimeauth_init","_crypto_onetimeauth_keybytes","_crypto_onetimeauth_keygen","_crypto_onetimeauth_poly1305","_crypto_onetimeauth_poly1305_bytes","_crypto_onetimeauth_poly1305_final","_crypto_onetimeauth_poly1305_init","_crypto_onetimeauth_poly1305_keybytes","_crypto_onetimeauth_poly1305_keygen","_crypto_onetimeauth_poly1305_statebytes","_crypto_onetimeauth_poly1305_update","_crypto_onetimeauth_poly1305_verify","_crypto_onetimeauth_primitive","_crypto_onetimeauth_statebytes","_crypto_onetimeauth_update","_crypto_onetimeauth_verify","_crypto_pwhash","_crypto_pwhash_alg_argon2i13","_crypto_pwhash_alg_argon2id13","_crypto_pwhash_alg_default","_crypto_pwhash_argon2i","_crypto_pwhash_argon2i_alg_argon2i13","_crypto_pwhash_argon2i_bytes_max","_crypto_pwhash_argon2i_bytes_min","_crypto_pwhash_argon2i_memlimit_interactive","_crypto_pwhash_argon2i_memlimit_max","_crypto_pwhash_argon2i_memlimit_min","_crypto_pwhash_argon2i_memlimit_moderate","_crypto_pwhash_argon2i_memlimit_sensitive","_crypto_pwhash_argon2i_opslimit_interactive","_crypto_pwhash_argon2i_opslimit_max","_crypto_pwhash_argon2i_opslimit_min","_crypto_pwhash_argon2i_opslimit_moderate","_crypto_pwhash_argon2i_opslimit_sensitive","_crypto_pwhash_argon2i_passwd_max","_crypto_pwhash_argon2i_passwd_min","_crypto_pwhash_argon2i_saltbytes","_crypto_pwhash_argon2i_str","_crypto_pwhash_argon2i_str_needs_rehash","_crypto_pwhash_argon2i_str_verify","_crypto_pwhash_argon2i_strbytes","_crypto_pwhash_argon2i_strprefix","_crypto_pwhash_argon2id","_crypto_pwhash_argon2id_alg_argon2id13","_crypto_pwhash_argon2id_bytes_max","_crypto_pwhash_argon2id_bytes_min","_crypto_pwhash_argon2id_memlimit_interactive","_crypto_pwhash_argon2id_memlimit_max","_crypto_pwhash_argon2id_memlimit_min","_crypto_pwhash_argon2id_memlimit_moderate","_crypto_pwhash_argon2id_memlimit_sensitive","_crypto_pwhash_argon2id_opslimit_interactive","_crypto_pwhash_argon2id_opslimit_max","_crypto_pwhash_argon2id_opslimit_min","_crypto_pwhash_argon2id_opslimit_moderate","_crypto_pwhash_argon2id_opslimit_sensitive","_crypto_pwhash_argon2id_passwd_max","_crypto_pwhash_argon2id_passwd_min","_crypto_pwhash_argon2id_saltbytes","_crypto_pwhash_argon2id_str","_crypto_pwhash_argon2id_str_needs_rehash","_crypto_pwhash_argon2id_str_verify","_crypto_pwhash_argon2id_strbytes","_crypto_pwhash_argon2id_strprefix","_crypto_pwhash_bytes_max","_crypto_pwhash_bytes_min","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_max","_crypto_pwhash_memlimit_min","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_max","_crypto_pwhash_opslimit_min","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_passwd_max","_crypto_pwhash_passwd_min","_crypto_pwhash_primitive","_crypto_pwhash_saltbytes","_crypto_pwhash_scryptsalsa208sha256","_crypto_pwhash_scryptsalsa208sha256_bytes_max","_crypto_pwhash_scryptsalsa208sha256_bytes_min","_crypto_pwhash_scryptsalsa208sha256_ll","_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive","_crypto_pwhash_scryptsalsa208sha256_memlimit_max","_crypto_pwhash_scryptsalsa208sha256_memlimit_min","_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive","_crypto_pwhash_scryptsalsa208sha256_opslimit_max","_crypto_pwhash_scryptsalsa208sha256_opslimit_min","_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_passwd_max","_crypto_pwhash_scryptsalsa208sha256_passwd_min","_crypto_pwhash_scryptsalsa208sha256_saltbytes","_crypto_pwhash_scryptsalsa208sha256_str","_crypto_pwhash_scryptsalsa208sha256_str_needs_rehash","_crypto_pwhash_scryptsalsa208sha256_str_verify","_crypto_pwhash_scryptsalsa208sha256_strbytes","_crypto_pwhash_scryptsalsa208sha256_strprefix","_crypto_pwhash_str","_crypto_pwhash_str_alg","_crypto_pwhash_str_needs_rehash","_crypto_pwhash_str_verify","_crypto_pwhash_strbytes","_crypto_pwhash_strprefix","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_curve25519","_crypto_scalarmult_curve25519_base","_crypto_scalarmult_curve25519_bytes","_crypto_scalarmult_curve25519_scalarbytes","_crypto_scalarmult_ed25519","_crypto_scalarmult_ed25519_base","_crypto_scalarmult_ed25519_base_noclamp","_crypto_scalarmult_ed25519_bytes","_crypto_scalarmult_ed25519_noclamp","_crypto_scalarmult_ed25519_scalarbytes","_crypto_scalarmult_primitive","_crypto_scalarmult_scalarbytes","_crypto_secretbox","_crypto_secretbox_boxzerobytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_keygen","_crypto_secretbox_macbytes","_crypto_secretbox_messagebytes_max","_crypto_secretbox_noncebytes","_crypto_secretbox_open","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_secretbox_primitive","_crypto_secretbox_xchacha20poly1305_detached","_crypto_secretbox_xchacha20poly1305_easy","_crypto_secretbox_xchacha20poly1305_keybytes","_crypto_secretbox_xchacha20poly1305_macbytes","_crypto_secretbox_xchacha20poly1305_messagebytes_max","_crypto_secretbox_xchacha20poly1305_noncebytes","_crypto_secretbox_xchacha20poly1305_open_detached","_crypto_secretbox_xchacha20poly1305_open_easy","_crypto_secretbox_xsalsa20poly1305","_crypto_secretbox_xsalsa20poly1305_boxzerobytes","_crypto_secretbox_xsalsa20poly1305_keybytes","_crypto_secretbox_xsalsa20poly1305_keygen","_crypto_secretbox_xsalsa20poly1305_macbytes","_crypto_secretbox_xsalsa20poly1305_messagebytes_max","_crypto_secretbox_xsalsa20poly1305_noncebytes","_crypto_secretbox_xsalsa20poly1305_open","_crypto_secretbox_xsalsa20poly1305_zerobytes","_crypto_secretbox_zerobytes","_crypto_secretstream_xchacha20poly1305_abytes","_crypto_secretstream_xchacha20poly1305_headerbytes","_crypto_secretstream_xchacha20poly1305_init_pull","_crypto_secretstream_xchacha20poly1305_init_push","_crypto_secretstream_xchacha20poly1305_keybytes","_crypto_secretstream_xchacha20poly1305_keygen","_crypto_secretstream_xchacha20poly1305_messagebytes_max","_crypto_secretstream_xchacha20poly1305_pull","_crypto_secretstream_xchacha20poly1305_push","_crypto_secretstream_xchacha20poly1305_rekey","_crypto_secretstream_xchacha20poly1305_statebytes","_crypto_secretstream_xchacha20poly1305_tag_final","_crypto_secretstream_xchacha20poly1305_tag_message","_crypto_secretstream_xchacha20poly1305_tag_push","_crypto_secretstream_xchacha20poly1305_tag_rekey","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_shorthash_keygen","_crypto_shorthash_primitive","_crypto_shorthash_siphash24","_crypto_shorthash_siphash24_bytes","_crypto_shorthash_siphash24_keybytes","_crypto_shorthash_siphashx24","_crypto_shorthash_siphashx24_bytes","_crypto_shorthash_siphashx24_keybytes","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519","_crypto_sign_ed25519_bytes","_crypto_sign_ed25519_detached","_crypto_sign_ed25519_keypair","_crypto_sign_ed25519_messagebytes_max","_crypto_sign_ed25519_open","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_publickeybytes","_crypto_sign_ed25519_secretkeybytes","_crypto_sign_ed25519_seed_keypair","_crypto_sign_ed25519_seedbytes","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_ed25519_sk_to_pk","_crypto_sign_ed25519_sk_to_seed","_crypto_sign_ed25519_verify_detached","_crypto_sign_ed25519ph_final_create","_crypto_sign_ed25519ph_final_verify","_crypto_sign_ed25519ph_init","_crypto_sign_ed25519ph_statebytes","_crypto_sign_ed25519ph_update","_crypto_sign_final_create","_crypto_sign_final_verify","_crypto_sign_init","_crypto_sign_keypair","_crypto_sign_messagebytes_max","_crypto_sign_open","_crypto_sign_primitive","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_statebytes","_crypto_sign_update","_crypto_sign_verify_detached","_crypto_stream","_crypto_stream_chacha20","_crypto_stream_chacha20_ietf","_crypto_stream_chacha20_ietf_keybytes","_crypto_stream_chacha20_ietf_keygen","_crypto_stream_chacha20_ietf_messagebytes_max","_crypto_stream_chacha20_ietf_noncebytes","_crypto_stream_chacha20_ietf_xor","_crypto_stream_chacha20_ietf_xor_ic","_crypto_stream_chacha20_keybytes","_crypto_stream_chacha20_keygen","_crypto_stream_chacha20_messagebytes_max","_crypto_stream_chacha20_noncebytes","_crypto_stream_chacha20_xor","_crypto_stream_chacha20_xor_ic","_crypto_stream_keybytes","_crypto_stream_keygen","_crypto_stream_messagebytes_max","_crypto_stream_noncebytes","_crypto_stream_primitive","_crypto_stream_salsa20","_crypto_stream_salsa2012","_crypto_stream_salsa2012_keybytes","_crypto_stream_salsa2012_keygen","_crypto_stream_salsa2012_messagebytes_max","_crypto_stream_salsa2012_noncebytes","_crypto_stream_salsa2012_xor","_crypto_stream_salsa208","_crypto_stream_salsa208_keybytes","_crypto_stream_salsa208_keygen","_crypto_stream_salsa208_messagebytes_max","_crypto_stream_salsa208_noncebytes","_crypto_stream_salsa208_xor","_crypto_stream_salsa20_keybytes","_crypto_stream_salsa20_keygen","_crypto_stream_salsa20_messagebytes_max","_crypto_stream_salsa20_noncebytes","_crypto_stream_salsa20_xor","_crypto_stream_salsa20_xor_ic","_crypto_stream_xchacha20","_crypto_stream_xchacha20_keybytes","_crypto_stream_xchacha20_keygen","_crypto_stream_xchacha20_messagebytes_max","_crypto_stream_xchacha20_noncebytes","_crypto_stream_xchacha20_xor","_crypto_stream_xchacha20_xor_ic","_crypto_stream_xor","_crypto_stream_xsalsa20","_crypto_stream_xsalsa20_keybytes","_crypto_stream_xsalsa20_keygen","_crypto_stream_xsalsa20_messagebytes_max","_crypto_stream_xsalsa20_noncebytes","_crypto_stream_xsalsa20_xor","_crypto_stream_xsalsa20_xor_ic","_crypto_verify_16","_crypto_verify_16_bytes","_crypto_verify_32","_crypto_verify_32_bytes","_crypto_verify_64","_crypto_verify_64_bytes","_randombytes","_randombytes_buf","_randombytes_buf_deterministic","_randombytes_close","_randombytes_implementation_name","_randombytes_random","_randombytes_seedbytes","_randombytes_stir","_randombytes_uniform","_sodium_base642bin","_sodium_base64_encoded_len","_sodium_bin2base64","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_minimal","_sodium_library_version_major","_sodium_library_version_minor","_sodium_pad","_sodium_unpad","_sodium_version_string"]'
-export EXPORTED_RUNTIME_METHODS='["Pointer_stringify","getValue","setValue"]'
-export TOTAL_MEMORY=16777216
-export TOTAL_MEMORY_SUMO=16777216
-export TOTAL_MEMORY_TESTS=16777216
+export EXPORTED_FUNCTIONS_SUMO='["_malloc","_free","_crypto_aead_chacha20poly1305_abytes","_crypto_aead_chacha20poly1305_decrypt","_crypto_aead_chacha20poly1305_decrypt_detached","_crypto_aead_chacha20poly1305_encrypt","_crypto_aead_chacha20poly1305_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_abytes","_crypto_aead_chacha20poly1305_ietf_decrypt","_crypto_aead_chacha20poly1305_ietf_decrypt_detached","_crypto_aead_chacha20poly1305_ietf_encrypt","_crypto_aead_chacha20poly1305_ietf_encrypt_detached","_crypto_aead_chacha20poly1305_ietf_keybytes","_crypto_aead_chacha20poly1305_ietf_keygen","_crypto_aead_chacha20poly1305_ietf_messagebytes_max","_crypto_aead_chacha20poly1305_ietf_npubbytes","_crypto_aead_chacha20poly1305_ietf_nsecbytes","_crypto_aead_chacha20poly1305_keybytes","_crypto_aead_chacha20poly1305_keygen","_crypto_aead_chacha20poly1305_messagebytes_max","_crypto_aead_chacha20poly1305_npubbytes","_crypto_aead_chacha20poly1305_nsecbytes","_crypto_aead_xchacha20poly1305_ietf_abytes","_crypto_aead_xchacha20poly1305_ietf_decrypt","_crypto_aead_xchacha20poly1305_ietf_decrypt_detached","_crypto_aead_xchacha20poly1305_ietf_encrypt","_crypto_aead_xchacha20poly1305_ietf_encrypt_detached","_crypto_aead_xchacha20poly1305_ietf_keybytes","_crypto_aead_xchacha20poly1305_ietf_keygen","_crypto_aead_xchacha20poly1305_ietf_messagebytes_max","_crypto_aead_xchacha20poly1305_ietf_npubbytes","_crypto_aead_xchacha20poly1305_ietf_nsecbytes","_crypto_auth","_crypto_auth_bytes","_crypto_auth_hmacsha256","_crypto_auth_hmacsha256_bytes","_crypto_auth_hmacsha256_final","_crypto_auth_hmacsha256_init","_crypto_auth_hmacsha256_keybytes","_crypto_auth_hmacsha256_keygen","_crypto_auth_hmacsha256_statebytes","_crypto_auth_hmacsha256_update","_crypto_auth_hmacsha256_verify","_crypto_auth_hmacsha512","_crypto_auth_hmacsha512256","_crypto_auth_hmacsha512256_bytes","_crypto_auth_hmacsha512256_final","_crypto_auth_hmacsha512256_init","_crypto_auth_hmacsha512256_keybytes","_crypto_auth_hmacsha512256_keygen","_crypto_auth_hmacsha512256_statebytes","_crypto_auth_hmacsha512256_update","_crypto_auth_hmacsha512256_verify","_crypto_auth_hmacsha512_bytes","_crypto_auth_hmacsha512_final","_crypto_auth_hmacsha512_init","_crypto_auth_hmacsha512_keybytes","_crypto_auth_hmacsha512_keygen","_crypto_auth_hmacsha512_statebytes","_crypto_auth_hmacsha512_update","_crypto_auth_hmacsha512_verify","_crypto_auth_keybytes","_crypto_auth_keygen","_crypto_auth_primitive","_crypto_auth_verify","_crypto_box","_crypto_box_afternm","_crypto_box_beforenm","_crypto_box_beforenmbytes","_crypto_box_boxzerobytes","_crypto_box_curve25519xchacha20poly1305_beforenm","_crypto_box_curve25519xchacha20poly1305_beforenmbytes","_crypto_box_curve25519xchacha20poly1305_detached","_crypto_box_curve25519xchacha20poly1305_detached_afternm","_crypto_box_curve25519xchacha20poly1305_easy","_crypto_box_curve25519xchacha20poly1305_easy_afternm","_crypto_box_curve25519xchacha20poly1305_keypair","_crypto_box_curve25519xchacha20poly1305_macbytes","_crypto_box_curve25519xchacha20poly1305_messagebytes_max","_crypto_box_curve25519xchacha20poly1305_noncebytes","_crypto_box_curve25519xchacha20poly1305_open_detached","_crypto_box_curve25519xchacha20poly1305_open_detached_afternm","_crypto_box_curve25519xchacha20poly1305_open_easy","_crypto_box_curve25519xchacha20poly1305_open_easy_afternm","_crypto_box_curve25519xchacha20poly1305_publickeybytes","_crypto_box_curve25519xchacha20poly1305_seal","_crypto_box_curve25519xchacha20poly1305_seal_open","_crypto_box_curve25519xchacha20poly1305_sealbytes","_crypto_box_curve25519xchacha20poly1305_secretkeybytes","_crypto_box_curve25519xchacha20poly1305_seed_keypair","_crypto_box_curve25519xchacha20poly1305_seedbytes","_crypto_box_curve25519xsalsa20poly1305","_crypto_box_curve25519xsalsa20poly1305_afternm","_crypto_box_curve25519xsalsa20poly1305_beforenm","_crypto_box_curve25519xsalsa20poly1305_beforenmbytes","_crypto_box_curve25519xsalsa20poly1305_boxzerobytes","_crypto_box_curve25519xsalsa20poly1305_keypair","_crypto_box_curve25519xsalsa20poly1305_macbytes","_crypto_box_curve25519xsalsa20poly1305_messagebytes_max","_crypto_box_curve25519xsalsa20poly1305_noncebytes","_crypto_box_curve25519xsalsa20poly1305_open","_crypto_box_curve25519xsalsa20poly1305_open_afternm","_crypto_box_curve25519xsalsa20poly1305_publickeybytes","_crypto_box_curve25519xsalsa20poly1305_secretkeybytes","_crypto_box_curve25519xsalsa20poly1305_seed_keypair","_crypto_box_curve25519xsalsa20poly1305_seedbytes","_crypto_box_curve25519xsalsa20poly1305_zerobytes","_crypto_box_detached","_crypto_box_detached_afternm","_crypto_box_easy","_crypto_box_easy_afternm","_crypto_box_keypair","_crypto_box_macbytes","_crypto_box_messagebytes_max","_crypto_box_noncebytes","_crypto_box_open","_crypto_box_open_afternm","_crypto_box_open_detached","_crypto_box_open_detached_afternm","_crypto_box_open_easy","_crypto_box_open_easy_afternm","_crypto_box_primitive","_crypto_box_publickeybytes","_crypto_box_seal","_crypto_box_seal_open","_crypto_box_sealbytes","_crypto_box_secretkeybytes","_crypto_box_seed_keypair","_crypto_box_seedbytes","_crypto_box_zerobytes","_crypto_core_ed25519_add","_crypto_core_ed25519_bytes","_crypto_core_ed25519_from_hash","_crypto_core_ed25519_from_uniform","_crypto_core_ed25519_hashbytes","_crypto_core_ed25519_is_valid_point","_crypto_core_ed25519_nonreducedscalarbytes","_crypto_core_ed25519_random","_crypto_core_ed25519_scalar_add","_crypto_core_ed25519_scalar_complement","_crypto_core_ed25519_scalar_invert","_crypto_core_ed25519_scalar_mul","_crypto_core_ed25519_scalar_negate","_crypto_core_ed25519_scalar_random","_crypto_core_ed25519_scalar_reduce","_crypto_core_ed25519_scalar_sub","_crypto_core_ed25519_scalarbytes","_crypto_core_ed25519_sub","_crypto_core_ed25519_uniformbytes","_crypto_core_hchacha20","_crypto_core_hchacha20_constbytes","_crypto_core_hchacha20_inputbytes","_crypto_core_hchacha20_keybytes","_crypto_core_hchacha20_outputbytes","_crypto_core_hsalsa20","_crypto_core_hsalsa20_constbytes","_crypto_core_hsalsa20_inputbytes","_crypto_core_hsalsa20_keybytes","_crypto_core_hsalsa20_outputbytes","_crypto_core_ristretto255_add","_crypto_core_ristretto255_bytes","_crypto_core_ristretto255_from_hash","_crypto_core_ristretto255_hashbytes","_crypto_core_ristretto255_is_valid_point","_crypto_core_ristretto255_nonreducedscalarbytes","_crypto_core_ristretto255_random","_crypto_core_ristretto255_scalar_add","_crypto_core_ristretto255_scalar_complement","_crypto_core_ristretto255_scalar_invert","_crypto_core_ristretto255_scalar_mul","_crypto_core_ristretto255_scalar_negate","_crypto_core_ristretto255_scalar_random","_crypto_core_ristretto255_scalar_reduce","_crypto_core_ristretto255_scalar_sub","_crypto_core_ristretto255_scalarbytes","_crypto_core_ristretto255_sub","_crypto_core_salsa20","_crypto_core_salsa2012","_crypto_core_salsa2012_constbytes","_crypto_core_salsa2012_inputbytes","_crypto_core_salsa2012_keybytes","_crypto_core_salsa2012_outputbytes","_crypto_core_salsa208","_crypto_core_salsa208_constbytes","_crypto_core_salsa208_inputbytes","_crypto_core_salsa208_keybytes","_crypto_core_salsa208_outputbytes","_crypto_core_salsa20_constbytes","_crypto_core_salsa20_inputbytes","_crypto_core_salsa20_keybytes","_crypto_core_salsa20_outputbytes","_crypto_generichash","_crypto_generichash_blake2b","_crypto_generichash_blake2b_bytes","_crypto_generichash_blake2b_bytes_max","_crypto_generichash_blake2b_bytes_min","_crypto_generichash_blake2b_final","_crypto_generichash_blake2b_init","_crypto_generichash_blake2b_init_salt_personal","_crypto_generichash_blake2b_keybytes","_crypto_generichash_blake2b_keybytes_max","_crypto_generichash_blake2b_keybytes_min","_crypto_generichash_blake2b_keygen","_crypto_generichash_blake2b_personalbytes","_crypto_generichash_blake2b_salt_personal","_crypto_generichash_blake2b_saltbytes","_crypto_generichash_blake2b_statebytes","_crypto_generichash_blake2b_update","_crypto_generichash_bytes","_crypto_generichash_bytes_max","_crypto_generichash_bytes_min","_crypto_generichash_final","_crypto_generichash_init","_crypto_generichash_keybytes","_crypto_generichash_keybytes_max","_crypto_generichash_keybytes_min","_crypto_generichash_keygen","_crypto_generichash_primitive","_crypto_generichash_statebytes","_crypto_generichash_update","_crypto_hash","_crypto_hash_bytes","_crypto_hash_primitive","_crypto_hash_sha256","_crypto_hash_sha256_bytes","_crypto_hash_sha256_final","_crypto_hash_sha256_init","_crypto_hash_sha256_statebytes","_crypto_hash_sha256_update","_crypto_hash_sha512","_crypto_hash_sha512_bytes","_crypto_hash_sha512_final","_crypto_hash_sha512_init","_crypto_hash_sha512_statebytes","_crypto_hash_sha512_update","_crypto_kdf_blake2b_bytes_max","_crypto_kdf_blake2b_bytes_min","_crypto_kdf_blake2b_contextbytes","_crypto_kdf_blake2b_derive_from_key","_crypto_kdf_blake2b_keybytes","_crypto_kdf_bytes_max","_crypto_kdf_bytes_min","_crypto_kdf_contextbytes","_crypto_kdf_derive_from_key","_crypto_kdf_keybytes","_crypto_kdf_keygen","_crypto_kdf_primitive","_crypto_kx_client_session_keys","_crypto_kx_keypair","_crypto_kx_primitive","_crypto_kx_publickeybytes","_crypto_kx_secretkeybytes","_crypto_kx_seed_keypair","_crypto_kx_seedbytes","_crypto_kx_server_session_keys","_crypto_kx_sessionkeybytes","_crypto_onetimeauth","_crypto_onetimeauth_bytes","_crypto_onetimeauth_final","_crypto_onetimeauth_init","_crypto_onetimeauth_keybytes","_crypto_onetimeauth_keygen","_crypto_onetimeauth_poly1305","_crypto_onetimeauth_poly1305_bytes","_crypto_onetimeauth_poly1305_final","_crypto_onetimeauth_poly1305_init","_crypto_onetimeauth_poly1305_keybytes","_crypto_onetimeauth_poly1305_keygen","_crypto_onetimeauth_poly1305_statebytes","_crypto_onetimeauth_poly1305_update","_crypto_onetimeauth_poly1305_verify","_crypto_onetimeauth_primitive","_crypto_onetimeauth_statebytes","_crypto_onetimeauth_update","_crypto_onetimeauth_verify","_crypto_pwhash","_crypto_pwhash_alg_argon2i13","_crypto_pwhash_alg_argon2id13","_crypto_pwhash_alg_default","_crypto_pwhash_argon2i","_crypto_pwhash_argon2i_alg_argon2i13","_crypto_pwhash_argon2i_bytes_max","_crypto_pwhash_argon2i_bytes_min","_crypto_pwhash_argon2i_memlimit_interactive","_crypto_pwhash_argon2i_memlimit_max","_crypto_pwhash_argon2i_memlimit_min","_crypto_pwhash_argon2i_memlimit_moderate","_crypto_pwhash_argon2i_memlimit_sensitive","_crypto_pwhash_argon2i_opslimit_interactive","_crypto_pwhash_argon2i_opslimit_max","_crypto_pwhash_argon2i_opslimit_min","_crypto_pwhash_argon2i_opslimit_moderate","_crypto_pwhash_argon2i_opslimit_sensitive","_crypto_pwhash_argon2i_passwd_max","_crypto_pwhash_argon2i_passwd_min","_crypto_pwhash_argon2i_saltbytes","_crypto_pwhash_argon2i_str","_crypto_pwhash_argon2i_str_needs_rehash","_crypto_pwhash_argon2i_str_verify","_crypto_pwhash_argon2i_strbytes","_crypto_pwhash_argon2i_strprefix","_crypto_pwhash_argon2id","_crypto_pwhash_argon2id_alg_argon2id13","_crypto_pwhash_argon2id_bytes_max","_crypto_pwhash_argon2id_bytes_min","_crypto_pwhash_argon2id_memlimit_interactive","_crypto_pwhash_argon2id_memlimit_max","_crypto_pwhash_argon2id_memlimit_min","_crypto_pwhash_argon2id_memlimit_moderate","_crypto_pwhash_argon2id_memlimit_sensitive","_crypto_pwhash_argon2id_opslimit_interactive","_crypto_pwhash_argon2id_opslimit_max","_crypto_pwhash_argon2id_opslimit_min","_crypto_pwhash_argon2id_opslimit_moderate","_crypto_pwhash_argon2id_opslimit_sensitive","_crypto_pwhash_argon2id_passwd_max","_crypto_pwhash_argon2id_passwd_min","_crypto_pwhash_argon2id_saltbytes","_crypto_pwhash_argon2id_str","_crypto_pwhash_argon2id_str_needs_rehash","_crypto_pwhash_argon2id_str_verify","_crypto_pwhash_argon2id_strbytes","_crypto_pwhash_argon2id_strprefix","_crypto_pwhash_bytes_max","_crypto_pwhash_bytes_min","_crypto_pwhash_memlimit_interactive","_crypto_pwhash_memlimit_max","_crypto_pwhash_memlimit_min","_crypto_pwhash_memlimit_moderate","_crypto_pwhash_memlimit_sensitive","_crypto_pwhash_opslimit_interactive","_crypto_pwhash_opslimit_max","_crypto_pwhash_opslimit_min","_crypto_pwhash_opslimit_moderate","_crypto_pwhash_opslimit_sensitive","_crypto_pwhash_passwd_max","_crypto_pwhash_passwd_min","_crypto_pwhash_primitive","_crypto_pwhash_saltbytes","_crypto_pwhash_scryptsalsa208sha256","_crypto_pwhash_scryptsalsa208sha256_bytes_max","_crypto_pwhash_scryptsalsa208sha256_bytes_min","_crypto_pwhash_scryptsalsa208sha256_ll","_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive","_crypto_pwhash_scryptsalsa208sha256_memlimit_max","_crypto_pwhash_scryptsalsa208sha256_memlimit_min","_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive","_crypto_pwhash_scryptsalsa208sha256_opslimit_max","_crypto_pwhash_scryptsalsa208sha256_opslimit_min","_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive","_crypto_pwhash_scryptsalsa208sha256_passwd_max","_crypto_pwhash_scryptsalsa208sha256_passwd_min","_crypto_pwhash_scryptsalsa208sha256_saltbytes","_crypto_pwhash_scryptsalsa208sha256_str","_crypto_pwhash_scryptsalsa208sha256_str_needs_rehash","_crypto_pwhash_scryptsalsa208sha256_str_verify","_crypto_pwhash_scryptsalsa208sha256_strbytes","_crypto_pwhash_scryptsalsa208sha256_strprefix","_crypto_pwhash_str","_crypto_pwhash_str_alg","_crypto_pwhash_str_needs_rehash","_crypto_pwhash_str_verify","_crypto_pwhash_strbytes","_crypto_pwhash_strprefix","_crypto_scalarmult","_crypto_scalarmult_base","_crypto_scalarmult_bytes","_crypto_scalarmult_curve25519","_crypto_scalarmult_curve25519_base","_crypto_scalarmult_curve25519_bytes","_crypto_scalarmult_curve25519_scalarbytes","_crypto_scalarmult_ed25519","_crypto_scalarmult_ed25519_base","_crypto_scalarmult_ed25519_base_noclamp","_crypto_scalarmult_ed25519_bytes","_crypto_scalarmult_ed25519_noclamp","_crypto_scalarmult_ed25519_scalarbytes","_crypto_scalarmult_primitive","_crypto_scalarmult_ristretto255","_crypto_scalarmult_ristretto255_base","_crypto_scalarmult_ristretto255_bytes","_crypto_scalarmult_ristretto255_scalarbytes","_crypto_scalarmult_scalarbytes","_crypto_secretbox","_crypto_secretbox_boxzerobytes","_crypto_secretbox_detached","_crypto_secretbox_easy","_crypto_secretbox_keybytes","_crypto_secretbox_keygen","_crypto_secretbox_macbytes","_crypto_secretbox_messagebytes_max","_crypto_secretbox_noncebytes","_crypto_secretbox_open","_crypto_secretbox_open_detached","_crypto_secretbox_open_easy","_crypto_secretbox_primitive","_crypto_secretbox_xchacha20poly1305_detached","_crypto_secretbox_xchacha20poly1305_easy","_crypto_secretbox_xchacha20poly1305_keybytes","_crypto_secretbox_xchacha20poly1305_macbytes","_crypto_secretbox_xchacha20poly1305_messagebytes_max","_crypto_secretbox_xchacha20poly1305_noncebytes","_crypto_secretbox_xchacha20poly1305_open_detached","_crypto_secretbox_xchacha20poly1305_open_easy","_crypto_secretbox_xsalsa20poly1305","_crypto_secretbox_xsalsa20poly1305_boxzerobytes","_crypto_secretbox_xsalsa20poly1305_keybytes","_crypto_secretbox_xsalsa20poly1305_keygen","_crypto_secretbox_xsalsa20poly1305_macbytes","_crypto_secretbox_xsalsa20poly1305_messagebytes_max","_crypto_secretbox_xsalsa20poly1305_noncebytes","_crypto_secretbox_xsalsa20poly1305_open","_crypto_secretbox_xsalsa20poly1305_zerobytes","_crypto_secretbox_zerobytes","_crypto_secretstream_xchacha20poly1305_abytes","_crypto_secretstream_xchacha20poly1305_headerbytes","_crypto_secretstream_xchacha20poly1305_init_pull","_crypto_secretstream_xchacha20poly1305_init_push","_crypto_secretstream_xchacha20poly1305_keybytes","_crypto_secretstream_xchacha20poly1305_keygen","_crypto_secretstream_xchacha20poly1305_messagebytes_max","_crypto_secretstream_xchacha20poly1305_pull","_crypto_secretstream_xchacha20poly1305_push","_crypto_secretstream_xchacha20poly1305_rekey","_crypto_secretstream_xchacha20poly1305_statebytes","_crypto_secretstream_xchacha20poly1305_tag_final","_crypto_secretstream_xchacha20poly1305_tag_message","_crypto_secretstream_xchacha20poly1305_tag_push","_crypto_secretstream_xchacha20poly1305_tag_rekey","_crypto_shorthash","_crypto_shorthash_bytes","_crypto_shorthash_keybytes","_crypto_shorthash_keygen","_crypto_shorthash_primitive","_crypto_shorthash_siphash24","_crypto_shorthash_siphash24_bytes","_crypto_shorthash_siphash24_keybytes","_crypto_shorthash_siphashx24","_crypto_shorthash_siphashx24_bytes","_crypto_shorthash_siphashx24_keybytes","_crypto_sign","_crypto_sign_bytes","_crypto_sign_detached","_crypto_sign_ed25519","_crypto_sign_ed25519_bytes","_crypto_sign_ed25519_detached","_crypto_sign_ed25519_keypair","_crypto_sign_ed25519_messagebytes_max","_crypto_sign_ed25519_open","_crypto_sign_ed25519_pk_to_curve25519","_crypto_sign_ed25519_publickeybytes","_crypto_sign_ed25519_secretkeybytes","_crypto_sign_ed25519_seed_keypair","_crypto_sign_ed25519_seedbytes","_crypto_sign_ed25519_sk_to_curve25519","_crypto_sign_ed25519_sk_to_pk","_crypto_sign_ed25519_sk_to_seed","_crypto_sign_ed25519_verify_detached","_crypto_sign_ed25519ph_final_create","_crypto_sign_ed25519ph_final_verify","_crypto_sign_ed25519ph_init","_crypto_sign_ed25519ph_statebytes","_crypto_sign_ed25519ph_update","_crypto_sign_final_create","_crypto_sign_final_verify","_crypto_sign_init","_crypto_sign_keypair","_crypto_sign_messagebytes_max","_crypto_sign_open","_crypto_sign_primitive","_crypto_sign_publickeybytes","_crypto_sign_secretkeybytes","_crypto_sign_seed_keypair","_crypto_sign_seedbytes","_crypto_sign_statebytes","_crypto_sign_update","_crypto_sign_verify_detached","_crypto_stream","_crypto_stream_chacha20","_crypto_stream_chacha20_ietf","_crypto_stream_chacha20_ietf_keybytes","_crypto_stream_chacha20_ietf_keygen","_crypto_stream_chacha20_ietf_messagebytes_max","_crypto_stream_chacha20_ietf_noncebytes","_crypto_stream_chacha20_ietf_xor","_crypto_stream_chacha20_ietf_xor_ic","_crypto_stream_chacha20_keybytes","_crypto_stream_chacha20_keygen","_crypto_stream_chacha20_messagebytes_max","_crypto_stream_chacha20_noncebytes","_crypto_stream_chacha20_xor","_crypto_stream_chacha20_xor_ic","_crypto_stream_keybytes","_crypto_stream_keygen","_crypto_stream_messagebytes_max","_crypto_stream_noncebytes","_crypto_stream_primitive","_crypto_stream_salsa20","_crypto_stream_salsa2012","_crypto_stream_salsa2012_keybytes","_crypto_stream_salsa2012_keygen","_crypto_stream_salsa2012_messagebytes_max","_crypto_stream_salsa2012_noncebytes","_crypto_stream_salsa2012_xor","_crypto_stream_salsa208","_crypto_stream_salsa208_keybytes","_crypto_stream_salsa208_keygen","_crypto_stream_salsa208_messagebytes_max","_crypto_stream_salsa208_noncebytes","_crypto_stream_salsa208_xor","_crypto_stream_salsa20_keybytes","_crypto_stream_salsa20_keygen","_crypto_stream_salsa20_messagebytes_max","_crypto_stream_salsa20_noncebytes","_crypto_stream_salsa20_xor","_crypto_stream_salsa20_xor_ic","_crypto_stream_xchacha20","_crypto_stream_xchacha20_keybytes","_crypto_stream_xchacha20_keygen","_crypto_stream_xchacha20_messagebytes_max","_crypto_stream_xchacha20_noncebytes","_crypto_stream_xchacha20_xor","_crypto_stream_xchacha20_xor_ic","_crypto_stream_xor","_crypto_stream_xsalsa20","_crypto_stream_xsalsa20_keybytes","_crypto_stream_xsalsa20_keygen","_crypto_stream_xsalsa20_messagebytes_max","_crypto_stream_xsalsa20_noncebytes","_crypto_stream_xsalsa20_xor","_crypto_stream_xsalsa20_xor_ic","_crypto_verify_16","_crypto_verify_16_bytes","_crypto_verify_32","_crypto_verify_32_bytes","_crypto_verify_64","_crypto_verify_64_bytes","_randombytes","_randombytes_buf","_randombytes_buf_deterministic","_randombytes_close","_randombytes_implementation_name","_randombytes_random","_randombytes_seedbytes","_randombytes_stir","_randombytes_uniform","_sodium_base642bin","_sodium_base64_encoded_len","_sodium_bin2base64","_sodium_bin2hex","_sodium_hex2bin","_sodium_init","_sodium_library_minimal","_sodium_library_version_major","_sodium_library_version_minor","_sodium_pad","_sodium_unpad","_sodium_version_string"]'
+export EXPORTED_RUNTIME_METHODS='["UTF8ToString","getValue","setValue"]'
+export MAX_MEMORY=16777216
+export MAX_MEMORY_SUMO=16777216
+export MAX_MEMORY_TESTS=16777216
 export LDFLAGS="-s RESERVED_FUNCTION_POINTERS=8"
 export LDFLAGS="${LDFLAGS} -s ALLOW_MEMORY_GROWTH=1"
 export LDFLAGS="${LDFLAGS} -s SINGLE_FILE=1"
@@ -19,7 +19,7 @@ export CFLAGS="-Os"
 echo
 if [ "x$1" = "x--standard" ]; then
   export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_STANDARD"
-  export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY}"
+  export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${MAX_MEMORY}"
   export PREFIX="$(pwd)/libsodium-js"
   export DONE_FILE="$(pwd)/js.done"
   export CONFIG_EXTRA="--enable-minimal"
@@ -27,14 +27,14 @@ if [ "x$1" = "x--standard" ]; then
   echo "Building a standard distribution in [${PREFIX}]"
 elif [ "x$1" = "x--sumo" ]; then
   export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
-  export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${TOTAL_MEMORY_SUMO}"
+  export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${MAX_MEMORY_SUMO}"
   export PREFIX="$(pwd)/libsodium-js-sumo"
   export DONE_FILE="$(pwd)/js-sumo.done"
   export DIST='yes'
   echo "Building a sumo distribution in [${PREFIX}]"
 elif [ "x$1" = "x--browser-tests" ]; then
   export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
-  export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_TESTS}"
+  export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}"
   export PREFIX="$(pwd)/libsodium-js-tests"
   export DONE_FILE="$(pwd)/js-tests-browser.done"
   export BROWSER_TESTS='yes'
@@ -44,7 +44,7 @@ elif [ "x$1" = "x--tests" ]; then
   echo "Building for testing"
   export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
   export CPPFLAGS="${CPPFLAGS} -DBENCHMARKS -DITERATIONS=10"
-  export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_TESTS}"
+  export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}"
   export PREFIX="$(pwd)/libsodium-js-tests"
   export DONE_FILE="$(pwd)/js-tests.done"
   export DIST='no'
@@ -99,6 +99,12 @@ if [ "$DIST" = yes ]; then
     Module.ready = new Promise(function(resolve, reject) {
       var Module = _Module;
       Module.onAbort = reject;
+      Module.print = function(what) {
+        typeof(console) !== 'undefined' && console.log(what);
+      }
+      Module.printErr = function(what) {
+        typeof(console) !== 'undefined' && console.warn(what);
+      }
       Module.onRuntimeInitialized = function() {
         try {
           /* Test arbitrary wasm function */
diff --git a/dist-build/ios.sh b/dist-build/ios.sh
index 0575b09054f13eabbecfe7ed257873e7acce4dc6..2a2122abe088fb19214b0f6c5cdbbe62f9d0ff94 100755
--- a/dist-build/ios.sh
+++ b/dist-build/ios.sh
@@ -20,6 +20,12 @@ export XCODEDIR=$(xcode-select -p)
 export IOS_SIMULATOR_VERSION_MIN=${IOS_SIMULATOR_VERSION_MIN-"6.0.0"}
 export IOS_VERSION_MIN=${IOS_VERSION_MIN-"6.0.0"}
 
+echo
+echo "Warnings related to headers being present but not usable are due to functions"
+echo "that didn't exist in the specified minimum iOS version level."
+echo "They can be safely ignored."
+echo
+
 mkdir -p $SIMULATOR32_PREFIX $SIMULATOR64_PREFIX $IOS32_PREFIX $IOS32s_PREFIX $IOS64_PREFIX || exit 1
 
 # Build for the simulator
diff --git a/dist-build/nativeclient-pnacl.sh b/dist-build/nativeclient-pnacl.sh
deleted file mode 100755
index 020bb52c6c10056eddab2f79792e6de67699f8dd..0000000000000000000000000000000000000000
--- a/dist-build/nativeclient-pnacl.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-
-export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
-export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_pnacl"}
-export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
-export PREFIX="$(pwd)/libsodium-nativeclient"
-export PATH="${NACL_BIN}:$PATH"
-export AR=${AR-"pnacl-ar"}
-export AS=${AS-"pnacl-as"}
-export CC=${CC-"pnacl-clang"}
-export LD=${LD-"pnacl-ld"}
-export NM=${NM-"pnacl-nm"}
-export RANLIB=${RANLIB-"pnacl-ranlib"}
-export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"}
-export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"}
-export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
-
-mkdir -p $PREFIX || exit 1
-
-make distclean > /dev/null
-
-if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
-else
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
-fi
-
-./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
-            --host=nacl \
-            --disable-ssp --without-pthreads \
-            --prefix="$PREFIX" || exit 1
-
-
-NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
-PROCESSORS=${NPROCESSORS:-3}
-
-make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
diff --git a/dist-build/nativeclient-x86.sh b/dist-build/nativeclient-x86.sh
deleted file mode 100755
index 975add58ac270b901904a1dcda55c6e9ed6e4805..0000000000000000000000000000000000000000
--- a/dist-build/nativeclient-x86.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh
-
-export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
-export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_x86_glibc"}
-export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
-export PREFIX="$(pwd)/libsodium-nativeclient-x86"
-export PATH="${NACL_BIN}:$PATH"
-export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
-
-mkdir -p $PREFIX || exit 1
-
-make distclean > /dev/null
-
-if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
-else
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
-fi
-
-
-./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
-            --host=i686-nacl \
-            --disable-ssp --without-pthreads \
-            --prefix="$PREFIX" || exit 1
-
-NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
-PROCESSORS=${NPROCESSORS:-3}
-
-make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
diff --git a/dist-build/nativeclient-x86_64.sh b/dist-build/nativeclient-x86_64.sh
deleted file mode 100755
index 43a44c8e3b77e47e36175da0da4e6e1b5aed43ef..0000000000000000000000000000000000000000
--- a/dist-build/nativeclient-x86_64.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh
-
-export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
-export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_x86_glibc"}
-export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
-export PREFIX="$(pwd)/libsodium-nativeclient-x86_64"
-export PATH="${NACL_BIN}:$PATH"
-export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
-
-mkdir -p $PREFIX || exit 1
-
-make distclean > /dev/null
-
-if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
-else
-  export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
-fi
-
-./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
-            --host=x86_64-nacl \
-            --disable-ssp --without-pthreads \
-            --prefix="$PREFIX" || exit 1
-
-
-NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
-PROCESSORS=${NPROCESSORS:-3}
-
-make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
diff --git a/dist-build/wasm32-wasi.sh b/dist-build/wasm32-wasi.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0b28dff737c9cd4edb01076037b4866123fadc21
--- /dev/null
+++ b/dist-build/wasm32-wasi.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+if [ -z "$WASI_SYSROOT" ]; then
+  export WASI_SYSROOT="/opt/wasi-sysroot"
+fi
+
+export PATH="/usr/local/opt/llvm/bin:$PATH"
+
+export PREFIX="$(pwd)/libsodium-wasm32-wasi"
+
+mkdir -p $PREFIX || exit 1
+
+export CC="clang"
+export CFLAGS="-DED25519_NONDETERMINISTIC=1 --target=wasm32-wasi --sysroot=${WASI_SYSROOT} -O2"
+export LDFLAGS="-s -Wl,--no-threads"
+export NM="llvm-nm"
+export AR="llvm-ar"
+export RANLIB="llvm-ranlib"
+export STRIP="llvm-strip"
+
+make distclean > /dev/null
+
+grep -q -F -- 'wasi' build-aux/config.sub || \
+  sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub
+
+if [ "x$1" = "x--bench" ]; then
+  export BENCHMARKS=1
+  export CPPFLAGS="-DBENCHMARKS -DITERATIONS=100"
+fi
+
+if [ -n "$LIBSODIUM_MINIMAL_BUILD" ]; then
+  export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
+else
+  export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
+fi
+
+./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
+            --prefix="$PREFIX" --with-sysroot="$WASI_SYSROOT" \
+            --host=wasm32-wasi \
+            --disable-ssp --disable-shared || exit 1
+
+NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
+PROCESSORS=${NPROCESSORS:-3}
+
+if [ -z "$BENCHMARKS" ]; then
+  make -j${PROCESSORS} check && make install && make distclean > /dev/null
+else
+  make -j${PROCESSORS} && make check
+fi
diff --git a/libsodium-uninstalled.pc.in b/libsodium-uninstalled.pc.in
index 3d50230831ca8593752ac8f7b785cc26c6857e23..068a9c6bbd3c7c840e13fd68dc62b73769ad35b3 100644
--- a/libsodium-uninstalled.pc.in
+++ b/libsodium-uninstalled.pc.in
@@ -3,4 +3,5 @@ Version: @PACKAGE_VERSION@
 Description: A modern and easy-to-use crypto library
 
 Libs: -L${pcfiledir}/src/libsodium -lsodium
+Libs.private: @PKGCONFIG_LIBS_PRIVATE@
 Cflags: -I${pcfiledir}/src/libsodium/include -I@top_srcdir@/src/libsodium/include -I@top_srcdir@/src/libsodium/include/sodium
diff --git a/libsodium.pc.in b/libsodium.pc.in
index 19b3c1afc7727b0e1f24288ccd3fee684a906a46..6c2b43aa1c48c4fb8ba7b0d8f6cab115919ca779 100644
--- a/libsodium.pc.in
+++ b/libsodium.pc.in
@@ -8,4 +8,5 @@ Version: @PACKAGE_VERSION@
 Description: A modern and easy-to-use crypto library
 
 Libs: -L${libdir} -lsodium
+Libs.private: @PKGCONFIG_LIBS_PRIVATE@
 Cflags: -I${includedir}
diff --git a/libsodium.vcxproj b/libsodium.vcxproj
index 63d5f95609b216ff78149890a93d5a3eb13a72c5..e3b2072993c75bc730502dddfd400dda1ab97b24 100644
--- a/libsodium.vcxproj
+++ b/libsodium.vcxproj
@@ -364,6 +364,7 @@
     <ClCompile Include="src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphashx24_ref.c" />
     <ClCompile Include="src\libsodium\crypto_shorthash\siphash24\ref\shorthash_siphash24_ref.c" />
     <ClCompile Include="src\libsodium\crypto_scalarmult\crypto_scalarmult.c" />
+    <ClCompile Include="src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c" />
     <ClCompile Include="src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c" />
     <ClCompile Include="src\libsodium\crypto_scalarmult\curve25519\scalarmult_curve25519.c" />
     <ClCompile Include="src\libsodium\crypto_scalarmult\curve25519\sandy2x\curve25519_sandy2x.c" />
@@ -376,8 +377,7 @@
     <ClCompile Include="src\libsodium\crypto_onetimeauth\poly1305\sse2\poly1305_sse2.c" />
     <ClCompile Include="src\libsodium\randombytes\randombytes.c" />
     <ClCompile Include="src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c" />
-    <ClCompile Include="src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c" />
-    <ClCompile Include="src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c" />
+    <ClCompile Include="src\libsodium\randombytes\internal\randombytes_internal_random.c" />
     <ClCompile Include="src\libsodium\crypto_box\crypto_box_easy.c" />
     <ClCompile Include="src\libsodium\crypto_box\crypto_box_seal.c" />
     <ClCompile Include="src\libsodium\crypto_box\crypto_box.c" />
@@ -419,6 +419,7 @@
     <ClCompile Include="src\libsodium\crypto_core\hsalsa20\core_hsalsa20.c" />
     <ClCompile Include="src\libsodium\crypto_core\hsalsa20\ref2\core_hsalsa20_ref2.c" />
     <ClCompile Include="src\libsodium\crypto_core\ed25519\core_ed25519.c" />
+    <ClCompile Include="src\libsodium\crypto_core\ed25519\core_ristretto255.c" />
     <ClCompile Include="src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c" />
   </ItemGroup>
   <ItemGroup>
@@ -438,7 +439,6 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_hash_sha512.h" />
     <ClInclude Include="src\libsodium\include\sodium\core.h" />
     <ClInclude Include="src\libsodium\include\sodium\export.h" />
-    <ClInclude Include="src\libsodium\include\sodium\randombytes_salsa20_random.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_core_salsa20.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_shorthash_siphash24.h" />
     <ClInclude Include="src\libsodium\include\sodium\randombytes.h" />
@@ -448,6 +448,7 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_aead_xchacha20poly1305.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_stream_salsa20.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h" />
+    <ClInclude Include="src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_kx.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_hash.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_sign.h" />
@@ -455,6 +456,7 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_auth_hmacsha256.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_box.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_verify_32.h" />
+    <ClInclude Include="src\libsodium\include\sodium\crypto_core_ristretto255.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_stream_xchacha20.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_core_salsa208.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_auth_hmacsha512256.h" />
@@ -465,7 +467,6 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_aead_aes256gcm.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_core_salsa2012.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h" />
-    <ClInclude Include="src\libsodium\include\sodium\randombytes_nativeclient.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_scalarmult.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_pwhash.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_verify_16.h" />
@@ -484,6 +485,7 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_core_ed25519.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
+    <ClInclude Include="src\libsodium\include\sodium\randombytes_internal_random.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_generichash.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_secretbox_xsalsa20poly1305.h" />
     <ClInclude Include="src\libsodium\include\sodium\crypto_secretbox.h" />
diff --git a/libsodium.vcxproj.filters b/libsodium.vcxproj.filters
index b4a4ea96cb07c3219e1c1ed905077dd472c98d88..c8866164a50099c779485b7331c9201bcc23c36d 100644
--- a/libsodium.vcxproj.filters
+++ b/libsodium.vcxproj.filters
@@ -162,6 +162,9 @@
     <ClCompile Include="src\libsodium\crypto_scalarmult\crypto_scalarmult.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\libsodium\crypto_scalarmult\ristretto255\ref10\scalarmult_ristretto255_ref10.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\libsodium\crypto_scalarmult\ed25519\ref10\scalarmult_ed25519_ref10.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -198,10 +201,7 @@
     <ClCompile Include="src\libsodium\randombytes\sysrandom\randombytes_sysrandom.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="src\libsodium\randombytes\salsa20\randombytes_salsa20_random.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="src\libsodium\randombytes\nativeclient\randombytes_nativeclient.c">
+    <ClCompile Include="src\libsodium\randombytes\internal\randombytes_internal_random.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\libsodium\crypto_box\crypto_box_easy.c">
@@ -327,6 +327,9 @@
     <ClCompile Include="src\libsodium\crypto_core\ed25519\core_ed25519.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\libsodium\crypto_core\ed25519\core_ristretto255.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\libsodium\crypto_core\ed25519\ref10\ed25519_ref10.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -380,9 +383,6 @@
     <ClInclude Include="src\libsodium\include\sodium\export.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="src\libsodium\include\sodium\randombytes_salsa20_random.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="src\libsodium\include\sodium\crypto_core_salsa20.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -410,6 +410,9 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_onetimeauth_poly1305.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="src\libsodium\include\sodium\crypto_scalarmult_ristretto255.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="src\libsodium\include\sodium\crypto_kx.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -431,6 +434,9 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_verify_32.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="src\libsodium\include\sodium\crypto_core_ristretto255.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="src\libsodium\include\sodium\crypto_stream_xchacha20.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -461,9 +467,6 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_secretbox_xchacha20poly1305.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="src\libsodium\include\sodium\randombytes_nativeclient.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="src\libsodium\include\sodium\crypto_scalarmult.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -518,6 +521,9 @@
     <ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="src\libsodium\include\sodium\randombytes_internal_random.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="src\libsodium\include\sodium\crypto_generichash.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/logo.png b/logo.png
index 9c25cf7a64fface1f76471895c058181e300b370..e88c0f89c9643ef276dd00dc82bdc0671598555b 100644
Binary files a/logo.png and b/logo.png differ
diff --git a/msvc-scripts/process.bat b/msvc-scripts/process.bat
index fdaeaecf3ef47ea16da0ea68a91d68865d266c22..291679e4edc8b629d681f313230c1f5d2f77cdf7 100755
--- a/msvc-scripts/process.bat
+++ b/msvc-scripts/process.bat
@@ -1,5 +1,5 @@
-cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/1.0.17/ < src\libsodium\include\sodium\version.h.in > tmp
+cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/1.0.18/ < src\libsodium\include\sodium\version.h.in > tmp
 cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/10/ < tmp > tmp2
-cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/2/ < tmp2 > tmp3
+cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/3/ < tmp2 > tmp3
 cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_MINIMAL_DEF@// < tmp3 > src\libsodium\include\sodium\version.h
 del tmp tmp2 tmp3
diff --git a/packaging/dotnet-core/README.md b/packaging/dotnet-core/README.md
index 462ec29f0aa5acafa5682eb143634aa1310462f1..a9016b6b96783d6c6c9f09391a33e69e1562126e 100644
--- a/packaging/dotnet-core/README.md
+++ b/packaging/dotnet-core/README.md
@@ -31,15 +31,15 @@ Version numbers for the packages for .NET Core consist of three components:
   It may be necessary to release more than one package for a libsodium version,
   e.g., when adding support for a new platform or if a release contains a broken
   binary. In this case, a package revision number is added as a fourth part to
-  the libsodium version, starting at `1`. For example, `1.0.17` is the initial
-  release of the package for libsodium 1.0.17 and `1.0.17.5` is the fifth
+  the libsodium version, starting at `1`. For example, `1.0.18` is the initial
+  release of the package for libsodium 1.0.18 and `1.0.18.5` is the fifth
   revision (sixth release) of that package.
 * *pre-release label*  
   If a package is a pre-release, a label is appended to the version number in
   `-preview-##` format where `##` is the number of the pre-release, starting at
-  `01`. For example, `1.0.17-preview-01` is the first pre-release of the package
-  for libsodium 1.0.17 and `1.0.17.5-preview-02` the second pre-release of the
-  fifth revision of the package for libsodium 1.0.17.
+  `01`. For example, `1.0.18-preview-01` is the first pre-release of the package
+  for libsodium 1.0.18 and `1.0.18.5-preview-02` the second pre-release of the
+  fifth revision of the package for libsodium 1.0.18.
 
 
 **Making a release**
diff --git a/packaging/dotnet-core/prepare.py b/packaging/dotnet-core/prepare.py
index 29710d759293f4384df5f95c7ed5c0eaa7bbfcaf..7a4883f5d04d038db4e09647117ac59d9466d470 100755
--- a/packaging/dotnet-core/prepare.py
+++ b/packaging/dotnet-core/prepare.py
@@ -5,240 +5,298 @@ import re
 import sys
 
 WINDOWS = [
-  # --------------------- ----------------- #
-  # Runtime ID            Platform          #
-  # --------------------- ----------------- #
-  ( 'win-x64',            'x64'             ),
-  ( 'win-x86',            'Win32'           ),
-  # --------------------- ----------------- #
+    # --------------------- ----------------- #
+    # Runtime ID            Platform          #
+    # --------------------- ----------------- #
+    ("win-x64", "x64"),
+    ("win-x86", "Win32"),
+    # --------------------- ----------------- #
 ]
 
 MACOS = [
-  # --------------------- ----------------- #
-  # Runtime ID            Codename          #
-  # --------------------- ----------------- #
-  ( 'osx-x64',            'sierra'          ),
-  # --------------------- ----------------- #
+    # --------------------- ----------------- #
+    # Runtime ID            Codename          #
+    # --------------------- ----------------- #
+    ("osx-x64", "mojave"),
+    # --------------------- ----------------- #
 ]
 
 LINUX = [
-  # --------------------- ----------------- #
-  # Runtime ID            Docker Image      #
-  # --------------------- ----------------- #
-  ( 'linux-x64',          'debian:stretch'  ),
-  # --------------------- ----------------- #
+    # --------------------- ----------------- #
+    # Runtime ID            Docker Image      #
+    # --------------------- ----------------- #
+    ("linux-x64", "debian:stretch"),
+    # --------------------- ----------------- #
 ]
 
-EXTRAS = [ 'LICENSE', 'AUTHORS', 'ChangeLog' ]
+EXTRAS = ["LICENSE", "AUTHORS", "ChangeLog"]
 
-PROPSFILE = 'libsodium.props'
-MAKEFILE = 'Makefile'
-BUILDDIR = 'build'
-CACHEDIR = 'cache'
-TEMPDIR = 'temp'
+PROPSFILE = "libsodium.props"
+MAKEFILE = "Makefile"
+BUILDDIR = "build"
+CACHEDIR = "cache"
+TEMPDIR = "temp"
 
-PACKAGE = 'libsodium'
-LIBRARY = 'libsodium'
+PACKAGE = "libsodium"
+LIBRARY = "libsodium"
+
+DOCKER = "sudo docker"
 
-DOCKER = 'sudo docker'
 
 class Version:
+    def __init__(self, libsodium_version, package_version):
+        self.libsodium_version = libsodium_version
+        self.package_version = package_version
 
-  def __init__(self, libsodium_version, package_version):
-    self.libsodium_version = libsodium_version
-    self.package_version = package_version
+        self.builddir = os.path.join(BUILDDIR, libsodium_version)
+        self.tempdir = os.path.join(TEMPDIR, libsodium_version)
+        self.projfile = os.path.join(
+            self.builddir, "{0}.{1}.pkgproj".format(PACKAGE, package_version)
+        )
+        self.propsfile = os.path.join(self.builddir, "{0}.props".format(PACKAGE))
+        self.pkgfile = os.path.join(
+            BUILDDIR, "{0}.{1}.nupkg".format(PACKAGE, package_version)
+        )
 
-    self.builddir = os.path.join(BUILDDIR, libsodium_version)
-    self.tempdir = os.path.join(TEMPDIR, libsodium_version)
-    self.projfile = os.path.join(self.builddir, '{0}.{1}.pkgproj'.format(PACKAGE, package_version))
-    self.propsfile = os.path.join(self.builddir, '{0}.props'.format(PACKAGE))
-    self.pkgfile = os.path.join(BUILDDIR, '{0}.{1}.nupkg'.format(PACKAGE, package_version))
 
 class WindowsItem:
+    def __init__(self, version, rid, platform):
+        self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}-stable-msvc.zip".format(
+            version.libsodium_version
+        )
+        self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
+        self.packfile = os.path.join(
+            version.builddir, "runtimes", rid, "native", LIBRARY + ".dll"
+        )
+        self.itemfile = "{0}/Release/v140/dynamic/libsodium.dll".format(platform)
+        self.tempdir = os.path.join(version.tempdir, rid)
+        self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
+
+    def make(self, f):
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write("\tcp -f $< $@\n")
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\tcd {0} && unzip -q -DD -o {1} '{2}'\n".format(
+                self.tempdir,
+                os.path.relpath(self.cachefile, self.tempdir),
+                self.itemfile,
+            )
+        )
 
-  def __init__(self, version, rid, platform):
-    self.url = 'https://download.libsodium.org/libsodium/releases/libsodium-{0}-msvc.zip'.format(version.libsodium_version)
-    self.cachefile = os.path.join(CACHEDIR, re.sub(r'[^A-Za-z0-9.]', '-', self.url))
-    self.packfile = os.path.join(version.builddir, 'runtimes', rid, 'native', LIBRARY + '.dll')
-    self.itemfile = '{0}/Release/v140/dynamic/libsodium.dll'.format(platform)
-    self.tempdir = os.path.join(version.tempdir, rid)
-    self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
-
-  def make(self, f):
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.packfile, self.tempfile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcp -f $< $@\n')
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.tempfile, self.cachefile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcd {0} && unzip -q -DD -o {1} \'{2}\'\n'.format(
-      self.tempdir,
-      os.path.relpath(self.cachefile, self.tempdir),
-      self.itemfile
-    ))
 
 class MacOSItem:
+    def __init__(self, version, rid, codename):
+        self.url = "https://bintray.com/homebrew/bottles/download_file?file_path=libsodium-{0}.{1}.bottle.tar.gz".format(
+            version.libsodium_version, codename
+        )
+        self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
+        self.packfile = os.path.join(
+            version.builddir, "runtimes", rid, "native", LIBRARY + ".dylib"
+        )
+        self.itemfile = "libsodium/{0}/lib/libsodium.dylib".format(
+            version.libsodium_version
+        )
+        self.tempdir = os.path.join(version.tempdir, rid)
+        self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
+
+    def make(self, f):
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write("\tcp -f $< $@\n")
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\tcd {0} && tar xzmf {1} '{2}'\n".format(
+                self.tempdir,
+                os.path.relpath(self.cachefile, self.tempdir),
+                os.path.dirname(self.itemfile),
+            )
+        )
 
-  def __init__(self, version, rid, codename):
-    self.url = 'https://bintray.com/homebrew/bottles/download_file?file_path=libsodium-{0}.{1}.bottle.tar.gz'.format(version.libsodium_version, codename)
-    self.cachefile = os.path.join(CACHEDIR, re.sub(r'[^A-Za-z0-9.]', '-', self.url))
-    self.packfile = os.path.join(version.builddir, 'runtimes', rid, 'native', LIBRARY + '.dylib')
-    self.itemfile = 'libsodium/{0}/lib/libsodium.dylib'.format(version.libsodium_version)
-    self.tempdir = os.path.join(version.tempdir, rid)
-    self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
-
-  def make(self, f):
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.packfile, self.tempfile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcp -f $< $@\n')
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.tempfile, self.cachefile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcd {0} && tar xzmf {1} \'{2}\'\n'.format(
-      self.tempdir,
-      os.path.relpath(self.cachefile, self.tempdir),
-      os.path.dirname(self.itemfile)
-    ))
 
 class LinuxItem:
+    def __init__(self, version, rid, docker_image):
+        self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz".format(
+            version.libsodium_version
+        )
+        self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
+        self.packfile = os.path.join(
+            version.builddir, "runtimes", rid, "native", LIBRARY + ".so"
+        )
+        self.tempdir = os.path.join(version.tempdir, rid)
+        self.tempfile = os.path.join(self.tempdir, "libsodium.so")
+        self.docker_image = docker_image
+        self.recipe = rid
+
+    def make(self, f):
+        recipe = self.recipe
+        while not os.path.exists(os.path.join("recipes", recipe)):
+            m = re.fullmatch(r"([^.-]+)((([.][^.-]+)*)[.][^.-]+)?([-].*)?", recipe)
+            if m.group(5) is None:
+                recipe = "build"
+                break
+            elif m.group(2) is None:
+                recipe = m.group(1)
+            else:
+                recipe = m.group(1) + m.group(3) + m.group(5)
+
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write("\tcp -f $< $@\n")
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\t{0} run --rm ".format(DOCKER)
+            + "-v $(abspath recipes):/io/recipes "
+            + "-v $(abspath $<):/io/libsodium.tar.gz "
+            + "-v $(abspath $(dir $@)):/io/output "
+            + "{0} sh -x -e /io/recipes/{1}\n".format(self.docker_image, recipe)
+        )
 
-  def __init__(self, version, rid, docker_image):
-    self.url = 'https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz'.format(version.libsodium_version)
-    self.cachefile = os.path.join(CACHEDIR, re.sub(r'[^A-Za-z0-9.]', '-', self.url))
-    self.packfile = os.path.join(version.builddir, 'runtimes', rid, 'native', LIBRARY + '.so')
-    self.tempdir = os.path.join(version.tempdir, rid)
-    self.tempfile = os.path.join(self.tempdir, 'libsodium.so')
-    self.docker_image = docker_image
-    self.recipe = rid
-
-  def make(self, f):
-    recipe = self.recipe
-    while not os.path.exists(os.path.join('recipes', recipe)):
-      m = re.fullmatch(r'([^.-]+)((([.][^.-]+)*)[.][^.-]+)?([-].*)?', recipe)
-      if m.group(5) is None:
-        recipe = 'build'
-        break
-      elif m.group(2) is None:
-        recipe = m.group(1)
-      else:
-        recipe = m.group(1) + m.group(3) + m.group(5)
-
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.packfile, self.tempfile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcp -f $< $@\n')
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.tempfile, self.cachefile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\t{0} run --rm '.format(DOCKER) +
-            '-v $(abspath recipes):/io/recipes ' +
-            '-v $(abspath $<):/io/libsodium.tar.gz ' +
-            '-v $(abspath $(dir $@)):/io/output ' +
-            '{0} sh -x -e /io/recipes/{1}\n'.format(self.docker_image, recipe))
 
 class ExtraItem:
+    def __init__(self, version, filename):
+        self.url = "https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz".format(
+            version.libsodium_version
+        )
+        self.cachefile = os.path.join(CACHEDIR, re.sub(r"[^A-Za-z0-9.]", "-", self.url))
+        self.packfile = os.path.join(version.builddir, filename)
+        self.itemfile = "libsodium-{0}/{1}".format(version.libsodium_version, filename)
+        self.tempdir = os.path.join(version.tempdir, "extras")
+        self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
+
+    def make(self, f):
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.packfile, self.tempfile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write("\tcp -f $< $@\n")
+        f.write("\n")
+        f.write("{0}: {1}\n".format(self.tempfile, self.cachefile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\tcd {0} && tar xzmf {1} '{2}'\n".format(
+                self.tempdir,
+                os.path.relpath(self.cachefile, self.tempdir),
+                self.itemfile,
+            )
+        )
 
-  def __init__(self, version, filename):
-    self.url = 'https://download.libsodium.org/libsodium/releases/libsodium-{0}.tar.gz'.format(version.libsodium_version)
-    self.cachefile = os.path.join(CACHEDIR, re.sub(r'[^A-Za-z0-9.]', '-', self.url))
-    self.packfile = os.path.join(version.builddir, filename)
-    self.itemfile = 'libsodium-{0}/{1}'.format(version.libsodium_version, filename)
-    self.tempdir = os.path.join(version.tempdir, 'extras')
-    self.tempfile = os.path.join(self.tempdir, os.path.normpath(self.itemfile))
-
-  def make(self, f):
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.packfile, self.tempfile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcp -f $< $@\n')
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(self.tempfile, self.cachefile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcd {0} && tar xzmf {1} \'{2}\'\n'.format(
-      self.tempdir,
-      os.path.relpath(self.cachefile, self.tempdir),
-      self.itemfile
-    ))
 
 def main(args):
-  m = re.fullmatch(r'((\d+\.\d+\.\d+)(\.\d+)?)(?:-(\w+(?:[_.-]\w+)*))?', args[1]) if len(args) == 2 else None
-
-  if m is None:
-    print('Usage:')
-    print('       python3 prepare.py <version>')
-    print()
-    print('Examples:')
-    print('       python3 prepare.py 1.0.17-preview-01')
-    print('       python3 prepare.py 1.0.17-preview-02')
-    print('       python3 prepare.py 1.0.17-preview-03')
-    print('       python3 prepare.py 1.0.17')
-    print('       python3 prepare.py 1.0.17.1-preview-01')
-    print('       python3 prepare.py 1.0.17.1')
-    print('       python3 prepare.py 1.0.17.2')
-    return 1
-
-  version = Version(m.group(2), m.group(0))
-
-  items = [ WindowsItem(version, rid, platform)   for (rid, platform) in WINDOWS   ] + \
-          [ MacOSItem(version, rid, codename)     for (rid, codename) in MACOS     ] + \
-          [ LinuxItem(version, rid, docker_image) for (rid, docker_image) in LINUX ] + \
-          [ ExtraItem(version, filename)          for filename in EXTRAS           ]
-
-  downloads = {item.cachefile: item.url for item in items}
-
-  with open(MAKEFILE, 'w') as f:
-    f.write('all: {0}\n'.format(version.pkgfile))
-
-    for download in sorted(downloads):
-      f.write('\n')
-      f.write('{0}:\n'.format(download))
-      f.write('\t@mkdir -p $(dir $@)\n')
-      f.write('\tcurl -f#Lo $@ \'{0}\'\n'.format(downloads[download]))
-
-    for item in items:
-      item.make(f)
-
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(version.propsfile, PROPSFILE))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\tcp -f $< $@\n')
-
-    f.write('\n')
-    f.write('{0}: {1}\n'.format(version.projfile, version.propsfile))
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\techo \'' +
-            '<Project Sdk="Microsoft.NET.Sdk">' +
-            '<Import Project="{0}" />'.format(os.path.relpath(version.propsfile, os.path.dirname(version.projfile))) +
-            '<PropertyGroup>' +
-            '<Version>{0}</Version>'.format(version.package_version) +
-            '</PropertyGroup>' +
-            '</Project>\' > $@\n')
-
-    f.write('\n')
-    f.write('{0}:'.format(version.pkgfile))
-    f.write(' \\\n\t\t{0}'.format(version.projfile))
-    f.write(' \\\n\t\t{0}'.format(version.propsfile))
-    for item in items:
-      f.write(' \\\n\t\t{0}'.format(item.packfile))
-    f.write('\n')
-    f.write('\t@mkdir -p $(dir $@)\n')
-    f.write('\t{0} run --rm '.format(DOCKER) +
-            '-v $(abspath recipes):/io/recipes ' +
-            '-v $(abspath $(dir $<)):/io/input ' +
-            '-v $(abspath $(dir $@)):/io/output ' +
-            '{0} sh -x -e /io/recipes/{1} {2}\n'.format('microsoft/dotnet:2.0-sdk', 'pack', os.path.relpath(version.projfile, version.builddir)))
-
-    f.write('\n')
-    f.write('test: {0}\n'.format(version.pkgfile))
-    f.write('\t{0} run --rm '.format(DOCKER) +
-            '-v $(abspath recipes):/io/recipes ' +
-            '-v $(abspath $(dir $<)):/io/packages ' +
-            '{0} sh -x -e /io/recipes/{1} "{2}"\n'.format('microsoft/dotnet:2.0-sdk', 'test', version.package_version))
-
-  print('prepared', MAKEFILE, 'to make', version.pkgfile, 'for libsodium', version.libsodium_version)
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
+    m = (
+        re.fullmatch(r"((\d+\.\d+\.\d+)(\.\d+)?)(?:-(\w+(?:[_.-]\w+)*))?", args[1])
+        if len(args) == 2
+        else None
+    )
+
+    if m is None:
+        print("Usage:")
+        print("       python3 prepare.py <version>")
+        print()
+        print("Examples:")
+        print("       python3 prepare.py 1.0.18-preview-01")
+        print("       python3 prepare.py 1.0.18-preview-02")
+        print("       python3 prepare.py 1.0.18-preview-03")
+        print("       python3 prepare.py 1.0.18")
+        print("       python3 prepare.py 1.0.18.1-preview-01")
+        print("       python3 prepare.py 1.0.18.1")
+        print("       python3 prepare.py 1.0.18.2")
+        return 1
+
+    version = Version(m.group(2), m.group(0))
+
+    items = (
+        [WindowsItem(version, rid, platform) for (rid, platform) in WINDOWS]
+        + [MacOSItem(version, rid, codename) for (rid, codename) in MACOS]
+        + [LinuxItem(version, rid, docker_image) for (rid, docker_image) in LINUX]
+        + [ExtraItem(version, filename) for filename in EXTRAS]
+    )
+
+    downloads = {item.cachefile: item.url for item in items}
+
+    with open(MAKEFILE, "w") as f:
+        f.write("all: {0}\n".format(version.pkgfile))
+
+        for download in sorted(downloads):
+            f.write("\n")
+            f.write("{0}:\n".format(download))
+            f.write("\t@mkdir -p $(dir $@)\n")
+            f.write("\tcurl -f#Lo $@ '{0}'\n".format(downloads[download]))
+
+        for item in items:
+            item.make(f)
+
+        f.write("\n")
+        f.write("{0}: {1}\n".format(version.propsfile, PROPSFILE))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write("\tcp -f $< $@\n")
+
+        f.write("\n")
+        f.write("{0}: {1}\n".format(version.projfile, version.propsfile))
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\techo '"
+            + '<Project Sdk="Microsoft.NET.Sdk">'
+            + '<Import Project="{0}" />'.format(
+                os.path.relpath(version.propsfile, os.path.dirname(version.projfile))
+            )
+            + "<PropertyGroup>"
+            + "<Version>{0}</Version>".format(version.package_version)
+            + "</PropertyGroup>"
+            + "</Project>' > $@\n"
+        )
+
+        f.write("\n")
+        f.write("{0}:".format(version.pkgfile))
+        f.write(" \\\n\t\t{0}".format(version.projfile))
+        f.write(" \\\n\t\t{0}".format(version.propsfile))
+        for item in items:
+            f.write(" \\\n\t\t{0}".format(item.packfile))
+        f.write("\n")
+        f.write("\t@mkdir -p $(dir $@)\n")
+        f.write(
+            "\t{0} run --rm ".format(DOCKER)
+            + "-v $(abspath recipes):/io/recipes "
+            + "-v $(abspath $(dir $<)):/io/input "
+            + "-v $(abspath $(dir $@)):/io/output "
+            + "{0} sh -x -e /io/recipes/{1} {2}\n".format(
+                "microsoft/dotnet:2.0-sdk",
+                "pack",
+                os.path.relpath(version.projfile, version.builddir),
+            )
+        )
+
+        f.write("\n")
+        f.write("test: {0}\n".format(version.pkgfile))
+        f.write(
+            "\t{0} run --rm ".format(DOCKER)
+            + "-v $(abspath recipes):/io/recipes "
+            + "-v $(abspath $(dir $<)):/io/packages "
+            + '{0} sh -x -e /io/recipes/{1} "{2}"\n'.format(
+                "microsoft/dotnet:2.0-sdk", "test", version.package_version
+            )
+        )
+
+    print(
+        "prepared",
+        MAKEFILE,
+        "to make",
+        version.pkgfile,
+        "for libsodium",
+        version.libsodium_version,
+    )
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(main(sys.argv))
+
diff --git a/packaging/nuget/package.config b/packaging/nuget/package.config
index 3e678873301c188bae44c8ee8302d0e28e598f8a..33eda2ddb57cffe900377e05843407e619f4d4b3 100644
--- a/packaging/nuget/package.config
+++ b/packaging/nuget/package.config
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- These values are populated into the package.gsl templates by package.bat. -->
 <!-- The target attribute controls path and file name only, id controls package naming. -->
-<package id="libsodium_vc120" target="libsodium" version = "1.0.17.0" pathversion="1_0_17_0" platformtoolset="v120" />
+<package id="libsodium_vc120" target="libsodium" version = "1.0.18.0" pathversion="1_0_18_0" platformtoolset="v120" />
diff --git a/regen-msvc/regen-msvc.py b/regen-msvc/regen-msvc.py
index d32fbe04c424921dc5511a67bc05640c38417d4b..9a2c87aace5ebbf70df957f1a2d15ad12a445f81 100755
--- a/regen-msvc/regen-msvc.py
+++ b/regen-msvc/regen-msvc.py
@@ -9,49 +9,47 @@ dirs = set()
 tlv1 = ""
 for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
     file = file.replace("/", "\\")
-    tlv1 = tlv1 + "    <ClCompile Include=\"{}\" />\r\n".format(file)
+    tlv1 = tlv1 + '    <ClCompile Include="{}" />\r\n'.format(file)
 
 tlv2 = ""
 for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
     file = file.replace("/", "\\")
-    tlv2 = tlv2 + "    <ClInclude Include=\"{}\" />\r\n".format(file)
+    tlv2 = tlv2 + '    <ClInclude Include="{}" />\r\n'.format(file)
 
 tlf1 = ""
 for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
     file = file.replace("/", "\\")
-    tlf1 = tlf1 + "    <ClCompile Include=\"{}\">\r\n".format(file)
+    tlf1 = tlf1 + '    <ClCompile Include="{}">\r\n'.format(file)
     tlf1 = tlf1 + "      <Filter>Source Files</Filter>\r\n"
     tlf1 = tlf1 + "    </ClCompile>\r\n"
 
 tlf2 = ""
 for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
     file = file.replace("/", "\\")
-    tlf2 = tlf2 + "    <ClInclude Include=\"{}\">\r\n".format(file)
+    tlf2 = tlf2 + '    <ClInclude Include="{}">\r\n'.format(file)
     tlf2 = tlf2 + "      <Filter>Header Files</Filter>\r\n"
     tlf2 = tlf2 + "    </ClInclude>\r\n"
 
 v1 = ""
 for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
     file = file.replace("/", "\\")
-    v1 = v1 + \
-        "    <ClCompile Include=\"..\\..\\..\\..\\{}\" />\r\n".format(file)
+    v1 = v1 + '    <ClCompile Include="..\\..\\..\\..\\{}" />\r\n'.format(file)
 
 v2 = ""
 for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
     file = file.replace("/", "\\")
-    v2 = v2 + \
-        "    <ClInclude Include=\"..\\..\\..\\..\\{}\" />\r\n".format(file)
+    v2 = v2 + '    <ClInclude Include="..\\..\\..\\..\\{}" />\r\n'.format(file)
 
 f1 = ""
 for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
     basedir = os.path.dirname(file).replace("src/libsodium/", "")
     t = basedir
-    while t != '':
+    while t != "":
         dirs.add(t)
         t = os.path.dirname(t)
     basedir = basedir.replace("/", "\\")
     file = file.replace("/", "\\")
-    f1 = f1 + "    <ClCompile Include=\"..\\..\\..\\..\\{}\">\r\n".format(file)
+    f1 = f1 + '    <ClCompile Include="..\\..\\..\\..\\{}">\r\n'.format(file)
     f1 = f1 + "      <Filter>{}</Filter>\r\n".format(basedir)
     f1 = f1 + "    </ClCompile>\r\n"
 
@@ -59,12 +57,12 @@ f2 = ""
 for file in glob.iglob("src/libsodium/**/*.h", recursive=True):
     basedir = os.path.dirname(file).replace("src/libsodium/", "")
     t = basedir
-    while t != '':
+    while t != "":
         dirs.add(t)
         t = os.path.dirname(t)
     basedir = basedir.replace("/", "\\")
     file = file.replace("/", "\\")
-    f2 = f2 + "    <ClInclude Include=\"..\\..\\..\\..\\{}\">\r\n".format(file)
+    f2 = f2 + '    <ClInclude Include="..\\..\\..\\..\\{}">\r\n'.format(file)
     f2 = f2 + "      <Filter>{}</Filter>\r\n".format(basedir)
     f2 = f2 + "    </ClInclude>\r\n"
 
@@ -73,63 +71,115 @@ dirs = list(dirs)
 dirs.sort()
 for dir in dirs:
     dir = dir.replace("/", "\\")
-    uid = uuid.uuid3(uuid.UUID(bytes=b'LibSodiumMSVCUID'), dir)
-    fd = fd + "    <Filter Include=\"{}\">\r\n".format(dir)
-    fd = fd + \
-        "      <UniqueIdentifier>{{{}}}</UniqueIdentifier>\r\n".format(uid)
+    uid = uuid.uuid3(uuid.UUID(bytes=b"LibSodiumMSVCUID"), dir)
+    fd = fd + '    <Filter Include="{}">\r\n'.format(dir)
+    fd = fd + "      <UniqueIdentifier>{{{}}}</UniqueIdentifier>\r\n".format(uid)
     fd = fd + "    </Filter>\r\n"
 
 
 def apply_template(tplfile, outfile, sbox):
     tpl = ""
-    with open(tplfile, 'rb') as fd:
+    with open(tplfile, "rb") as fd:
         tpl = fd.read()
     for s in sbox.keys():
-        tpl = tpl.replace(str.encode(
-            "{{" + s + "}}", "utf8"), str.encode(str.strip(sbox[s]), "utf8"))
+        tpl = tpl.replace(
+            str.encode("{{" + s + "}}", "utf8"), str.encode(str.strip(sbox[s]), "utf8")
+        )
 
-    with open(outfile, 'wb') as fd:
+    with open(outfile, "wb") as fd:
         fd.write(tpl)
 
-sbox = {"tlv1": tlv1, "tlv2": tlv2, "tlf1": tlf1, "tlf2": tlf2, "v1": v1,
-        "v2": v2, "f1": f1, "f2": f2, "fd": fd}
+
+sbox = {
+    "tlv1": tlv1,
+    "tlv2": tlv2,
+    "tlf1": tlf1,
+    "tlf2": tlf2,
+    "v1": v1,
+    "v2": v2,
+    "f1": f1,
+    "f2": f2,
+    "fd": fd,
+}
 
 sd = os.path.dirname(os.path.realpath(__file__))
 
-apply_template(sd + "/tl_libsodium.vcxproj.filters.tpl",
-               "libsodium.vcxproj.filters", sbox)
+apply_template(
+    sd + "/tl_libsodium.vcxproj.filters.tpl", "libsodium.vcxproj.filters", sbox
+)
 
 sbox.update({"platform": "v140"})
-apply_template(sd + "/tl_libsodium.vcxproj.tpl",
-               "libsodium.vcxproj", sbox)
-
-apply_template(sd + "/libsodium.vcxproj.filters.tpl",
-               "builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters", sbox)
-apply_template(sd + "/libsodium.vcxproj.filters.tpl",
-               "builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters", sbox)
-apply_template(sd + "/libsodium.vcxproj.filters.tpl",
-               "builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters", sbox)
-apply_template(sd + "/libsodium.vcxproj.filters.tpl",
-               "builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters", sbox)
-apply_template(sd + "/libsodium.vcxproj.filters.tpl",
-               "builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters", sbox)
+apply_template(sd + "/tl_libsodium.vcxproj.tpl", "libsodium.vcxproj", sbox)
+
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+apply_template(
+    sd + "/libsodium.vcxproj.filters.tpl",
+    "builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters",
+    sbox,
+)
+
+sbox.update({"platform": "v142"})
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2019/libsodium/libsodium.vcxproj",
+    sbox,
+)
 
 sbox.update({"platform": "v141"})
-apply_template(sd + "/libsodium.vcxproj.tpl",
-               "builds/msvc/vs2017/libsodium/libsodium.vcxproj", sbox)
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2017/libsodium/libsodium.vcxproj",
+    sbox,
+)
 
 sbox.update({"platform": "v140"})
-apply_template(sd + "/libsodium.vcxproj.tpl",
-               "builds/msvc/vs2015/libsodium/libsodium.vcxproj", sbox)
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2015/libsodium/libsodium.vcxproj",
+    sbox,
+)
 
 sbox.update({"platform": "v120"})
-apply_template(sd + "/libsodium.vcxproj.tpl",
-               "builds/msvc/vs2013/libsodium/libsodium.vcxproj", sbox)
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2013/libsodium/libsodium.vcxproj",
+    sbox,
+)
 
 sbox.update({"platform": "v110"})
-apply_template(sd + "/libsodium.vcxproj.tpl",
-               "builds/msvc/vs2012/libsodium/libsodium.vcxproj", sbox)
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2012/libsodium/libsodium.vcxproj",
+    sbox,
+)
 
 sbox.update({"platform": "v100"})
-apply_template(sd + "/libsodium.vcxproj.tpl",
-               "builds/msvc/vs2010/libsodium/libsodium.vcxproj", sbox)
+apply_template(
+    sd + "/libsodium.vcxproj.tpl",
+    "builds/msvc/vs2010/libsodium/libsodium.vcxproj",
+    sbox,
+)
diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am
index 2c3d210f9ee7297cd1664312c3ac03df839c55e9..cf4cfc93931b1145b193ad0e174dd6425f4ed1ad 100644
--- a/src/libsodium/Makefile.am
+++ b/src/libsodium/Makefile.am
@@ -152,6 +152,7 @@ libsodium_la_SOURCES += \
 	crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c \
 	crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c \
 	crypto_core/ed25519/core_ed25519.c \
+	crypto_core/ed25519/core_ristretto255.c \
 	crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c \
 	crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h \
 	crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c \
@@ -160,6 +161,7 @@ libsodium_la_SOURCES += \
 	crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c \
 	crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c \
 	crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c \
+	crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c \
 	crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c \
 	crypto_shorthash/siphash24/shorthash_siphashx24.c \
 	crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c \
@@ -171,7 +173,7 @@ libsodium_la_SOURCES += \
 	crypto_stream/xchacha20/stream_xchacha20.c
 endif
 
-randombytes_salsa20_randombytes_salsa20_random_CFLAGS = @CFLAGS_RDRAND@
+randombytes_internal_randombytes_internal_random_CFLAGS = @CFLAGS_RDRAND@
 
 libsodium_la_LDFLAGS = \
 	$(AM_LDFLAGS) \
@@ -202,22 +204,16 @@ librdrand_la_LDFLAGS = $(libsodium_la_LDFLAGS)
 librdrand_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \
 	@CFLAGS_RDRAND@
 librdrand_la_SOURCES = \
-	randombytes/salsa20/randombytes_salsa20_random.c
+	randombytes/internal/randombytes_internal_random.c
 
 if !EMSCRIPTEN
 libsodium_la_LIBADD += librdrand.la
 noinst_LTLIBRARIES  += librdrand.la
 
-if NATIVECLIENT
-libsodium_la_SOURCES += \
-	randombytes/nativeclient/randombytes_nativeclient.c
-else
 libsodium_la_SOURCES += \
 	randombytes/sysrandom/randombytes_sysrandom.c
 endif
 
-endif
-
 libaesni_la_LDFLAGS = $(libsodium_la_LDFLAGS)
 libaesni_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \
 	@CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@
diff --git a/src/libsodium/crypto_core/ed25519/core_ed25519.c b/src/libsodium/crypto_core/ed25519/core_ed25519.c
index 15c004b9ac0207ae6f0222a96d736b0cbdd8b489..0029a093f880a00dc65d3135b2c973cab712bc11 100644
--- a/src/libsodium/crypto_core/ed25519/core_ed25519.c
+++ b/src/libsodium/crypto_core/ed25519/core_ed25519.c
@@ -67,7 +67,24 @@ crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
 {
     ge25519_from_uniform(p, r);
 
-    return - ge25519_has_small_order(p);
+    return 0;
+}
+
+int
+crypto_core_ed25519_from_hash(unsigned char *p, const unsigned char *h)
+{
+    ge25519_from_hash(p, h);
+
+    return 0;
+}
+
+void
+crypto_core_ed25519_random(unsigned char *p)
+{
+    unsigned char h[crypto_core_ed25519_HASHBYTES];
+
+    randombytes_buf(h, sizeof h);
+    (void) crypto_core_ed25519_from_hash(p, h);
 }
 
 void
@@ -158,6 +175,13 @@ crypto_core_ed25519_scalar_sub(unsigned char *z, const unsigned char *x,
     crypto_core_ed25519_scalar_add(z, x, yn);
 }
 
+void
+crypto_core_ed25519_scalar_mul(unsigned char *z, const unsigned char *x,
+                               const unsigned char *y)
+{
+    sc25519_mul(z, x, y);
+}
+
 void
 crypto_core_ed25519_scalar_reduce(unsigned char *r,
                                   const unsigned char *s)
@@ -188,6 +212,12 @@ crypto_core_ed25519_uniformbytes(void)
     return crypto_core_ed25519_UNIFORMBYTES;
 }
 
+size_t
+crypto_core_ed25519_hashbytes(void)
+{
+    return crypto_core_ed25519_HASHBYTES;
+}
+
 size_t
 crypto_core_ed25519_scalarbytes(void)
 {
diff --git a/src/libsodium/crypto_core/ed25519/core_ristretto255.c b/src/libsodium/crypto_core/ed25519/core_ristretto255.c
new file mode 100644
index 0000000000000000000000000000000000000000..cad3c8027d2cbffa2a764b870e333165ec4dae2a
--- /dev/null
+++ b/src/libsodium/crypto_core/ed25519/core_ristretto255.c
@@ -0,0 +1,156 @@
+
+#include <stdint.h>
+
+#include "crypto_core_ed25519.h"
+#include "crypto_core_ristretto255.h"
+#include "private/common.h"
+#include "private/ed25519_ref10.h"
+#include "randombytes.h"
+#include "utils.h"
+
+int
+crypto_core_ristretto255_is_valid_point(const unsigned char *p)
+{
+    ge25519_p3 p_p3;
+
+    if (ristretto255_frombytes(&p_p3, p) != 0) {
+        return 0;
+    }
+    return 1;
+}
+
+int
+crypto_core_ristretto255_add(unsigned char *r,
+                             const unsigned char *p, const unsigned char *q)
+{
+    ge25519_p3     p_p3, q_p3, r_p3;
+    ge25519_p1p1   r_p1p1;
+    ge25519_cached q_cached;
+
+    if (ristretto255_frombytes(&p_p3, p) != 0 ||
+        ristretto255_frombytes(&q_p3, q) != 0) {
+        return -1;
+    }
+    ge25519_p3_to_cached(&q_cached, &q_p3);
+    ge25519_add(&r_p1p1, &p_p3, &q_cached);
+    ge25519_p1p1_to_p3(&r_p3, &r_p1p1);
+    ristretto255_p3_tobytes(r, &r_p3);
+
+    return 0;
+}
+
+int
+crypto_core_ristretto255_sub(unsigned char *r,
+                             const unsigned char *p, const unsigned char *q)
+{
+    ge25519_p3     p_p3, q_p3, r_p3;
+    ge25519_p1p1   r_p1p1;
+    ge25519_cached q_cached;
+
+    if (ristretto255_frombytes(&p_p3, p) != 0 ||
+        ristretto255_frombytes(&q_p3, q) != 0) {
+        return -1;
+    }
+    ge25519_p3_to_cached(&q_cached, &q_p3);
+    ge25519_sub(&r_p1p1, &p_p3, &q_cached);
+    ge25519_p1p1_to_p3(&r_p3, &r_p1p1);
+    ristretto255_p3_tobytes(r, &r_p3);
+
+    return 0;
+}
+
+int
+crypto_core_ristretto255_from_hash(unsigned char *p, const unsigned char *r)
+{
+    ristretto255_from_hash(p, r);
+
+    return 0;
+}
+
+void
+crypto_core_ristretto255_random(unsigned char *p)
+{
+    unsigned char h[crypto_core_ristretto255_HASHBYTES];
+
+    randombytes_buf(h, sizeof h);
+    (void) crypto_core_ristretto255_from_hash(p, h);
+}
+
+void
+crypto_core_ristretto255_scalar_random(unsigned char *r)
+{
+    crypto_core_ed25519_scalar_random(r);
+}
+
+int
+crypto_core_ristretto255_scalar_invert(unsigned char *recip,
+                                       const unsigned char *s)
+{
+    return crypto_core_ed25519_scalar_invert(recip, s);
+}
+
+void
+crypto_core_ristretto255_scalar_negate(unsigned char *neg,
+                                       const unsigned char *s)
+{
+    crypto_core_ed25519_scalar_negate(neg, s);
+}
+
+void
+crypto_core_ristretto255_scalar_complement(unsigned char *comp,
+                                           const unsigned char *s)
+{
+    crypto_core_ed25519_scalar_complement(comp, s);
+}
+
+void
+crypto_core_ristretto255_scalar_add(unsigned char *z, const unsigned char *x,
+                                    const unsigned char *y)
+{
+    crypto_core_ed25519_scalar_add(z, x, y);
+}
+
+void
+crypto_core_ristretto255_scalar_sub(unsigned char *z, const unsigned char *x,
+                                    const unsigned char *y)
+{
+    crypto_core_ed25519_scalar_sub(z, x, y);
+}
+
+void
+crypto_core_ristretto255_scalar_mul(unsigned char *z, const unsigned char *x,
+                                    const unsigned char *y)
+{
+    sc25519_mul(z, x, y);
+}
+
+void
+crypto_core_ristretto255_scalar_reduce(unsigned char *r,
+                                       const unsigned char *s)
+{
+    crypto_core_ed25519_scalar_reduce(r, s);
+}
+
+size_t
+crypto_core_ristretto255_bytes(void)
+{
+    return crypto_core_ristretto255_BYTES;
+}
+
+size_t
+crypto_core_ristretto255_nonreducedscalarbytes(void)
+{
+    return crypto_core_ristretto255_NONREDUCEDSCALARBYTES;
+}
+
+size_t
+crypto_core_ristretto255_hashbytes(void)
+{
+    return crypto_core_ristretto255_HASHBYTES;
+}
+
+size_t
+crypto_core_ristretto255_scalarbytes(void)
+{
+    return crypto_core_ristretto255_SCALARBYTES;
+}
diff --git a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
index fb0d15fd50fbd20586277cfa4706da1bc0e6ef0e..dda67360074de5fac4ee816d41b2138b5b0e2ceb 100644
--- a/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
+++ b/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c
@@ -163,6 +163,22 @@ fe25519_pow22523(fe25519 out, const fe25519 z)
     fe25519_mul(out, t0, z);
 }
 
+static inline void
+fe25519_cneg(fe25519 h, const fe25519 f, unsigned int b)
+{
+    fe25519 negf;
+
+    fe25519_neg(negf, f);
+    fe25519_copy(h, f);
+    fe25519_cmov(h, negf, b);
+}
+
+static inline void
+fe25519_abs(fe25519 h, const fe25519 f)
+{
+    fe25519_cneg(h, f, fe25519_isnegative(f));
+}
+
 /*
  r = p + q
  */
@@ -513,7 +529,7 @@ equal(signed char b, signed char c)
     unsigned char ub = b;
     unsigned char uc = c;
     unsigned char x  = ub ^ uc; /* 0: yes; 1..255: no */
-    uint32_t      y  = x;       /* 0: yes; 1..255: no */
+    uint32_t      y  = (uint32_t) x; /* 0: yes; 1..255: no */
 
     y -= 1;   /* 4294967295: yes; 0..254: no */
     y >>= 31; /* 1: yes; 0: no */
@@ -550,7 +566,7 @@ ge25519_cmov_cached(ge25519_cached *t, const ge25519_cached *u, unsigned char b)
 }
 
 static void
-ge25519_select(ge25519_precomp *t, const ge25519_precomp precomp[8], const signed char b)
+ge25519_cmov8(ge25519_precomp *t, const ge25519_precomp precomp[8], const signed char b)
 {
     ge25519_precomp     minust;
     const unsigned char bnegative = negative(b);
@@ -572,7 +588,7 @@ ge25519_select(ge25519_precomp *t, const ge25519_precomp precomp[8], const signe
 }
 
 static void
-ge25519_select_base(ge25519_precomp *t, const int pos, const signed char b)
+ge25519_cmov8_base(ge25519_precomp *t, const int pos, const signed char b)
 {
     static const ge25519_precomp base[32][8] = { /* base[i][j] = (j+1)*256^i*B */
 #ifdef HAVE_TI_MODE
@@ -581,11 +597,11 @@ ge25519_select_base(ge25519_precomp *t, const int pos, const signed char b)
 # include "fe_25_5/base.h"
 #endif
     };
-    ge25519_select(t, base[pos], b);
+    ge25519_cmov8(t, base[pos], b);
 }
 
 static void
-ge25519_select_cached(ge25519_cached *t, const ge25519_cached cached[8], const signed char b)
+ge25519_cmov8_cached(ge25519_cached *t, const ge25519_cached cached[8], const signed char b)
 {
     ge25519_cached      minust;
     const unsigned char bnegative = negative(b);
@@ -811,7 +827,7 @@ ge25519_scalarmult(ge25519_p3 *h, const unsigned char *a, const ge25519_p3 *p)
     ge25519_p3_0(h);
 
     for (i = 63; i != 0; i--) {
-        ge25519_select_cached(&t, pi, e[i]);
+        ge25519_cmov8_cached(&t, pi, e[i]);
         ge25519_add(&r, h, &t);
 
         ge25519_p1p1_to_p2(&s, &r);
@@ -825,7 +841,7 @@ ge25519_scalarmult(ge25519_p3 *h, const unsigned char *a, const ge25519_p3 *p)
 
         ge25519_p1p1_to_p3(h, &r);  /* *16 */
     }
-    ge25519_select_cached(&t, pi, e[i]);
+    ge25519_cmov8_cached(&t, pi, e[i]);
     ge25519_add(&r, h, &t);
 
     ge25519_p1p1_to_p3(h, &r);
@@ -871,7 +887,7 @@ ge25519_scalarmult_base(ge25519_p3 *h, const unsigned char *a)
     ge25519_p3_0(h);
 
     for (i = 1; i < 64; i += 2) {
-        ge25519_select_base(&t, i / 2, e[i]);
+        ge25519_cmov8_base(&t, i / 2, e[i]);
         ge25519_madd(&r, h, &t);
         ge25519_p1p1_to_p3(h, &r);
     }
@@ -886,7 +902,7 @@ ge25519_scalarmult_base(ge25519_p3 *h, const unsigned char *a)
     ge25519_p1p1_to_p3(h, &r);
 
     for (i = 0; i < 64; i += 2) {
-        ge25519_select_base(&t, i / 2, e[i]);
+        ge25519_cmov8_base(&t, i / 2, e[i]);
         ge25519_madd(&r, h, &t);
         ge25519_p1p1_to_p3(h, &r);
     }
@@ -1065,7 +1081,7 @@ ge25519_has_small_order(const unsigned char s[32])
  where l = 2^252 + 27742317777372353535851937790883648493.
  */
 
-static void
+void
 sc25519_mul(unsigned char s[32], const unsigned char a[32], const unsigned char b[32])
 {
     int64_t a0  = 2097151 & load_3(a);
@@ -2509,27 +2525,19 @@ chi25519(fe25519 out, const fe25519 z)
     fe25519_mul(out, t1, t0);
 }
 
-void
-ge25519_from_uniform(unsigned char s[32], const unsigned char r[32])
+static void
+ge25519_elligator2(unsigned char s[32], const fe25519 r, const unsigned char x_sign)
 {
-    fe25519       e;
-    fe25519       negx;
-    fe25519       rr2;
-    fe25519       x, x2, x3;
-    ge25519_p3    p3;
-    ge25519_p1p1  p1;
-    ge25519_p2    p2;
-    unsigned int  e_is_minus_1;
-    unsigned char x_sign;
-
-    memcpy(s, r, 32);
-    x_sign = s[31] & 0x80;
-    s[31] &= 0x7f;
-
-    fe25519_frombytes(rr2, s);
-
-    /* elligator */
-    fe25519_sq2(rr2, rr2);
+    fe25519      e;
+    fe25519      negx;
+    fe25519      rr2;
+    fe25519      x, x2, x3;
+    ge25519_p3   p3;
+    ge25519_p1p1 p1;
+    ge25519_p2   p2;
+    unsigned int e_is_minus_1;
+
+    fe25519_sq2(rr2, r);
     rr2[0]++;
     fe25519_invert(rr2, rr2);
     fe25519_mul(x, curve25519_A, rr2);
@@ -2583,3 +2591,276 @@ ge25519_from_uniform(unsigned char s[32], const unsigned char r[32])
 
     ge25519_p3_tobytes(s, &p3);
 }
+
+void
+ge25519_from_uniform(unsigned char s[32], const unsigned char r[32])
+{
+    fe25519       r_fe;
+    unsigned char x_sign;
+
+    memcpy(s, r, 32);
+    x_sign = s[31] & 0x80;
+    s[31] &= 0x7f;
+    fe25519_frombytes(r_fe, s);
+    ge25519_elligator2(s, r_fe, x_sign);
+}
+
+void
+ge25519_from_hash(unsigned char s[32], const unsigned char h[64])
+{
+    unsigned char fl[32];
+    unsigned char gl[32];
+    fe25519       fe_f;
+    fe25519       fe_g;
+    size_t        i;
+    unsigned char x_sign;
+
+    x_sign = h[0] & 0x80;
+    for (i = 0; i < 32; i++) {
+        fl[i] = h[63 - i];
+        gl[i] = h[31 - i];
+    }
+    fl[31] &= 0x7f;
+    gl[31] &= 0x7f;
+    fe25519_frombytes(fe_f, fl);
+    fe25519_frombytes(fe_g, gl);
+    fe_f[0] += (h[32] >> 7) * 19;
+    for (i = 0; i < sizeof (fe25519) / sizeof fe_f[0]; i++) {
+        fe_f[i] += 38 * fe_g[i];
+    }
+    fe25519_reduce(fe_f, fe_f);
+    ge25519_elligator2(s, fe_f, x_sign);
+}
+
+/* Ristretto group */
+
+static int
+ristretto255_sqrt_ratio_m1(fe25519 x, const fe25519 u, const fe25519 v)
+{
+    fe25519 v3;
+    fe25519 vxx;
+    fe25519 m_root_check, p_root_check, f_root_check;
+    fe25519 x_sqrtm1;
+    int     has_m_root, has_p_root, has_f_root;
+
+    fe25519_sq(v3, v);
+    fe25519_mul(v3, v3, v); /* v3 = v^3 */
+    fe25519_sq(x, v3);
+    fe25519_mul(x, x, v);
+    fe25519_mul(x, x, u); /* x = uv^7 */
+
+    fe25519_pow22523(x, x); /* x = (uv^7)^((q-5)/8) */
+    fe25519_mul(x, x, v3);
+    fe25519_mul(x, x, u); /* x = uv^3(uv^7)^((q-5)/8) */
+
+    fe25519_sq(vxx, x);
+    fe25519_mul(vxx, vxx, v); /* vx^2 */
+    fe25519_sub(m_root_check, vxx, u); /* vx^2-u */
+    fe25519_add(p_root_check, vxx, u); /* vx^2+u */
+    fe25519_mul(f_root_check, u, sqrtm1); /* u*sqrt(-1) */
+    fe25519_add(f_root_check, vxx, f_root_check); /* vx^2+u*sqrt(-1) */
+    has_m_root = fe25519_iszero(m_root_check);
+    has_p_root = fe25519_iszero(p_root_check);
+    has_f_root = fe25519_iszero(f_root_check);
+    fe25519_mul(x_sqrtm1, x, sqrtm1); /* x*sqrt(-1) */
+
+    fe25519_cmov(x, x_sqrtm1, has_p_root | has_f_root);
+    fe25519_abs(x, x);
+
+    return has_m_root | has_p_root;
+}
+
+static int
+ristretto255_is_canonical(const unsigned char *s)
+{
+    unsigned char c;
+    unsigned char d;
+    unsigned int  i;
+
+    c = (s[31] & 0x7f) ^ 0x7f;
+    for (i = 30; i > 0; i--) {
+        c |= s[i] ^ 0xff;
+    }
+    c = (((unsigned int) c) - 1U) >> 8;
+    d = (0xed - 1U - (unsigned int) s[0]) >> 8;
+
+    return 1 - (((c & d) | s[0]) & 1);
+}
+
+int
+ristretto255_frombytes(ge25519_p3 *h, const unsigned char *s)
+{
+    fe25519 inv_sqrt;
+    fe25519 one;
+    fe25519 s_;
+    fe25519 ss;
+    fe25519 u1, u2;
+    fe25519 u1u1, u2u2;
+    fe25519 v;
+    fe25519 v_u2u2;
+    int     was_square;
+
+    if (ristretto255_is_canonical(s) == 0) {
+        return -1;
+    }
+    fe25519_frombytes(s_, s);
+    fe25519_sq(ss, s_);                /* ss = s^2 */
+
+    fe25519_1(u1);
+    fe25519_sub(u1, u1, ss);           /* u1 = 1-ss */
+    fe25519_sq(u1u1, u1);              /* u1u1 = u1^2 */
+
+    fe25519_1(u2);
+    fe25519_add(u2, u2, ss);           /* u2 = 1+ss */
+    fe25519_sq(u2u2, u2);              /* u2u2 = u2^2 */
+
+    fe25519_mul(v, d, u1u1);           /* v = d*u1^2 */
+    fe25519_neg(v, v);                 /* v = -d*u1^2 */
+    fe25519_sub(v, v, u2u2);           /* v = -(d*u1^2)-u2^2 */
+
+    fe25519_mul(v_u2u2, v, u2u2);      /* v_u2u2 = v*u2^2 */
+
+    fe25519_1(one);
+    was_square = ristretto255_sqrt_ratio_m1(inv_sqrt, one, v_u2u2);
+    fe25519_mul(h->X, inv_sqrt, u2);
+    fe25519_mul(h->Y, inv_sqrt, h->X);
+    fe25519_mul(h->Y, h->Y, v);
+
+    fe25519_mul(h->X, h->X, s_);
+    fe25519_add(h->X, h->X, h->X);
+    fe25519_abs(h->X, h->X);
+    fe25519_mul(h->Y, u1, h->Y);
+    fe25519_1(h->Z);
+    fe25519_mul(h->T, h->X, h->Y);
+
+    return - ((1 - was_square) |
+              fe25519_isnegative(h->T) | fe25519_iszero(h->Y));
+}
+
+void
+ristretto255_p3_tobytes(unsigned char *s, const ge25519_p3 *h)
+{
+    fe25519 den1, den2;
+    fe25519 den_inv;
+    fe25519 eden;
+    fe25519 inv_sqrt;
+    fe25519 ix, iy;
+    fe25519 one;
+    fe25519 s_;
+    fe25519 t_z_inv;
+    fe25519 u1, u2;
+    fe25519 u1_u2u2;
+    fe25519 x_, y_;
+    fe25519 x_z_inv;
+    fe25519 z_inv;
+    fe25519 zmy;
+    int     rotate;
+
+    fe25519_add(u1, h->Z, h->Y);       /* u1 = Z+Y */
+    fe25519_sub(zmy, h->Z, h->Y);      /* zmy = Z-Y */
+    fe25519_mul(u1, u1, zmy);          /* u1 = (Z+Y)*(Z-Y) */
+    fe25519_mul(u2, h->X, h->Y);       /* u2 = X*Y */
+
+    fe25519_sq(u1_u2u2, u2);           /* u1_u2u2 = u2^2 */
+    fe25519_mul(u1_u2u2, u1, u1_u2u2); /* u1_u2u2 = u1*u2^2 */
+
+    fe25519_1(one);
+    (void) ristretto255_sqrt_ratio_m1(inv_sqrt, one, u1_u2u2);
+    fe25519_mul(den1, inv_sqrt, u1);   /* den1 = inv_sqrt*u1 */
+    fe25519_mul(den2, inv_sqrt, u2);   /* den2 = inv_sqrt*u2 */
+    fe25519_mul(z_inv, den1, den2);    /* z_inv = den1*den2 */
+    fe25519_mul(z_inv, z_inv, h->T);   /* z_inv = den1*den2*T */
+
+    fe25519_mul(ix, h->X, sqrtm1);     /* ix = X*sqrt(-1) */
+    fe25519_mul(iy, h->Y, sqrtm1);     /* iy = Y*sqrt(-1) */
+    fe25519_mul(eden, den1, invsqrtamd); /* eden = den1*sqrt(a-d) */
+
+    fe25519_mul(t_z_inv, h->T, z_inv); /* t_z_inv = T*z_inv */
+    rotate = fe25519_isnegative(t_z_inv);
+
+    fe25519_copy(x_, h->X);
+    fe25519_copy(y_, h->Y);
+    fe25519_copy(den_inv, den2);
+
+    fe25519_cmov(x_, iy, rotate);
+    fe25519_cmov(y_, ix, rotate);
+    fe25519_cmov(den_inv, eden, rotate);
+
+    fe25519_mul(x_z_inv, x_, z_inv);
+    fe25519_cneg(y_, y_, fe25519_isnegative(x_z_inv));
+
+    fe25519_sub(s_, h->Z, y_);
+    fe25519_mul(s_, den_inv, s_);
+    fe25519_abs(s_, s_);
+    fe25519_tobytes(s, s_);
+}
+
+static void
+ristretto255_elligator(ge25519_p3 *p, const fe25519 t)
+{
+    fe25519 c;
+    fe25519 n;
+    fe25519 one;
+    fe25519 r;
+    fe25519 rpd;
+    fe25519 s, s_prime;
+    fe25519 ss;
+    fe25519 u, v;
+    fe25519 w0, w1, w2, w3;
+    int     wasnt_square;
+
+    fe25519_1(one);
+    fe25519_sq(r, t);                  /* r = t^2 */
+    fe25519_mul(r, sqrtm1, r);         /* r = sqrt(-1)*t^2 */
+    fe25519_add(u, r, one);            /* u = r+1 */
+    fe25519_mul(u, u, onemsqd);        /* u = (r+1)*(1-d^2) */
+    fe25519_1(c);
+    fe25519_neg(c, c);                 /* c = -1 */
+    fe25519_add(rpd, r, d);            /* rpd = r*d */
+    fe25519_mul(v, r, d);              /* v = r*d */
+    fe25519_sub(v, c, v);              /* v = c-r*d */
+    fe25519_mul(v, v, rpd);            /* v = (c-r*d)*(r+d) */
+
+    wasnt_square = 1 - ristretto255_sqrt_ratio_m1(s, u, v);
+    fe25519_mul(s_prime, s, t);
+    fe25519_abs(s_prime, s_prime);
+    fe25519_neg(s_prime, s_prime);     /* s_prime = -|s*t| */
+    fe25519_cmov(s, s_prime, wasnt_square);
+    fe25519_cmov(c, r, wasnt_square);
+
+    fe25519_sub(n, r, one);            /* n = r-1 */
+    fe25519_mul(n, n, c);              /* n = c*(r-1) */
+    fe25519_mul(n, n, sqdmone);        /* n = c*(r-1)*(d-1)^2 */
+    fe25519_sub(n, n, v);              /* n =  c*(r-1)*(d-1)^2-v */
+
+    fe25519_add(w0, s, s);             /* w0 = 2s */
+    fe25519_mul(w0, w0, v);            /* w0 = 2s*v */
+    fe25519_mul(w1, n, sqrtadm1);      /* w1 = n*sqrt(ad-1) */
+    fe25519_sq(ss, s);                 /* ss = s^2 */
+    fe25519_sub(w2, one, ss);          /* w2 = 1-s^2 */
+    fe25519_add(w3, one, ss);          /* w3 = 1+s^2 */
+
+    fe25519_mul(p->X, w0, w3);
+    fe25519_mul(p->Y, w2, w1);
+    fe25519_mul(p->Z, w1, w3);
+    fe25519_mul(p->T, w0, w2);
+}
+
+void
+ristretto255_from_hash(unsigned char s[32], const unsigned char h[64])
+{
+    fe25519        r0, r1;
+    ge25519_cached p1_cached;
+    ge25519_p1p1   p_p1p1;
+    ge25519_p3     p0, p1;
+    ge25519_p3     p;
+
+    fe25519_frombytes(r0, h);
+    fe25519_frombytes(r1, h + 32);
+    ristretto255_elligator(&p0, r0);
+    ristretto255_elligator(&p1, r1);
+    ge25519_p3_to_cached(&p1_cached, &p1);
+    ge25519_add(&p_p1p1, &p0, &p1_cached);
+    ge25519_p1p1_to_p3(&p, &p_p1p1);
+    ristretto255_p3_tobytes(s, &p);
+}
diff --git a/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h b/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h
index 3dc9156a31ee0363d90c0187beb75833f46c5cdc..dd6da1b87403a34d849495c1b150d0a12b26cb56 100644
--- a/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h
+++ b/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h
@@ -18,3 +18,23 @@ static const fe25519 sqrtm1 = {
 static const fe25519 curve25519_A = {
     486662, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
+
+/* sqrt(ad - 1) with a = -1 (mod p) */
+static const fe25519 sqrtadm1 = {
+    24849947, -153582, -23613485, 6347715, -21072328, -667138, -25271143, -15367704, -870347, 14525639
+};
+
+/* 1 / sqrt(a - d) */
+static const fe25519 invsqrtamd = {
+    6111485, 4156064, -27798727, 12243468, -25904040, 120897, 20826367, -7060776, 6093568, -1986012
+};
+
+/* 1 - d ^ 2 */
+static const fe25519 onemsqd = {
+    6275446, -16617371, -22938544, -3773710, 11667077, 7397348, -27922721, 1766195, -24433858, 672203
+};
+
+/* (d - 1) ^ 2 */
+static const fe25519 sqdmone = {
+    15551795, -11097455, -13425098, -10125071, -11896535, 10178284, -26634327, 4729244, -5282110, -10116402
+};
diff --git a/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h b/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h
index 53b75c6b455ede42ee1d3d5641f4edfb2a44b218..24e5cb5ebbe1780ad75a6041f8e51670ef9bdd37 100644
--- a/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h
+++ b/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h
@@ -19,3 +19,23 @@ static const fe25519 sqrtm1 = {
 static const fe25519 curve25519_A = {
     486662, 0, 0, 0, 0
 };
+
+/* sqrt(ad - 1) with a = -1 (mod p) */
+static const fe25519 sqrtadm1 = {
+    2241493124984347, 425987919032274, 2207028919301688, 1220490630685848, 974799131293748
+};
+
+/* 1 / sqrt(a - d) */
+static const fe25519 invsqrtamd = {
+    278908739862762, 821645201101625, 8113234426968, 1777959178193151, 2118520810568447
+};
+
+/* 1 - d ^ 2 */
+static const fe25519 onemsqd = {
+    1136626929484150, 1998550399581263, 496427632559748, 118527312129759, 45110755273534
+};
+
+/* (d - 1) ^ 2 */
+static const fe25519 sqdmone = {
+    1507062230895904, 1572317787530805, 683053064812840, 317374165784489, 1572899562415810
+};
diff --git a/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c b/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
index a077d7f4dbf2d8e4b974077512af49b4a394f112..c023378c6b2895e191a66ad69264f66f37e77183 100644
--- a/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
+++ b/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c
@@ -127,7 +127,7 @@ crypto_core_salsa20_constbytes(void)
 }
 
 #ifndef MINIMAL
-
+/* LCOV_EXCL_START */
 int
 crypto_core_salsa2012(unsigned char *out, const unsigned char *in,
                       const unsigned char *k, const unsigned char *c)
@@ -191,5 +191,5 @@ crypto_core_salsa208_constbytes(void)
 {
     return crypto_core_salsa208_CONSTBYTES;
 }
-
+/* LCOV_EXCL_END */
 #endif
diff --git a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h
index d08603a8c5a10d05b016ca22fcd169c1ded4c498..7c11321b9232930b60aebfc943b846e0c17ff4ff 100644
--- a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h
+++ b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h
@@ -68,17 +68,17 @@ LOADU64(const void *p)
 
 #define BLAKE2B_DIAG_V1(a, b, c, d)                               \
     do {                                                          \
-        d = _mm256_permute4x64_epi64(d, _MM_SHUFFLE(2, 1, 0, 3)); \
-        c = _mm256_permute4x64_epi64(c, _MM_SHUFFLE(1, 0, 3, 2)); \
-        b = _mm256_permute4x64_epi64(b, _MM_SHUFFLE(0, 3, 2, 1)); \
-    } while (0)
+        a = _mm256_permute4x64_epi64(a, _MM_SHUFFLE(2, 1, 0, 3)); \
+        d = _mm256_permute4x64_epi64(d, _MM_SHUFFLE(1, 0, 3, 2)); \
+        c = _mm256_permute4x64_epi64(c, _MM_SHUFFLE(0, 3, 2, 1)); \
+    } while(0)
 
 #define BLAKE2B_UNDIAG_V1(a, b, c, d)                             \
     do {                                                          \
-        d = _mm256_permute4x64_epi64(d, _MM_SHUFFLE(0, 3, 2, 1)); \
-        c = _mm256_permute4x64_epi64(c, _MM_SHUFFLE(1, 0, 3, 2)); \
-        b = _mm256_permute4x64_epi64(b, _MM_SHUFFLE(2, 1, 0, 3)); \
-    } while (0)
+        a = _mm256_permute4x64_epi64(a, _MM_SHUFFLE(0, 3, 2, 1)); \
+        d = _mm256_permute4x64_epi64(d, _MM_SHUFFLE(1, 0, 3, 2)); \
+        c = _mm256_permute4x64_epi64(c, _MM_SHUFFLE(2, 1, 0, 3)); \
+    } while(0)
 
 #include "blake2b-load-avx2.h"
 
diff --git a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
index b0422c93f18e17da71877a3736e4bfb8f6c2d73f..5fb356f39ba47ccabf74bda7912407056b106405 100644
--- a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
+++ b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c
@@ -35,7 +35,7 @@ blake2b_compress_ref(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES])
     int      i;
 
     for (i = 0; i < 16; ++i) {
-        m[i] = LOAD64_LE(block + i * sizeof(m[i]));
+        m[i] = LOAD64_LE(block + i * sizeof m[i]);
     }
     for (i = 0; i < 8; ++i) {
         v[i] = S->h[i];
@@ -48,16 +48,16 @@ blake2b_compress_ref(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES])
     v[13] = S->t[1] ^ blake2b_IV[5];
     v[14] = S->f[0] ^ blake2b_IV[6];
     v[15] = S->f[1] ^ blake2b_IV[7];
-#define G(r, i, a, b, c, d)                         \
-    do {                                            \
-        a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \
-        d = ROTR64(d ^ a, 32);                      \
-        c = c + d;                                  \
-        b = ROTR64(b ^ c, 24);                      \
-        a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \
-        d = ROTR64(d ^ a, 16);                      \
-        c = c + d;                                  \
-        b = ROTR64(b ^ c, 63);                      \
+#define G(r, i, a, b, c, d)                      \
+    do {                                         \
+        a += b + m[blake2b_sigma[r][2 * i + 0]]; \
+        d = ROTR64(d ^ a, 32);                   \
+        c += d;                                  \
+        b = ROTR64(b ^ c, 24);                   \
+        a += b + m[blake2b_sigma[r][2 * i + 1]]; \
+        d = ROTR64(d ^ a, 16);                   \
+        c += d;                                  \
+        b = ROTR64(b ^ c, 63);                   \
     } while (0)
 #define ROUND(r)                           \
     do {                                   \
diff --git a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h
index 8c15f177c704a961b7347209be3df9bdddaceb11..12a5d1890c326884cc9ad68c49d5969f157dd264 100644
--- a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h
+++ b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h
@@ -17,15 +17,15 @@
 
 #define BLAKE2B_LOAD_MSG_0_3(b0)               \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m4, m5);    \
-        t1 = _mm256_unpacklo_epi64(m6, m7);    \
+        t0 = _mm256_unpacklo_epi64(m7, m4);    \
+        t1 = _mm256_unpacklo_epi64(m5, m6);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_0_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m4, m5);    \
-        t1 = _mm256_unpackhi_epi64(m6, m7);    \
+        t0 = _mm256_unpackhi_epi64(m7, m4);    \
+        t1 = _mm256_unpackhi_epi64(m5, m6);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -43,17 +43,17 @@
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
-#define BLAKE2B_LOAD_MSG_1_3(b0)                                \
-    do {                                                        \
-        t0 = _mm256_shuffle_epi32(m0, _MM_SHUFFLE(1, 0, 3, 2)); \
-        t1 = _mm256_unpackhi_epi64(m5, m2);                     \
-        b0 = _mm256_blend_epi32(t0, t1, 0xF0);                  \
+#define BLAKE2B_LOAD_MSG_1_3(b0)               \
+    do {                                       \
+        t0 = _mm256_unpackhi_epi64(m2, m0);    \
+        t1 = _mm256_blend_epi32(m5, m0, 0x33); \
+        b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_1_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m6, m1);    \
-        t1 = _mm256_unpackhi_epi64(m3, m1);    \
+        t0 = _mm256_alignr_epi8(m6, m1, 8);    \
+        t1 = _mm256_blend_epi32(m3, m1, 0x33); \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -73,15 +73,15 @@
 
 #define BLAKE2B_LOAD_MSG_2_3(b0)               \
     do {                                       \
-        t0 = _mm256_blend_epi32(m1, m5, 0x33); \
-        t1 = _mm256_unpackhi_epi64(m3, m4);    \
+        t0 = _mm256_alignr_epi8(m5, m4, 8);    \
+        t1 = _mm256_unpackhi_epi64(m1, m3);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_2_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m7, m3);    \
-        t1 = _mm256_alignr_epi8(m2, m0, 8);    \
+        t0 = _mm256_unpacklo_epi64(m2, m7);    \
+        t1 = _mm256_blend_epi32(m0, m3, 0x33); \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -99,17 +99,17 @@
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
-#define BLAKE2B_LOAD_MSG_3_3(b0)               \
-    do {                                       \
-        t0 = _mm256_blend_epi32(m2, m1, 0x33); \
-        t1 = _mm256_blend_epi32(m7, m2, 0x33); \
-        b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
+#define BLAKE2B_LOAD_MSG_3_3(b0)                                \
+    do {                                                        \
+        t0 = _mm256_alignr_epi8(m1, m7, 8);                     \
+        t1 = _mm256_shuffle_epi32(m2, _MM_SHUFFLE(1, 0, 3, 2)); \
+        b0 = _mm256_blend_epi32(t0, t1, 0xF0);                  \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_3_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m3, m5);    \
-        t1 = _mm256_unpacklo_epi64(m0, m4);    \
+        t0 = _mm256_unpacklo_epi64(m4, m3);    \
+        t1 = _mm256_unpacklo_epi64(m5, m0);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -129,15 +129,15 @@
 
 #define BLAKE2B_LOAD_MSG_4_3(b0)               \
     do {                                       \
-        t0 = _mm256_blend_epi32(m5, m7, 0x33); \
-        t1 = _mm256_blend_epi32(m1, m3, 0x33); \
+        t0 = _mm256_alignr_epi8(m7, m1, 8);    \
+        t1 = _mm256_alignr_epi8(m3, m5, 8);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_4_4(b0)               \
     do {                                       \
-        t0 = _mm256_alignr_epi8(m6, m0, 8);    \
-        t1 = _mm256_blend_epi32(m6, m4, 0x33); \
+        t0 = _mm256_unpackhi_epi64(m6, m0);    \
+        t1 = _mm256_unpacklo_epi64(m6, m4);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -157,15 +157,15 @@
 
 #define BLAKE2B_LOAD_MSG_5_3(b0)               \
     do {                                       \
-        t0 = _mm256_blend_epi32(m3, m2, 0x33); \
-        t1 = _mm256_unpackhi_epi64(m7, m0);    \
+        t0 = _mm256_alignr_epi8(m2, m0, 8);    \
+        t1 = _mm256_unpackhi_epi64(m3, m7);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_5_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m6, m2);    \
-        t1 = _mm256_blend_epi32(m4, m7, 0x33); \
+        t0 = _mm256_unpackhi_epi64(m4, m6);    \
+        t1 = _mm256_alignr_epi8(m7, m2, 8);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -183,20 +183,20 @@
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
-#define BLAKE2B_LOAD_MSG_6_3(b0)                                \
-    do {                                                        \
-        t0 = _mm256_unpacklo_epi64(m0, m3);                     \
-        t1 = _mm256_shuffle_epi32(m4, _MM_SHUFFLE(1, 0, 3, 2)); \
-        b0 = _mm256_blend_epi32(t0, t1, 0xF0);                  \
-    } while (0)
-
-#define BLAKE2B_LOAD_MSG_6_4(b0)               \
+#define BLAKE2B_LOAD_MSG_6_3(b0)               \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m3, m1);    \
-        t1 = _mm256_blend_epi32(m5, m1, 0x33); \
+        t0 = _mm256_unpacklo_epi64(m4, m0);    \
+        t1 = _mm256_blend_epi32(m4, m3, 0x33); \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
+#define BLAKE2B_LOAD_MSG_6_4(b0)                                \
+    do {                                                        \
+        t0 = _mm256_unpackhi_epi64(m5, m3);                     \
+        t1 = _mm256_shuffle_epi32(m1, _MM_SHUFFLE(1, 0, 3, 2)); \
+        b0 = _mm256_blend_epi32(t0, t1, 0xF0);                  \
+    } while (0)
+
 #define BLAKE2B_LOAD_MSG_7_1(b0)               \
     do {                                       \
         t0 = _mm256_unpackhi_epi64(m6, m3);    \
@@ -213,15 +213,15 @@
 
 #define BLAKE2B_LOAD_MSG_7_3(b0)               \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m2, m7);    \
-        t1 = _mm256_unpacklo_epi64(m4, m1);    \
+        t0 = _mm256_blend_epi32(m2, m1, 0x33); \
+        t1 = _mm256_alignr_epi8(m4, m7, 8);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_7_4(b0)               \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m0, m2);    \
-        t1 = _mm256_unpacklo_epi64(m3, m5);    \
+        t0 = _mm256_unpacklo_epi64(m5, m0);    \
+        t1 = _mm256_unpacklo_epi64(m2, m3);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -241,15 +241,15 @@
 
 #define BLAKE2B_LOAD_MSG_8_3(b0)               \
     do {                                       \
-        t0 = m6;                               \
-        t1 = _mm256_alignr_epi8(m5, m0, 8);    \
+        t0 = _mm256_unpacklo_epi64(m5, m6);    \
+        t1 = _mm256_unpackhi_epi64(m6, m0);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_8_4(b0)               \
     do {                                       \
-        t0 = _mm256_blend_epi32(m3, m1, 0x33); \
-        t1 = m2;                               \
+        t0 = _mm256_alignr_epi8(m1, m2, 8);    \
+        t1 = _mm256_alignr_epi8(m2, m3, 8);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -269,15 +269,15 @@
 
 #define BLAKE2B_LOAD_MSG_9_3(b0)               \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m7, m4);    \
-        t1 = _mm256_unpackhi_epi64(m1, m6);    \
+        t0 = _mm256_unpackhi_epi64(m6, m7);    \
+        t1 = _mm256_unpackhi_epi64(m4, m1);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_9_4(b0)               \
     do {                                       \
-        t0 = _mm256_alignr_epi8(m7, m5, 8);    \
-        t1 = _mm256_unpacklo_epi64(m6, m0);    \
+        t0 = _mm256_blend_epi32(m5, m0, 0x33); \
+        t1 = _mm256_unpacklo_epi64(m7, m6);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -297,15 +297,15 @@
 
 #define BLAKE2B_LOAD_MSG_10_3(b0)              \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m4, m5);    \
-        t1 = _mm256_unpacklo_epi64(m6, m7);    \
+        t0 = _mm256_unpacklo_epi64(m7, m4);    \
+        t1 = _mm256_unpacklo_epi64(m5, m6);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_10_4(b0)              \
     do {                                       \
-        t0 = _mm256_unpackhi_epi64(m4, m5);    \
-        t1 = _mm256_unpackhi_epi64(m6, m7);    \
+        t0 = _mm256_unpackhi_epi64(m7, m4);    \
+        t1 = _mm256_unpackhi_epi64(m5, m6);    \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
@@ -323,17 +323,17 @@
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
-#define BLAKE2B_LOAD_MSG_11_3(b0)                               \
-    do {                                                        \
-        t0 = _mm256_shuffle_epi32(m0, _MM_SHUFFLE(1, 0, 3, 2)); \
-        t1 = _mm256_unpackhi_epi64(m5, m2);                     \
-        b0 = _mm256_blend_epi32(t0, t1, 0xF0);                  \
+#define BLAKE2B_LOAD_MSG_11_3(b0)              \
+    do {                                       \
+        t0 = _mm256_unpackhi_epi64(m2, m0);    \
+        t1 = _mm256_blend_epi32(m5, m0, 0x33); \
+        b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
 #define BLAKE2B_LOAD_MSG_11_4(b0)              \
     do {                                       \
-        t0 = _mm256_unpacklo_epi64(m6, m1);    \
-        t1 = _mm256_unpackhi_epi64(m3, m1);    \
+        t0 = _mm256_alignr_epi8(m6, m1, 8);    \
+        t1 = _mm256_blend_epi32(m3, m1, 0x33); \
         b0 = _mm256_blend_epi32(t0, t1, 0xF0); \
     } while (0)
 
diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h
index c827f898347e4b3b5e10108f0de0a00f9f647ab2..2475bfa1a0aaaa1e31d11f90c80b9d3d67ac4af7 100644
--- a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h
+++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h
@@ -41,7 +41,7 @@ poly1305_init(poly1305_state_internal_t *st, const unsigned char key[32])
     t1 = LOAD64_LE(&key[8]);
 
     /* wiped after finalization */
-    st->r[0] = (t0) &0xffc0fffffff;
+    st->r[0] = (t0) & 0xffc0fffffff;
     st->r[1] = ((t0 >> 44) | (t1 << 20)) & 0xfffffc0ffff;
     st->r[2] = ((t1 >> 24)) & 0x00ffffffc0f;
 
@@ -88,8 +88,8 @@ poly1305_blocks(poly1305_state_internal_t *st, const unsigned char *m,
         t0 = LOAD64_LE(&m[0]);
         t1 = LOAD64_LE(&m[8]);
 
-        h0 += ((t0) &0xfffffffffff);
-        h1 += (((t0 >> 44) | (t1 << 20)) & 0xfffffffffff);
+        h0 += t0 & 0xfffffffffff;
+        h1 += ((t0 >> 44) | (t1 << 20)) & 0xfffffffffff;
         h2 += (((t1 >> 24)) & 0x3ffffffffff) | hibit;
 
         /* h *= r */
@@ -138,6 +138,7 @@ poly1305_finish(poly1305_state_internal_t *st, unsigned char mac[16])
     unsigned long long h0, h1, h2, c;
     unsigned long long g0, g1, g2;
     unsigned long long t0, t1;
+    unsigned long long mask;
 
     /* process the remaining block */
     if (st->leftover) {
@@ -157,43 +158,43 @@ poly1305_finish(poly1305_state_internal_t *st, unsigned char mac[16])
     h1 = st->h[1];
     h2 = st->h[2];
 
-    c = (h1 >> 44);
+    c = h1 >> 44;
     h1 &= 0xfffffffffff;
     h2 += c;
-    c = (h2 >> 42);
+    c = h2 >> 42;
     h2 &= 0x3ffffffffff;
     h0 += c * 5;
-    c = (h0 >> 44);
+    c = h0 >> 44;
     h0 &= 0xfffffffffff;
     h1 += c;
-    c = (h1 >> 44);
+    c = h1 >> 44;
     h1 &= 0xfffffffffff;
     h2 += c;
-    c = (h2 >> 42);
+    c = h2 >> 42;
     h2 &= 0x3ffffffffff;
     h0 += c * 5;
-    c = (h0 >> 44);
+    c = h0 >> 44;
     h0 &= 0xfffffffffff;
     h1 += c;
 
     /* compute h + -p */
     g0 = h0 + 5;
-    c  = (g0 >> 44);
+    c  = g0 >> 44;
     g0 &= 0xfffffffffff;
     g1 = h1 + c;
-    c  = (g1 >> 44);
+    c  = g1 >> 44;
     g1 &= 0xfffffffffff;
     g2 = h2 + c - (1ULL << 42);
 
     /* select h if h < p, or h + -p if h >= p */
-    c = (g2 >> ((sizeof(unsigned long long) * 8) - 1)) - 1;
-    g0 &= c;
-    g1 &= c;
-    g2 &= c;
-    c  = ~c;
-    h0 = (h0 & c) | g0;
-    h1 = (h1 & c) | g1;
-    h2 = (h2 & c) | g2;
+    mask = (g2 >> ((sizeof(unsigned long long) * 8) - 1)) - 1;
+    g0   &= mask;
+    g1   &= mask;
+    g2   &= mask;
+    mask =  ~mask;
+    h0   =  (h0 & mask) | g0;
+    h1   =  (h1 & mask) | g1;
+    h2   =  (h2 & mask) | g2;
 
     /* h = (h + pad) */
     t0 = st->pad[0];
@@ -209,8 +210,8 @@ poly1305_finish(poly1305_state_internal_t *st, unsigned char mac[16])
     h2 &= 0x3ffffffffff;
 
     /* mac = h % (2^128) */
-    h0 = ((h0) | (h1 << 44));
-    h1 = ((h1 >> 20) | (h2 << 24));
+    h0 = (h0) | (h1 << 44);
+    h1 = (h1 >> 20) | (h2 << 24);
 
     STORE64_LE(&mac[0], h0);
     STORE64_LE(&mac[8], h1);
diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c
index bfe3fbbf9ae17b45e6c420e3509ea87e690166cb..c4e4d842143fab330353c0974eda31713c7357db 100644
--- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c
+++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c
@@ -113,9 +113,11 @@ allocate_memory(block_region **region, uint32_t m_cost)
     }
 #endif
     if (base == NULL) {
+        /* LCOV_EXCL_START */
         free(*region);
         *region = NULL;
-        return ARGON2_MEMORY_ALLOCATION_ERROR; /* LCOV_EXCL_LINE */
+        return ARGON2_MEMORY_ALLOCATION_ERROR;
+        /* LCOV_EXCL_STOP */
     }
     (*region)->base   = base;
     (*region)->memory = memory;
diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
index b1c1bd844b532f4e29a2954039a13d10face3d41..5bf0d704b6043473699db5693f1ca7596513a665 100644
--- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
+++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
@@ -305,6 +305,10 @@ escrypt_kdf_nosse(escrypt_local_t *local, const uint8_t *passwd,
     uint32_t  i;
 
 /* Sanity-check parameters. */
+    if (r == 0 || p == 0) {
+        errno = EINVAL;
+        return -1;
+    }
 #if SIZE_MAX > UINT32_MAX
     if (buflen > (((uint64_t)(1) << 32) - 1) * 32) {
         errno = EFBIG;
diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
index 754a19fdb8035a0465bf7c7ba23c352ab0fa32c1..688f2d3087adc46db6d22b793043262fddc26800 100644
--- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
+++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
@@ -317,6 +317,10 @@ escrypt_kdf_sse(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen,
     uint32_t  i;
 
 /* Sanity-check parameters. */
+    if (r == 0 || p == 0) {
+        errno = EINVAL;
+        return -1;
+    }
 # if SIZE_MAX > UINT32_MAX
 /* LCOV_EXCL_START */
     if (buflen > (((uint64_t)(1) << 32) - 1) * 32) {
diff --git a/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c b/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
index 800ff00e05a4eca56998dbdbc6e1dd9d881f18c1..7c980893ec0d4079e26f13e0ecb29f602c449455 100644
--- a/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
+++ b/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c
@@ -24,7 +24,6 @@ static inline void
 _crypto_scalarmult_ed25519_clamp(unsigned char k[32])
 {
     k[0] &= 248;
-    k[31] &= 127;
     k[31] |= 64;
 }
 
@@ -47,6 +46,8 @@ _crypto_scalarmult_ed25519(unsigned char *q, const unsigned char *n,
     if (clamp != 0) {
         _crypto_scalarmult_ed25519_clamp(t);
     }
+    t[31] &= 127;
+
     ge25519_scalarmult(&Q, t, &P);
     ge25519_p3_tobytes(q, &Q);
     if (_crypto_scalarmult_ed25519_is_inf(q) != 0 || sodium_is_zero(n, 32)) {
@@ -83,6 +84,8 @@ _crypto_scalarmult_ed25519_base(unsigned char *q,
     if (clamp != 0) {
         _crypto_scalarmult_ed25519_clamp(t);
     }
+    t[31] &= 127;
+
     ge25519_scalarmult_base(&Q, t);
     ge25519_p3_tobytes(q, &Q);
     if (_crypto_scalarmult_ed25519_is_inf(q) != 0 || sodium_is_zero(n, 32)) {
diff --git a/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c b/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c
new file mode 100644
index 0000000000000000000000000000000000000000..433a9a26dc6157e94255faa9e12807254dff4661
--- /dev/null
+++ b/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c
@@ -0,0 +1,63 @@
+
+#include <string.h>
+
+#include "crypto_scalarmult_ed25519.h"
+#include "crypto_scalarmult_ristretto255.h"
+#include "private/ed25519_ref10.h"
+#include "utils.h"
+
+int
+crypto_scalarmult_ristretto255(unsigned char *q, const unsigned char *n,
+                               const unsigned char *p)
+{
+    unsigned char *t = q;
+    ge25519_p3     Q;
+    ge25519_p3     P;
+    unsigned int   i;
+
+    if (ristretto255_frombytes(&P, p) != 0) {
+        return -1;
+    }
+    for (i = 0; i < 32; ++i) {
+        t[i] = n[i];
+    }
+    t[31] &= 127;
+    ge25519_scalarmult(&Q, t, &P);
+    ristretto255_p3_tobytes(q, &Q);
+    if (sodium_is_zero(q, 32)) {
+        return -1;
+    }
+    return 0;
+}
+
+int
+crypto_scalarmult_ristretto255_base(unsigned char *q,
+                                    const unsigned char *n)
+{
+    unsigned char *t = q;
+    ge25519_p3     Q;
+    unsigned int   i;
+
+    for (i = 0; i < 32; ++i) {
+        t[i] = n[i];
+    }
+    t[31] &= 127;
+    ge25519_scalarmult_base(&Q, t);
+    ristretto255_p3_tobytes(q, &Q);
+    if (sodium_is_zero(q, 32)) {
+        return -1;
+    }
+    return 0;
+}
+
+size_t
+crypto_scalarmult_ristretto255_bytes(void)
+{
+    return crypto_scalarmult_ristretto255_BYTES;
+}
+
+size_t
+crypto_scalarmult_ristretto255_scalarbytes(void)
+{
+    return crypto_scalarmult_ristretto255_SCALARBYTES;
+}
diff --git a/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c b/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
index 03440cfa75f1b0d58cc67b73680b43961813300b..64ded79ed58ad1d069a7a192341972f0722a73b8 100644
--- a/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
+++ b/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c
@@ -10,6 +10,7 @@
 #include "randombytes.h"
 #include "utils.h"
 
+/* LCOV_EXCL_START */
 int
 crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk,
                                             unsigned char *sk)
@@ -114,3 +115,4 @@ crypto_sign_edwards25519sha512batch_open(unsigned char       *m,
 
     return 0;
 }
+/* LCOV_EXCL_END */
diff --git a/src/libsodium/crypto_sign/ed25519/ref10/sign.c b/src/libsodium/crypto_sign/ed25519/ref10/sign.c
index 3e34e170798b9251ee137d2ebab066d8ef8b25eb..bbdd8f729370392394ebc2e53caf4e159a2d9f15 100644
--- a/src/libsodium/crypto_sign/ed25519/ref10/sign.c
+++ b/src/libsodium/crypto_sign/ed25519/ref10/sign.c
@@ -76,7 +76,7 @@ _crypto_sign_ed25519_detached(unsigned char *sig, unsigned long long *siglen_p,
 
     crypto_hash_sha512(az, sk, 32);
 #ifdef ED25519_NONDETERMINISTIC
-    _crypto_sign_ed25519_synthetic_r_hv(&hs, nonce, az);
+    _crypto_sign_ed25519_synthetic_r_hv(&hs, nonce /* Z */, az);
 #else
     crypto_hash_sha512_update(&hs, az + 32, 32);
 #endif
diff --git a/src/libsodium/include/Makefile.am b/src/libsodium/include/Makefile.am
index b70c22b39b8e9f65af09e603051e40c73be5692d..7476bd974d51f36a0840f6fbf5397515f684fe9f 100644
--- a/src/libsodium/include/Makefile.am
+++ b/src/libsodium/include/Makefile.am
@@ -13,6 +13,7 @@ SODIUM_EXPORT = \
 	sodium/crypto_box_curve25519xchacha20poly1305.h \
 	sodium/crypto_box_curve25519xsalsa20poly1305.h \
 	sodium/crypto_core_ed25519.h \
+	sodium/crypto_core_ristretto255.h \
 	sodium/crypto_core_hchacha20.h \
 	sodium/crypto_core_hsalsa20.h \
 	sodium/crypto_core_salsa20.h \
@@ -35,6 +36,7 @@ SODIUM_EXPORT = \
 	sodium/crypto_scalarmult.h \
 	sodium/crypto_scalarmult_curve25519.h \
 	sodium/crypto_scalarmult_ed25519.h \
+	sodium/crypto_scalarmult_ristretto255.h \
 	sodium/crypto_secretbox.h \
 	sodium/crypto_secretbox_xchacha20poly1305.h \
 	sodium/crypto_secretbox_xsalsa20poly1305.h \
@@ -56,16 +58,11 @@ SODIUM_EXPORT = \
 	sodium/crypto_verify_64.h \
 	sodium/export.h \
 	sodium/randombytes.h \
-	sodium/randombytes_salsa20_random.h \
+	sodium/randombytes_internal_random.h \
 	sodium/randombytes_sysrandom.h \
 	sodium/runtime.h \
 	sodium/utils.h
 
-if NATIVECLIENT
-SODIUM_EXPORT += \
-	sodium/randombytes_nativeclient.h
-endif
-
 EXTRA_SRC = $(SODIUM_EXPORT) \
 	sodium/version.h.in
 
diff --git a/src/libsodium/include/sodium.h b/src/libsodium/include/sodium.h
index e7b1af46f0f2eccab6a4b3962f6d34c88502cfa3..295f911cff395aa697b4e3dbccb62dcaf2cfe0cf 100644
--- a/src/libsodium/include/sodium.h
+++ b/src/libsodium/include/sodium.h
@@ -48,10 +48,7 @@
 #include "sodium/crypto_verify_32.h"
 #include "sodium/crypto_verify_64.h"
 #include "sodium/randombytes.h"
-#ifdef __native_client__
-# include "sodium/randombytes_nativeclient.h"
-#endif
-#include "sodium/randombytes_salsa20_random.h"
+#include "sodium/randombytes_internal_random.h"
 #include "sodium/randombytes_sysrandom.h"
 #include "sodium/runtime.h"
 #include "sodium/utils.h"
@@ -59,7 +56,9 @@
 #ifndef SODIUM_LIBRARY_MINIMAL
 # include "sodium/crypto_box_curve25519xchacha20poly1305.h"
 # include "sodium/crypto_core_ed25519.h"
+# include "sodium/crypto_core_ristretto255.h"
 # include "sodium/crypto_scalarmult_ed25519.h"
+# include "sodium/crypto_scalarmult_ristretto255.h"
 # include "sodium/crypto_secretbox_xchacha20poly1305.h"
 # include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
 # include "sodium/crypto_stream_salsa2012.h"
diff --git a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h
index 2d31a975042ca154f62b86ff7962ff126ac28133..9baeb3f19f701c059c576267753adf0a78bfb920 100644
--- a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h
+++ b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h
@@ -56,7 +56,7 @@ size_t crypto_aead_aes256gcm_abytes(void);
 SODIUM_EXPORT
 size_t crypto_aead_aes256gcm_messagebytes_max(void);
 
-typedef CRYPTO_ALIGN(16) struct crypto_aead_aes256gcm_state_ {
+typedef struct CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state_ {
     unsigned char opaque[512];
 } crypto_aead_aes256gcm_state;
 
diff --git a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h
index a13b2247f30a7dd86056c04217628aa1926f606d..6643b0cbf5091d0ed173a6ad546bda913acf9f26 100644
--- a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h
+++ b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h
@@ -79,7 +79,7 @@ int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m,
                                                         unsigned long long adlen,
                                                         const unsigned char *npub,
                                                         const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 9, 9)));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9)));
 
 SODIUM_EXPORT
 void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
diff --git a/src/libsodium/include/sodium/crypto_auth.h b/src/libsodium/include/sodium/crypto_auth.h
index d0fc8ee268808d4be8e9c25fed2b8924d14b2429..540aee0e8d7f5a61c20451b9fc288b7f0fc85b31 100644
--- a/src/libsodium/include/sodium/crypto_auth.h
+++ b/src/libsodium/include/sodium/crypto_auth.h
@@ -28,12 +28,12 @@ const char *crypto_auth_primitive(void);
 SODIUM_EXPORT
 int crypto_auth(unsigned char *out, const unsigned char *in,
                 unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
                        unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES])
diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h
index aa4ecfd8fdebb26192eced531077f834689ece39..3da864c7d27051531391281e7ad460839354c1c5 100644
--- a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h
+++ b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h
@@ -24,14 +24,14 @@ SODIUM_EXPORT
 int crypto_auth_hmacsha256(unsigned char *out,
                            const unsigned char *in,
                            unsigned long long inlen,
-                           const unsigned char *k) __attribute__ ((nonnull));
+                           const unsigned char *k) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha256_verify(const unsigned char *h,
                                   const unsigned char *in,
                                   unsigned long long inlen,
                                   const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 /* ------------------------------------------------------------------------- */
 
@@ -52,7 +52,7 @@ SODIUM_EXPORT
 int crypto_auth_hmacsha256_update(crypto_auth_hmacsha256_state *state,
                                   const unsigned char *in,
                                   unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state,
diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h
index c5012583d273bc4f6a33b9d3e310671ef8ffe35f..d992cb8163d692cbd332546d0e2d67748e771de0 100644
--- a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h
+++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h
@@ -24,14 +24,14 @@ SODIUM_EXPORT
 int crypto_auth_hmacsha512(unsigned char *out,
                            const unsigned char *in,
                            unsigned long long inlen,
-                           const unsigned char *k) __attribute__ ((nonnull));
+                           const unsigned char *k) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha512_verify(const unsigned char *h,
                                   const unsigned char *in,
                                   unsigned long long inlen,
                                   const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 /* ------------------------------------------------------------------------- */
 
@@ -51,7 +51,7 @@ int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
 SODIUM_EXPORT
 int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
                                   const unsigned char *in,
-                                  unsigned long long inlen) __attribute__ ((nonnull));
+                                  unsigned long long inlen) __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h
index 0f2661041ab5bfc24b9d844de826e707bd1915e2..3fb526389246206dfaf5855967e69b267dfa8d94 100644
--- a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h
+++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h
@@ -21,15 +21,17 @@ SODIUM_EXPORT
 size_t crypto_auth_hmacsha512256_keybytes(void);
 
 SODIUM_EXPORT
-int crypto_auth_hmacsha512256(unsigned char *out, const unsigned char *in,
-                              unsigned long long inlen,const unsigned char *k);
+int crypto_auth_hmacsha512256(unsigned char *out,
+                              const unsigned char *in,
+                              unsigned long long inlen,
+                              const unsigned char *k) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha512256_verify(const unsigned char *h,
                                      const unsigned char *in,
                                      unsigned long long inlen,
                                      const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 /* ------------------------------------------------------------------------- */
 
@@ -46,7 +48,7 @@ int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state,
 SODIUM_EXPORT
 int crypto_auth_hmacsha512256_update(crypto_auth_hmacsha512256_state *state,
                                      const unsigned char *in,
-                                     unsigned long long inlen) __attribute__ ((nonnull));
+                                     unsigned long long inlen) __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state,
diff --git a/src/libsodium/include/sodium/crypto_box.h b/src/libsodium/include/sodium/crypto_box.h
index f6fe3ccbfdcde1f3475ec367323cd29d4f378503..e060dd29fc4bbccb0cb5c79771f1a9c4e4e654e4 100644
--- a/src/libsodium/include/sodium/crypto_box.h
+++ b/src/libsodium/include/sodium/crypto_box.h
@@ -61,7 +61,7 @@ SODIUM_EXPORT
 int crypto_box_easy(unsigned char *c, const unsigned char *m,
                     unsigned long long mlen, const unsigned char *n,
                     const unsigned char *pk, const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
@@ -74,7 +74,7 @@ int crypto_box_detached(unsigned char *c, unsigned char *mac,
                         const unsigned char *m, unsigned long long mlen,
                         const unsigned char *n, const unsigned char *pk,
                         const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 2, 5, 6, 7)));
 
 SODIUM_EXPORT
 int crypto_box_open_detached(unsigned char *m, const unsigned char *c,
@@ -99,7 +99,7 @@ int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
 SODIUM_EXPORT
 int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
                             unsigned long long mlen, const unsigned char *n,
-                            const unsigned char *k) __attribute__ ((nonnull));
+                            const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c,
@@ -111,7 +111,7 @@ SODIUM_EXPORT
 int crypto_box_detached_afternm(unsigned char *c, unsigned char *mac,
                                 const unsigned char *m, unsigned long long mlen,
                                 const unsigned char *n, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 2, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_open_detached_afternm(unsigned char *m, const unsigned char *c,
@@ -129,7 +129,7 @@ size_t crypto_box_sealbytes(void);
 SODIUM_EXPORT
 int crypto_box_seal(unsigned char *c, const unsigned char *m,
                     unsigned long long mlen, const unsigned char *pk)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_box_seal_open(unsigned char *m, const unsigned char *c,
@@ -151,7 +151,7 @@ SODIUM_EXPORT
 int crypto_box(unsigned char *c, const unsigned char *m,
                unsigned long long mlen, const unsigned char *n,
                const unsigned char *pk, const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_open(unsigned char *m, const unsigned char *c,
@@ -162,7 +162,7 @@ int crypto_box_open(unsigned char *m, const unsigned char *c,
 SODIUM_EXPORT
 int crypto_box_afternm(unsigned char *c, const unsigned char *m,
                        unsigned long long mlen, const unsigned char *n,
-                       const unsigned char *k) __attribute__ ((nonnull));
+                       const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h
index 0d3937a7d805039515837b2bbe02fca2b8bb3025..26a3d31efa93bc34fa62526e53f42a88696d792e 100644
--- a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h
+++ b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h
@@ -60,7 +60,7 @@ int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c,
                                                 const unsigned char *n,
                                                 const unsigned char *pk,
                                                 const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m,
@@ -79,7 +79,7 @@ int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c,
                                                     const unsigned char *n,
                                                     const unsigned char *pk,
                                                     const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 2, 5, 6, 7)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m,
@@ -105,7 +105,7 @@ int crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c,
                                                         unsigned long long mlen,
                                                         const unsigned char *n,
                                                         const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m,
@@ -122,7 +122,7 @@ int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c,
                                                             unsigned long long mlen,
                                                             const unsigned char *n,
                                                             const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 2, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *m,
@@ -147,7 +147,7 @@ int crypto_box_curve25519xchacha20poly1305_seal(unsigned char *c,
                                                 const unsigned char *m,
                                                 unsigned long long mlen,
                                                 const unsigned char *pk)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xchacha20poly1305_seal_open(unsigned char *m,
diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
index f889430c5b32da6968be703d396ab6e97108b576..e733f49995b4a27c8f9bf304e5001cb722b0fc42 100644
--- a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
+++ b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
@@ -78,7 +78,7 @@ int crypto_box_curve25519xsalsa20poly1305(unsigned char *c,
                                           const unsigned char *n,
                                           const unsigned char *pk,
                                           const unsigned char *sk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
@@ -95,7 +95,7 @@ int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
                                                   unsigned long long mlen,
                                                   const unsigned char *n,
                                                   const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m,
diff --git a/src/libsodium/include/sodium/crypto_core_ed25519.h b/src/libsodium/include/sodium/crypto_core_ed25519.h
index eb736ffbf9ae7cb782254c2849bc708a122a2f5b..3eae00c456214a6d7c6efdcd28a19eadea8dacd4 100644
--- a/src/libsodium/include/sodium/crypto_core_ed25519.h
+++ b/src/libsodium/include/sodium/crypto_core_ed25519.h
@@ -16,6 +16,10 @@ size_t crypto_core_ed25519_bytes(void);
 SODIUM_EXPORT
 size_t crypto_core_ed25519_uniformbytes(void);
 
+#define crypto_core_ed25519_HASHBYTES 64
+SODIUM_EXPORT
+size_t crypto_core_ed25519_hashbytes(void);
+
 #define crypto_core_ed25519_SCALARBYTES 32
 SODIUM_EXPORT
 size_t crypto_core_ed25519_scalarbytes(void);
@@ -42,6 +46,14 @@ SODIUM_EXPORT
 int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
             __attribute__ ((nonnull));
 
+SODIUM_EXPORT
+int crypto_core_ed25519_from_hash(unsigned char *p, const unsigned char *h)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ed25519_random(unsigned char *p)
+            __attribute__ ((nonnull));
+
 SODIUM_EXPORT
 void crypto_core_ed25519_scalar_random(unsigned char *r)
             __attribute__ ((nonnull));
@@ -68,6 +80,11 @@ void crypto_core_ed25519_scalar_sub(unsigned char *z, const unsigned char *x,
                                     const unsigned char *y)
             __attribute__ ((nonnull));
 
+SODIUM_EXPORT
+void crypto_core_ed25519_scalar_mul(unsigned char *z, const unsigned char *x,
+                                    const unsigned char *y)
+            __attribute__ ((nonnull));
+
 /*
  * The interval `s` is sampled from should be at least 317 bits to ensure almost
  * uniformity of `r` over `L`.
diff --git a/src/libsodium/include/sodium/crypto_core_ristretto255.h b/src/libsodium/include/sodium/crypto_core_ristretto255.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2820e5576e1504c4179204b6255f9869b1994be
--- /dev/null
+++ b/src/libsodium/include/sodium/crypto_core_ristretto255.h
@@ -0,0 +1,100 @@
+#ifndef crypto_core_ristretto255_H
+#define crypto_core_ristretto255_H
+
+#include <stddef.h>
+#include "export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define crypto_core_ristretto255_BYTES 32
+SODIUM_EXPORT
+size_t crypto_core_ristretto255_bytes(void);
+
+#define crypto_core_ristretto255_HASHBYTES 64
+SODIUM_EXPORT
+size_t crypto_core_ristretto255_hashbytes(void);
+
+#define crypto_core_ristretto255_SCALARBYTES 32
+SODIUM_EXPORT
+size_t crypto_core_ristretto255_scalarbytes(void);
+
+#define crypto_core_ristretto255_NONREDUCEDSCALARBYTES 64
+SODIUM_EXPORT
+size_t crypto_core_ristretto255_nonreducedscalarbytes(void);
+
+SODIUM_EXPORT
+int crypto_core_ristretto255_is_valid_point(const unsigned char *p)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+int crypto_core_ristretto255_add(unsigned char *r,
+                                 const unsigned char *p, const unsigned char *q)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+int crypto_core_ristretto255_sub(unsigned char *r,
+                                 const unsigned char *p, const unsigned char *q)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+int crypto_core_ristretto255_from_hash(unsigned char *p,
+                                       const unsigned char *r)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_random(unsigned char *p)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_random(unsigned char *r)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+int crypto_core_ristretto255_scalar_invert(unsigned char *recip,
+                                           const unsigned char *s)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_negate(unsigned char *neg,
+                                            const unsigned char *s)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_complement(unsigned char *comp,
+                                                const unsigned char *s)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_add(unsigned char *z,
+                                         const unsigned char *x,
+                                         const unsigned char *y)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_sub(unsigned char *z,
+                                         const unsigned char *x,
+                                         const unsigned char *y)
+            __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_mul(unsigned char *z,
+                                         const unsigned char *x,
+                                         const unsigned char *y)
+            __attribute__ ((nonnull));
+
+/*
+ * The interval `s` is sampled from should be at least 317 bits to ensure almost
+ * uniformity of `r` over `L`.
+ */
+SODIUM_EXPORT
+void crypto_core_ristretto255_scalar_reduce(unsigned char *r,
+                                            const unsigned char *s)
+            __attribute__ ((nonnull));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libsodium/include/sodium/crypto_generichash.h b/src/libsodium/include/sodium/crypto_generichash.h
index a5f313d7b6aba97a09fe46b1cd6a0bed3a70febf..d897e5d26c57815f8b2aa196909c47bfdffce537 100644
--- a/src/libsodium/include/sodium/crypto_generichash.h
+++ b/src/libsodium/include/sodium/crypto_generichash.h
@@ -66,7 +66,7 @@ SODIUM_EXPORT
 int crypto_generichash_update(crypto_generichash_state *state,
                               const unsigned char *in,
                               unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_generichash_final(crypto_generichash_state *state,
diff --git a/src/libsodium/include/sodium/crypto_generichash_blake2b.h b/src/libsodium/include/sodium/crypto_generichash_blake2b.h
index ecda362511321233824c42446c6902d6735d4b5b..fee9d8ad196fb8b7b12160499b278f9375c9e878 100644
--- a/src/libsodium/include/sodium/crypto_generichash_blake2b.h
+++ b/src/libsodium/include/sodium/crypto_generichash_blake2b.h
@@ -100,7 +100,7 @@ SODIUM_EXPORT
 int crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state,
                                       const unsigned char *in,
                                       unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state,
diff --git a/src/libsodium/include/sodium/crypto_hash.h b/src/libsodium/include/sodium/crypto_hash.h
index 4b16c477d8040871e27bed73b0e39f8808a2aef9..8752f9cafeb85a40706bb77d4a897983b59fa4a3 100644
--- a/src/libsodium/include/sodium/crypto_hash.h
+++ b/src/libsodium/include/sodium/crypto_hash.h
@@ -26,7 +26,7 @@ size_t crypto_hash_bytes(void);
 
 SODIUM_EXPORT
 int crypto_hash(unsigned char *out, const unsigned char *in,
-                unsigned long long inlen) __attribute__ ((nonnull));
+                unsigned long long inlen) __attribute__ ((nonnull(1)));
 
 #define crypto_hash_PRIMITIVE "sha512"
 SODIUM_EXPORT
diff --git a/src/libsodium/include/sodium/crypto_hash_sha256.h b/src/libsodium/include/sodium/crypto_hash_sha256.h
index 306f1e9371c0cdac87b05b5c73b9b05cb0deaa66..b18217e18dfd79d67e797dab5ec43d1763fcefd4 100644
--- a/src/libsodium/include/sodium/crypto_hash_sha256.h
+++ b/src/libsodium/include/sodium/crypto_hash_sha256.h
@@ -36,7 +36,7 @@ size_t crypto_hash_sha256_bytes(void);
 
 SODIUM_EXPORT
 int crypto_hash_sha256(unsigned char *out, const unsigned char *in,
-                       unsigned long long inlen) __attribute__ ((nonnull));
+                       unsigned long long inlen) __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_hash_sha256_init(crypto_hash_sha256_state *state)
@@ -46,7 +46,7 @@ SODIUM_EXPORT
 int crypto_hash_sha256_update(crypto_hash_sha256_state *state,
                               const unsigned char *in,
                               unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_hash_sha256_final(crypto_hash_sha256_state *state,
diff --git a/src/libsodium/include/sodium/crypto_hash_sha512.h b/src/libsodium/include/sodium/crypto_hash_sha512.h
index 7fb830c6359c94d9061f9a5559e3e705035e3a24..8efa7193ad933840725ea8a4b435e4515d3645e6 100644
--- a/src/libsodium/include/sodium/crypto_hash_sha512.h
+++ b/src/libsodium/include/sodium/crypto_hash_sha512.h
@@ -36,7 +36,7 @@ size_t crypto_hash_sha512_bytes(void);
 
 SODIUM_EXPORT
 int crypto_hash_sha512(unsigned char *out, const unsigned char *in,
-                       unsigned long long inlen) __attribute__ ((nonnull));
+                       unsigned long long inlen) __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_hash_sha512_init(crypto_hash_sha512_state *state)
@@ -46,7 +46,7 @@ SODIUM_EXPORT
 int crypto_hash_sha512_update(crypto_hash_sha512_state *state,
                               const unsigned char *in,
                               unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_hash_sha512_final(crypto_hash_sha512_state *state,
diff --git a/src/libsodium/include/sodium/crypto_onetimeauth.h b/src/libsodium/include/sodium/crypto_onetimeauth.h
index 803dbac808f087311ac72cd308eabc41e72e5976..7cd7b07060f7a80d7967c2f40b66d42d6bc35ea4 100644
--- a/src/libsodium/include/sodium/crypto_onetimeauth.h
+++ b/src/libsodium/include/sodium/crypto_onetimeauth.h
@@ -33,12 +33,12 @@ const char *crypto_onetimeauth_primitive(void);
 SODIUM_EXPORT
 int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
                        unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
                               unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
@@ -48,7 +48,7 @@ SODIUM_EXPORT
 int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
                               const unsigned char *in,
                               unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h
index 516f7db3cd70de0b882007457c00dca30c64b617..f3e34d86df4d6bbf19023634a2c930226ce94b9a 100644
--- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h
+++ b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h
@@ -36,14 +36,14 @@ int crypto_onetimeauth_poly1305(unsigned char *out,
                                 const unsigned char *in,
                                 unsigned long long inlen,
                                 const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
                                        const unsigned char *in,
                                        unsigned long long inlen,
                                        const unsigned char *k)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
@@ -54,7 +54,7 @@ SODIUM_EXPORT
 int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
                                        const unsigned char *in,
                                        unsigned long long inlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
diff --git a/src/libsodium/include/sodium/crypto_scalarmult.h b/src/libsodium/include/sodium/crypto_scalarmult.h
index 01a8e3ea3c7036eeacc94eb4e7dd4d6a8ac261d0..1c6858537833282d555da4143be8553c72748970 100644
--- a/src/libsodium/include/sodium/crypto_scalarmult.h
+++ b/src/libsodium/include/sodium/crypto_scalarmult.h
@@ -27,7 +27,7 @@ int crypto_scalarmult_base(unsigned char *q, const unsigned char *n)
             __attribute__ ((nonnull));
 
 /*
- * NOTE: Do not use the result of this function directly.
+ * NOTE: Do not use the result of this function directly for key exchange.
  *
  * Hash the result with the public keys in order to compute a shared
  * secret key: H(q || client_pk || server_pk)
diff --git a/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h b/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h
index e5605cb25a958505721b32500ac222e038c6ac8b..60e9d0c5a40241bb0c8d6f7db692da4ee7943cb8 100644
--- a/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h
+++ b/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h
@@ -18,7 +18,7 @@ SODIUM_EXPORT
 size_t crypto_scalarmult_curve25519_scalarbytes(void);
 
 /*
- * NOTE: Do not use the result of this function directly.
+ * NOTE: Do not use the result of this function directly for key exchange.
  *
  * Hash the result with the public keys in order to compute a shared
  * secret key: H(q || client_pk || server_pk)
diff --git a/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h b/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h
index 1958643cc67ec1aaafa23de7a2d6c5c76669599a..2dfa4d7073f6a88b321d841edac0cc711edc286a 100644
--- a/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h
+++ b/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h
@@ -19,7 +19,7 @@ SODIUM_EXPORT
 size_t crypto_scalarmult_ed25519_scalarbytes(void);
 
 /*
- * NOTE: Do not use the result of this function directly.
+ * NOTE: Do not use the result of this function directly for key exchange.
  *
  * Hash the result with the public keys in order to compute a shared
  * secret key: H(q || client_pk || server_pk)
diff --git a/src/libsodium/include/sodium/crypto_scalarmult_ristretto255.h b/src/libsodium/include/sodium/crypto_scalarmult_ristretto255.h
new file mode 100644
index 0000000000000000000000000000000000000000..40a45ccef02fad07a67374341ff55e9ae963c1a5
--- /dev/null
+++ b/src/libsodium/include/sodium/crypto_scalarmult_ristretto255.h
@@ -0,0 +1,43 @@
+
+#ifndef crypto_scalarmult_ristretto255_H
+#define crypto_scalarmult_ristretto255_H
+
+#include <stddef.h>
+
+#include "export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define crypto_scalarmult_ristretto255_BYTES 32U
+SODIUM_EXPORT
+size_t crypto_scalarmult_ristretto255_bytes(void);
+
+#define crypto_scalarmult_ristretto255_SCALARBYTES 32U
+SODIUM_EXPORT
+size_t crypto_scalarmult_ristretto255_scalarbytes(void);
+
+/*
+ * NOTE: Do not use the result of this function directly for key exchange.
+ *
+ * Hash the result with the public keys in order to compute a shared
+ * secret key: H(q || client_pk || server_pk)
+ *
+ * Or unless this is not an option, use the crypto_kx() API instead.
+ */
+SODIUM_EXPORT
+int crypto_scalarmult_ristretto255(unsigned char *q, const unsigned char *n,
+                                   const unsigned char *p)
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+
+SODIUM_EXPORT
+int crypto_scalarmult_ristretto255_base(unsigned char *q,
+                                        const unsigned char *n)
+            __attribute__ ((nonnull));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libsodium/include/sodium/crypto_secretbox.h b/src/libsodium/include/sodium/crypto_secretbox.h
index eae44877ef60940f0f73a10ab76c5f9f8c331f53..1d3709db128f81048933d84030874f2401344477 100644
--- a/src/libsodium/include/sodium/crypto_secretbox.h
+++ b/src/libsodium/include/sodium/crypto_secretbox.h
@@ -36,7 +36,7 @@ size_t crypto_secretbox_messagebytes_max(void);
 SODIUM_EXPORT
 int crypto_secretbox_easy(unsigned char *c, const unsigned char *m,
                           unsigned long long mlen, const unsigned char *n,
-                          const unsigned char *k) __attribute__ ((nonnull));
+                          const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c,
@@ -50,7 +50,7 @@ int crypto_secretbox_detached(unsigned char *c, unsigned char *mac,
                               unsigned long long mlen,
                               const unsigned char *n,
                               const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 2, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_secretbox_open_detached(unsigned char *m,
@@ -78,7 +78,7 @@ size_t  crypto_secretbox_boxzerobytes(void);
 SODIUM_EXPORT
 int crypto_secretbox(unsigned char *c, const unsigned char *m,
                      unsigned long long mlen, const unsigned char *n,
-                     const unsigned char *k) __attribute__ ((nonnull));
+                     const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_secretbox_open(unsigned char *m, const unsigned char *c,
diff --git a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h
index e7948f2c986503895ef023b7853999a5968fee91..6ec674e31052d38b83fd206b5b0fd0e7300b8d68 100644
--- a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h
+++ b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h
@@ -35,7 +35,7 @@ int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c,
                                             unsigned long long mlen,
                                             const unsigned char *n,
                                             const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m,
@@ -52,7 +52,7 @@ int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c,
                                                 unsigned long long mlen,
                                                 const unsigned char *n,
                                                 const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 2, 5, 6)));
 
 SODIUM_EXPORT
 int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m,
diff --git a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h
index 1c72d6c0cacf33999f01cf8da0d015ce2e453c3f..be0874cbafa56a5bd5b5259be3d48c3395a99ff2 100644
--- a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h
+++ b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h
@@ -36,7 +36,7 @@ int crypto_secretbox_xsalsa20poly1305(unsigned char *c,
                                       unsigned long long mlen,
                                       const unsigned char *n,
                                       const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4, 5)));
 
 SODIUM_EXPORT
 int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m,
diff --git a/src/libsodium/include/sodium/crypto_shorthash.h b/src/libsodium/include/sodium/crypto_shorthash.h
index dc8b248044dbff19478b62380a585d09d6b40951..fecaa88bd80c347f31417e039adf5e852f089e1f 100644
--- a/src/libsodium/include/sodium/crypto_shorthash.h
+++ b/src/libsodium/include/sodium/crypto_shorthash.h
@@ -28,7 +28,7 @@ const char *crypto_shorthash_primitive(void);
 SODIUM_EXPORT
 int crypto_shorthash(unsigned char *out, const unsigned char *in,
                      unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES])
diff --git a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h
index 912e9d8ca97e3a7156bc1ce73ccccd2677ffa643..1e6f72a620e52688bd4eebd1945f8d7cd5fd0a73 100644
--- a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h
+++ b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h
@@ -24,7 +24,7 @@ size_t crypto_shorthash_siphash24_keybytes(void);
 SODIUM_EXPORT
 int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in,
                                unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 
 #ifndef SODIUM_LIBRARY_MINIMAL
 /* -- 128-bit output -- */
@@ -40,7 +40,7 @@ size_t crypto_shorthash_siphashx24_keybytes(void);
 SODIUM_EXPORT
 int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in,
                                 unsigned long long inlen, const unsigned char *k)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 4)));
 #endif
 
 #ifdef __cplusplus
diff --git a/src/libsodium/include/sodium/crypto_sign.h b/src/libsodium/include/sodium/crypto_sign.h
index 3d31ab24ce5cd9efa676b1063aaac1c4d59b0cf3..f5fafb123e01094be95d150113b6e10faba51cdc 100644
--- a/src/libsodium/include/sodium/crypto_sign.h
+++ b/src/libsodium/include/sodium/crypto_sign.h
@@ -61,7 +61,7 @@ int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
 SODIUM_EXPORT
 int crypto_sign(unsigned char *sm, unsigned long long *smlen_p,
                 const unsigned char *m, unsigned long long mlen,
-                const unsigned char *sk) __attribute__ ((nonnull(1, 3, 5)));
+                const unsigned char *sk) __attribute__ ((nonnull(1, 5)));
 
 SODIUM_EXPORT
 int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
@@ -72,14 +72,14 @@ int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
 SODIUM_EXPORT
 int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
                          const unsigned char *m, unsigned long long mlen,
-                         const unsigned char *sk) __attribute__ ((nonnull(1, 3, 5)));
+                         const unsigned char *sk) __attribute__ ((nonnull(1, 5)));
 
 SODIUM_EXPORT
 int crypto_sign_verify_detached(const unsigned char *sig,
                                 const unsigned char *m,
                                 unsigned long long mlen,
                                 const unsigned char *pk)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_sign_init(crypto_sign_state *state);
@@ -87,7 +87,7 @@ int crypto_sign_init(crypto_sign_state *state);
 SODIUM_EXPORT
 int crypto_sign_update(crypto_sign_state *state,
                        const unsigned char *m, unsigned long long mlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig,
diff --git a/src/libsodium/include/sodium/crypto_sign_ed25519.h b/src/libsodium/include/sodium/crypto_sign_ed25519.h
index db978ea27c79c0b6f80b17a3aa5b171187e64e00..0fdac42d3539059f516fd7f52c4ce32012f104d2 100644
--- a/src/libsodium/include/sodium/crypto_sign_ed25519.h
+++ b/src/libsodium/include/sodium/crypto_sign_ed25519.h
@@ -43,7 +43,7 @@ SODIUM_EXPORT
 int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p,
                         const unsigned char *m, unsigned long long mlen,
                         const unsigned char *sk)
-            __attribute__ ((nonnull(1, 3, 5)));
+            __attribute__ ((nonnull(1, 5)));
 
 SODIUM_EXPORT
 int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p,
@@ -57,14 +57,14 @@ int crypto_sign_ed25519_detached(unsigned char *sig,
                                  const unsigned char *m,
                                  unsigned long long mlen,
                                  const unsigned char *sk)
-            __attribute__ ((nonnull(1, 3)));
+            __attribute__ ((nonnull(1, 5)));
 
 SODIUM_EXPORT
 int crypto_sign_ed25519_verify_detached(const unsigned char *sig,
                                         const unsigned char *m,
                                         unsigned long long mlen,
                                         const unsigned char *pk)
-            __attribute__ ((warn_unused_result));
+            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
 
 SODIUM_EXPORT
 int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk)
@@ -102,14 +102,14 @@ SODIUM_EXPORT
 int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state,
                                  const unsigned char *m,
                                  unsigned long long mlen)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state,
                                        unsigned char *sig,
                                        unsigned long long *siglen_p,
                                        const unsigned char *sk)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1, 2, 4)));
 
 SODIUM_EXPORT
 int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state,
diff --git a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h
index e69339a44d9278e1718885270d89a1717ed390ac..eed158aa84549cdfd435ab1ef5d4ee9fb8e41c0c 100644
--- a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h
+++ b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h
@@ -33,7 +33,7 @@ int crypto_sign_edwards25519sha512batch(unsigned char *sm,
                                         const unsigned char *m,
                                         unsigned long long mlen,
                                         const unsigned char *sk)
-            __attribute__ ((deprecated)) __attribute__ ((nonnull(1, 3, 5)));
+            __attribute__ ((deprecated)) __attribute__ ((nonnull(1, 5)));
 
 SODIUM_EXPORT
 int crypto_sign_edwards25519sha512batch_open(unsigned char *m,
diff --git a/src/libsodium/include/sodium/private/common.h b/src/libsodium/include/sodium/private/common.h
index 9a2f7fab0c705da4eb2db2c4eda5c14b148a8fbe..339e725ba477609646a55196093cd004877684c6 100644
--- a/src/libsodium/include/sodium/private/common.h
+++ b/src/libsodium/include/sodium/private/common.h
@@ -1,7 +1,7 @@
 #ifndef common_H
 #define common_H 1
 
-#if !defined(_MSC_VER) && 0
+#if !defined(_MSC_VER) && !defined(DEV_MODE) && 0
 # warning *** This is unstable, untested, development code.
 # warning It might not compile. It might not work as expected.
 # warning It might be totally insecure.
diff --git a/src/libsodium/include/sodium/private/ed25519_ref10.h b/src/libsodium/include/sodium/private/ed25519_ref10.h
index 5af4159152cc7ce3c497e3f11e844be7a6e15a85..3f4c45caf0eb7c4177ca9575b563d198f2bae1e4 100644
--- a/src/libsodium/include/sodium/private/ed25519_ref10.h
+++ b/src/libsodium/include/sodium/private/ed25519_ref10.h
@@ -110,6 +110,18 @@ int ge25519_has_small_order(const unsigned char s[32]);
 
 void ge25519_from_uniform(unsigned char s[32], const unsigned char r[32]);
 
+void ge25519_from_hash(unsigned char s[32], const unsigned char h[64]);
+
+/*
+ Ristretto group
+ */
+
+int ristretto255_frombytes(ge25519_p3 *h, const unsigned char *s);
+
+void ristretto255_p3_tobytes(unsigned char *s, const ge25519_p3 *h);
+
+void ristretto255_from_hash(unsigned char s[32], const unsigned char h[64]);
+
 /*
  The set of scalars is \Z/l
  where l = 2^252 + 27742317777372353535851937790883648493.
@@ -119,6 +131,9 @@ void sc25519_invert(unsigned char recip[32], const unsigned char s[32]);
 
 void sc25519_reduce(unsigned char s[64]);
 
+void sc25519_mul(unsigned char s[32], const unsigned char a[32],
+                 const unsigned char b[32]);
+
 void sc25519_muladd(unsigned char s[32], const unsigned char a[32],
                     const unsigned char b[32], const unsigned char c[32]);
 
diff --git a/src/libsodium/include/sodium/randombytes_internal_random.h b/src/libsodium/include/sodium/randombytes_internal_random.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b2b7d6edc11a2fef58bd731663058fe4cb7855e
--- /dev/null
+++ b/src/libsodium/include/sodium/randombytes_internal_random.h
@@ -0,0 +1,22 @@
+
+#ifndef randombytes_internal_random_H
+#define randombytes_internal_random_H
+
+#include "export.h"
+#include "randombytes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SODIUM_EXPORT
+extern struct randombytes_implementation randombytes_internal_implementation;
+
+/* Backwards compatibility with libsodium < 1.0.18 */
+#define randombytes_salsa20_implementation randombytes_internal_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libsodium/include/sodium/randombytes_nativeclient.h b/src/libsodium/include/sodium/randombytes_nativeclient.h
deleted file mode 100644
index 5158d8c3c33995d7efca1465c0b0770f9682c051..0000000000000000000000000000000000000000
--- a/src/libsodium/include/sodium/randombytes_nativeclient.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#ifndef randombytes_nativeclient_H
-#define randombytes_nativeclient_H
-
-#ifdef __native_client__
-
-# include "export.h"
-# include "randombytes.h"
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-SODIUM_EXPORT
-extern struct randombytes_implementation randombytes_nativeclient_implementation;
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-#endif
diff --git a/src/libsodium/include/sodium/randombytes_salsa20_random.h b/src/libsodium/include/sodium/randombytes_salsa20_random.h
deleted file mode 100644
index 4deae15b6d9b52787fca3a644d69b6c82580b20e..0000000000000000000000000000000000000000
--- a/src/libsodium/include/sodium/randombytes_salsa20_random.h
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#ifndef randombytes_salsa20_random_H
-#define randombytes_salsa20_random_H
-
-#include "export.h"
-#include "randombytes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-SODIUM_EXPORT
-extern struct randombytes_implementation randombytes_salsa20_implementation;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libsodium/include/sodium/utils.h b/src/libsodium/include/sodium/utils.h
index 84feeea6ad0c24b64f968a0005823e9a88f29315..ac8015129191b6b05c0cff55d9e11e99c2d409c3 100644
--- a/src/libsodium/include/sodium/utils.h
+++ b/src/libsodium/include/sodium/utils.h
@@ -19,7 +19,7 @@ extern "C" {
 #endif
 
 SODIUM_EXPORT
-void sodium_memzero(void * const pnt, const size_t len) __attribute__ ((nonnull));
+void sodium_memzero(void * const pnt, const size_t len);
 
 SODIUM_EXPORT
 void sodium_stackzero(const size_t len);
@@ -32,7 +32,7 @@ void sodium_stackzero(const size_t len);
  */
 SODIUM_EXPORT
 int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+            __attribute__ ((warn_unused_result));
 
 /*
  * sodium_compare() returns -1 if b1_ < b2_, 1 if b1_ > b2_ and 0 if b1_ == b2_
@@ -42,8 +42,7 @@ int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len)
  */
 SODIUM_EXPORT
 int sodium_compare(const unsigned char *b1_, const unsigned char *b2_,
-                   size_t len)
-            __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
+                   size_t len) __attribute__ ((warn_unused_result));
 
 SODIUM_EXPORT
 int sodium_is_zero(const unsigned char *n, const size_t nlen);
@@ -52,24 +51,22 @@ SODIUM_EXPORT
 void sodium_increment(unsigned char *n, const size_t nlen);
 
 SODIUM_EXPORT
-void sodium_add(unsigned char *a, const unsigned char *b, const size_t len)
-            __attribute__ ((nonnull));
+void sodium_add(unsigned char *a, const unsigned char *b, const size_t len);
 
 SODIUM_EXPORT
-void sodium_sub(unsigned char *a, const unsigned char *b, const size_t len)
-            __attribute__ ((nonnull));
+void sodium_sub(unsigned char *a, const unsigned char *b, const size_t len);
 
 SODIUM_EXPORT
 char *sodium_bin2hex(char * const hex, const size_t hex_maxlen,
                      const unsigned char * const bin, const size_t bin_len)
-            __attribute__ ((nonnull));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen,
                    const char * const hex, const size_t hex_len,
                    const char * const ignore, size_t * const bin_len,
                    const char ** const hex_end)
-            __attribute__ ((nonnull(1, 3)));
+            __attribute__ ((nonnull(1)));
 
 #define sodium_base64_VARIANT_ORIGINAL            1
 #define sodium_base64_VARIANT_ORIGINAL_NO_PADDING 3
@@ -91,14 +88,14 @@ size_t sodium_base64_encoded_len(const size_t bin_len, const int variant);
 SODIUM_EXPORT
 char *sodium_bin2base64(char * const b64, const size_t b64_maxlen,
                         const unsigned char * const bin, const size_t bin_len,
-                        const int variant) __attribute__ ((nonnull));
+                        const int variant) __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int sodium_base642bin(unsigned char * const bin, const size_t bin_maxlen,
                       const char * const b64, const size_t b64_len,
                       const char * const ignore, size_t * const bin_len,
                       const char ** const b64_end, const int variant)
-            __attribute__ ((nonnull(1, 3)));
+            __attribute__ ((nonnull(1)));
 
 SODIUM_EXPORT
 int sodium_mlock(void * const addr, const size_t len)
diff --git a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c b/src/libsodium/randombytes/internal/randombytes_internal_random.c
similarity index 65%
rename from src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c
rename to src/libsodium/randombytes/internal/randombytes_internal_random.c
index 64c4cec599a492eaf321d15a08a72e71f253af00..f0794f80ac32347bd95e1a21fc3046e7f8bef229 100644
--- a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c
+++ b/src/libsodium/randombytes/internal/randombytes_internal_random.c
@@ -17,21 +17,24 @@
 # include <sys/time.h>
 #endif
 #ifdef __linux__
-# ifdef __dietlibc__
-#  define _LINUX_SOURCE
-#  include <sys/random.h>
+# define _LINUX_SOURCE
+#endif
+#ifdef HAVE_SYS_RANDOM_H
+# include <sys/random.h>
+#endif
+#ifdef __linux__
+# ifdef HAVE_GETRANDOM
 #  define HAVE_LINUX_COMPATIBLE_GETRANDOM
-# else /* __dietlibc__ */
+# else
 #  include <sys/syscall.h>
 #  if defined(SYS_getrandom) && defined(__NR_getrandom)
 #   define getrandom(B, S, F) syscall(SYS_getrandom, (B), (int) (S), (F))
 #   define HAVE_LINUX_COMPATIBLE_GETRANDOM
 #  endif
-# endif /* __dietlibc__ */
+# endif
 #elif defined(__FreeBSD__)
 # include <sys/param.h>
 # if defined(__FreeBSD_version) && __FreeBSD_version >= 1200000
-#  include <sys/random.h>
 #  define HAVE_LINUX_COMPATIBLE_GETRANDOM
 # endif
 #endif
@@ -47,11 +50,11 @@
 #endif
 
 #include "core.h"
-#include "crypto_core_salsa20.h"
-#include "crypto_stream_salsa20.h"
+#include "crypto_core_hchacha20.h"
+#include "crypto_stream_chacha20.h"
 #include "private/common.h"
 #include "randombytes.h"
-#include "randombytes_salsa20_random.h"
+#include "randombytes_internal_random.h"
 #include "runtime.h"
 #include "utils.h"
 
@@ -70,11 +73,14 @@ BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
 # endif
 #endif
 
-#define SALSA20_RANDOM_BLOCK_SIZE crypto_core_salsa20_OUTPUTBYTES
+#define INTERNAL_RANDOM_BLOCK_SIZE crypto_core_hchacha20_OUTPUTBYTES
 
-#if defined(__OpenBSD__) || defined(__CloudABI__)
+#if defined(__OpenBSD__) || defined(__CloudABI__) || defined(__wasi__)
 # define HAVE_SAFE_ARC4RANDOM 1
 #endif
+#if defined(__CloudABI__) || defined(__wasm__)
+# define NONEXISTENT_DEV_RANDOM 1
+#endif
 
 #ifndef SSIZE_MAX
 # define SSIZE_MAX (SIZE_MAX / 2 - 1)
@@ -95,30 +101,31 @@ BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
 # endif
 #endif
 
-typedef struct Salsa20RandomGlobal_ {
+typedef struct InternalRandomGlobal_ {
     int           initialized;
     int           random_data_source_fd;
+    int           getentropy_available;
     int           getrandom_available;
     int           rdrand_available;
 #ifdef HAVE_GETPID
     pid_t         pid;
 #endif
-} Salsa20RandomGlobal;
+} InternalRandomGlobal;
 
-typedef struct Salsa20Random_ {
+typedef struct InternalRandom_ {
     int           initialized;
     size_t        rnd32_outleft;
-    unsigned char key[crypto_stream_salsa20_KEYBYTES];
-    unsigned char rnd32[16U * SALSA20_RANDOM_BLOCK_SIZE];
+    unsigned char key[crypto_stream_chacha20_KEYBYTES];
+    unsigned char rnd32[16U * INTERNAL_RANDOM_BLOCK_SIZE];
     uint64_t      nonce;
-} Salsa20Random;
+} InternalRandom;
 
-static Salsa20RandomGlobal global = {
+static InternalRandomGlobal global = {
     SODIUM_C99(.initialized =) 0,
     SODIUM_C99(.random_data_source_fd =) -1
 };
 
-static TLS Salsa20Random stream = {
+static TLS InternalRandom stream = {
     SODIUM_C99(.initialized =) 0,
     SODIUM_C99(.rnd32_outleft =) (size_t) 0U
 };
@@ -145,14 +152,14 @@ sodium_hrtime(void)
 static uint64_t
 sodium_hrtime(void)
 {
-    struct   timeval tv;
+    struct timeval tv;
 
     if (gettimeofday(&tv, NULL) != 0) {
         sodium_misuse(); /* LCOV_EXCL_LINE */
     }
     return ((uint64_t) tv.tv_sec) * 1000000U + (uint64_t) tv.tv_usec;
 }
-#endif
+#endif /* _WIN32 */
 
 /*
  * Initialize the entropy source
@@ -161,38 +168,85 @@ sodium_hrtime(void)
 #ifdef _WIN32
 
 static void
-randombytes_salsa20_random_init(void)
+randombytes_internal_random_init(void)
 {
     global.rdrand_available = sodium_runtime_has_rdrand();
 }
 
 #else /* _WIN32 */
 
-static ssize_t
-safe_read(const int fd, void * const buf_, size_t size)
+# ifdef HAVE_GETENTROPY
+static int
+_randombytes_getentropy(void * const buf, const size_t size)
+{
+    assert(size <= 256U);
+    if (getentropy(buf, size) != 0) {
+        return -1; /* LCOV_EXCL_LINE */
+    }
+    return 0;
+}
+
+static int
+randombytes_getentropy(void * const buf_, size_t size)
 {
     unsigned char *buf = (unsigned char *) buf_;
-    ssize_t        readnb;
+    size_t         chunk_size = 256U;
 
-    assert(size > (size_t) 0U);
-    assert(size <= SSIZE_MAX);
     do {
-        while ((readnb = read(fd, buf, size)) < (ssize_t) 0 &&
-               (errno == EINTR || errno == EAGAIN)); /* LCOV_EXCL_LINE */
-        if (readnb < (ssize_t) 0) {
-            return readnb; /* LCOV_EXCL_LINE */
+        if (size < chunk_size) {
+            chunk_size = size;
+            assert(chunk_size > (size_t) 0U);
         }
-        if (readnb == (ssize_t) 0) {
-            break; /* LCOV_EXCL_LINE */
+        if (_randombytes_getentropy(buf, chunk_size) != 0) {
+            return -1; /* LCOV_EXCL_LINE */
         }
-        size -= (size_t) readnb;
-        buf += readnb;
-    } while (size > (ssize_t) 0);
+        size -= chunk_size;
+        buf += chunk_size;
+    } while (size > (size_t) 0U);
 
-    return (ssize_t) (buf - (unsigned char *) buf_);
+    return 0;
+}
+
+# elif defined(HAVE_LINUX_COMPATIBLE_GETRANDOM)
+
+static int
+_randombytes_linux_getrandom(void * const buf, const size_t size)
+{
+    int readnb;
+
+    assert(size <= 256U);
+    do {
+        readnb = getrandom(buf, size, 0);
+    } while (readnb < 0 && (errno == EINTR || errno == EAGAIN));
+
+    return (readnb == (int) size) - 1;
+}
+
+static int
+randombytes_linux_getrandom(void * const buf_, size_t size)
+{
+    unsigned char *buf = (unsigned char *) buf_;
+    size_t         chunk_size = 256U;
+
+    do {
+        if (size < chunk_size) {
+            chunk_size = size;
+            assert(chunk_size > (size_t) 0U);
+        }
+        if (_randombytes_linux_getrandom(buf, chunk_size) != 0) {
+            return -1;
+        }
+        size -= chunk_size;
+        buf += chunk_size;
+    } while (size > (size_t) 0U);
+
+    return 0;
 }
+# endif
+
+# ifndef NONEXISTENT_DEV_RANDOM
 
-# ifdef BLOCK_ON_DEV_RANDOM
+#  ifdef BLOCK_ON_DEV_RANDOM
 static int
 randombytes_block_on_dev_random(void)
 {
@@ -217,13 +271,12 @@ randombytes_block_on_dev_random(void)
     }
     return close(fd);
 }
-# endif
+#  endif
 
-# ifndef HAVE_SAFE_ARC4RANDOM
+/* LCOV_EXCL_START */
 static int
-randombytes_salsa20_random_random_dev_open(void)
+randombytes_internal_random_random_dev_open(void)
 {
-/* LCOV_EXCL_START */
     struct stat       st;
     static const char *devices[] = {
 #  ifndef USE_BLOCKING_RANDOM
@@ -257,58 +310,55 @@ randombytes_salsa20_random_random_dev_open(void)
 
     errno = EIO;
     return -1;
-/* LCOV_EXCL_STOP */
-}
-# endif
-
-# ifdef HAVE_LINUX_COMPATIBLE_GETRANDOM
-static int
-_randombytes_linux_getrandom(void * const buf, const size_t size)
-{
-    int readnb;
-
-    assert(size <= 256U);
-    do {
-        readnb = getrandom(buf, size, 0);
-    } while (readnb < 0 && (errno == EINTR || errno == EAGAIN));
-
-    return (readnb == (int) size) - 1;
 }
+/* LCOV_EXCL_STOP */
 
-static int
-randombytes_linux_getrandom(void * const buf_, size_t size)
+static ssize_t
+safe_read(const int fd, void * const buf_, size_t size)
 {
     unsigned char *buf = (unsigned char *) buf_;
-    size_t         chunk_size = 256U;
+    ssize_t        readnb;
 
+    assert(size > (size_t) 0U);
+    assert(size <= SSIZE_MAX);
     do {
-        if (size < chunk_size) {
-            chunk_size = size;
-            assert(chunk_size > (size_t) 0U);
+        while ((readnb = read(fd, buf, size)) < (ssize_t) 0 &&
+               (errno == EINTR || errno == EAGAIN)); /* LCOV_EXCL_LINE */
+        if (readnb < (ssize_t) 0) {
+            return readnb; /* LCOV_EXCL_LINE */
         }
-        if (_randombytes_linux_getrandom(buf, chunk_size) != 0) {
-            return -1;
+        if (readnb == (ssize_t) 0) {
+            break; /* LCOV_EXCL_LINE */
         }
-        size -= chunk_size;
-        buf += chunk_size;
-    } while (size > (size_t) 0U);
+        size -= (size_t) readnb;
+        buf += readnb;
+    } while (size > (ssize_t) 0);
 
-    return 0;
+    return (ssize_t) (buf - (unsigned char *) buf_);
 }
-# endif
+
+# endif /* !NONEXISTENT_DEV_RANDOM */
 
 static void
-randombytes_salsa20_random_init(void)
+randombytes_internal_random_init(void)
 {
     const int errno_save = errno;
 
     global.rdrand_available = sodium_runtime_has_rdrand();
+    global.getentropy_available = 0;
+    global.getrandom_available = 0;
 
-# ifdef HAVE_SAFE_ARC4RANDOM
-    errno = errno_save;
-# else
+# ifdef HAVE_GETENTROPY
+    {
+        unsigned char fodder[16];
 
-#  ifdef HAVE_LINUX_COMPATIBLE_GETRANDOM
+        if (randombytes_getentropy(fodder, sizeof fodder) == 0) {
+            global.getentropy_available = 1;
+            errno = errno_save;
+            return;
+        }
+    }
+# elif defined(HAVE_LINUX_COMPATIBLE_GETRANDOM)
     {
         unsigned char fodder[16];
 
@@ -317,16 +367,22 @@ randombytes_salsa20_random_init(void)
             errno = errno_save;
             return;
         }
-        global.getrandom_available = 0;
     }
-#  endif /* HAVE_LINUX_COMPATIBLE_GETRANDOM */
-
+# endif
+/* LCOV_EXCL_START */
+# if !defined(NONEXISTENT_DEV_RANDOM)
+    assert((global.getentropy_available | global.getrandom_available) == 0);
     if ((global.random_data_source_fd =
-         randombytes_salsa20_random_random_dev_open()) == -1) {
+         randombytes_internal_random_random_dev_open()) == -1) {
         sodium_misuse(); /* LCOV_EXCL_LINE */
     }
     errno = errno_save;
-# endif /* HAVE_SAFE_ARC4RANDOM */
+    return;
+# endif
+/* LCOV_EXCL_STOP */
+# ifndef HAVE_SAFE_ARC4RANDOM
+    sodium_misuse();
+# endif
 }
 
 #endif /* _WIN32 */
@@ -336,14 +392,14 @@ randombytes_salsa20_random_init(void)
  */
 
 static void
-randombytes_salsa20_random_stir(void)
+randombytes_internal_random_stir(void)
 {
     stream.nonce = sodium_hrtime();
     assert(stream.nonce != (uint64_t) 0U);
     memset(stream.rnd32, 0, sizeof stream.rnd32);
     stream.rnd32_outleft = (size_t) 0U;
     if (global.initialized == 0) {
-        randombytes_salsa20_random_init();
+        randombytes_internal_random_init();
         global.initialized = 1;
     }
 #ifdef HAVE_GETPID
@@ -352,24 +408,28 @@ randombytes_salsa20_random_stir(void)
 
 #ifndef _WIN32
 
-# ifdef HAVE_SAFE_ARC4RANDOM
-    arc4random_buf(stream.key, sizeof stream.key);
+# ifdef HAVE_GETENTROPY
+     if (global.getentropy_available != 0) {
+         if (randombytes_getentropy(stream.key, sizeof stream.key) != 0) {
+             sodium_misuse(); /* LCOV_EXCL_LINE */
+         }
+     }
 # elif defined(HAVE_LINUX_COMPATIBLE_GETRANDOM)
-    if (global.getrandom_available != 0) {
-        if (randombytes_linux_getrandom(stream.key, sizeof stream.key) != 0) {
-            sodium_misuse(); /* LCOV_EXCL_LINE */
-        }
-    } else if (global.random_data_source_fd == -1 ||
-               safe_read(global.random_data_source_fd, stream.key,
-                         sizeof stream.key) != (ssize_t) sizeof stream.key) {
-        sodium_misuse(); /* LCOV_EXCL_LINE */
-    }
-# else
+     if (global.getrandom_available != 0) {
+         if (randombytes_linux_getrandom(stream.key, sizeof stream.key) != 0) {
+             sodium_misuse(); /* LCOV_EXCL_LINE */
+         }
+     }
+# elif defined(NONEXISTENT_DEV_RANDOM) && defined(HAVE_SAFE_ARC4RANDOM)
+    arc4random_buf(stream.key, sizeof stream.key);
+# elif !defined(NONEXISTENT_DEV_RANDOM)
     if (global.random_data_source_fd == -1 ||
         safe_read(global.random_data_source_fd, stream.key,
                   sizeof stream.key) != (ssize_t) sizeof stream.key) {
         sodium_misuse(); /* LCOV_EXCL_LINE */
     }
+# else
+    sodium_misuse();
 # endif
 
 #else /* _WIN32 */
@@ -386,17 +446,17 @@ randombytes_salsa20_random_stir(void)
  */
 
 static void
-randombytes_salsa20_random_stir_if_needed(void)
+randombytes_internal_random_stir_if_needed(void)
 {
 #ifdef HAVE_GETPID
     if (stream.initialized == 0) {
-        randombytes_salsa20_random_stir();
+        randombytes_internal_random_stir();
     } else if (global.pid != getpid()) {
         sodium_misuse(); /* LCOV_EXCL_LINE */
     }
 #else
     if (stream.initialized == 0) {
-        randombytes_salsa20_random_stir();
+        randombytes_internal_random_stir();
     }
 #endif
 }
@@ -407,7 +467,7 @@ randombytes_salsa20_random_stir_if_needed(void)
 
 #ifdef _WIN32
 static int
-randombytes_salsa20_random_close(void)
+randombytes_internal_random_close(void)
 {
     int ret = -1;
 
@@ -421,10 +481,21 @@ randombytes_salsa20_random_close(void)
 }
 #else
 static int
-randombytes_salsa20_random_close(void)
+randombytes_internal_random_close(void)
 {
     int ret = -1;
 
+# ifdef HAVE_GETENTROPY
+    if (global.getentropy_available != 0) {
+        ret = 0;
+    }
+# elif defined(HAVE_LINUX_COMPATIBLE_GETRANDOM)
+    if (global.getrandom_available != 0) {
+        ret = 0;
+    }
+# elif !defined(NONEXISTENT_DEV_RANDOM) && defined(HAVE_SAFE_ARC4RANDOM)
+    ret = 0;
+# else
     if (global.random_data_source_fd != -1 &&
         close(global.random_data_source_fd) == 0) {
         global.random_data_source_fd = -1;
@@ -434,15 +505,6 @@ randombytes_salsa20_random_close(void)
 # endif
         ret = 0;
     }
-
-# ifdef HAVE_SAFE_ARC4RANDOM
-    ret = 0;
-# endif
-
-# ifdef HAVE_LINUX_COMPATIBLE_GETRANDOM
-    if (global.getrandom_available != 0) {
-        ret = 0;
-    }
 # endif
 
     sodium_memzero(&stream, sizeof stream);
@@ -456,7 +518,7 @@ randombytes_salsa20_random_close(void)
  */
 
 static void
-randombytes_salsa20_random_xorhwrand(void)
+randombytes_internal_random_xorhwrand(void)
 {
 /* LCOV_EXCL_START */
 #ifdef HAVE_RDRAND
@@ -467,7 +529,7 @@ randombytes_salsa20_random_xorhwrand(void)
     }
     (void) _rdrand32_step(&r);
     * (uint32_t *) (void *)
-        &stream.key[crypto_stream_salsa20_KEYBYTES - 4] ^= (uint32_t) r;
+        &stream.key[crypto_stream_chacha20_KEYBYTES - 4] ^= (uint32_t) r;
 #endif
 /* LCOV_EXCL_STOP */
 }
@@ -477,7 +539,7 @@ randombytes_salsa20_random_xorhwrand(void)
  */
 
 static inline void
-randombytes_salsa20_random_xorkey(const unsigned char * const mix)
+randombytes_internal_random_xorkey(const unsigned char * const mix)
 {
     unsigned char *key = stream.key;
     size_t         i;
@@ -492,29 +554,29 @@ randombytes_salsa20_random_xorkey(const unsigned char * const mix)
  */
 
 static void
-randombytes_salsa20_random_buf(void * const buf, const size_t size)
+randombytes_internal_random_buf(void * const buf, const size_t size)
 {
     size_t i;
     int    ret;
 
-    randombytes_salsa20_random_stir_if_needed();
-    COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES);
+    randombytes_internal_random_stir_if_needed();
+    COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_chacha20_NONCEBYTES);
 #if defined(ULLONG_MAX) && defined(SIZE_MAX)
 # if SIZE_MAX > ULLONG_MAX
     /* coverity[result_independent_of_operands] */
     assert(size <= ULLONG_MAX);
 # endif
 #endif
-    ret = crypto_stream_salsa20((unsigned char *) buf, (unsigned long long) size,
-                                (unsigned char *) &stream.nonce, stream.key);
+    ret = crypto_stream_chacha20((unsigned char *) buf, (unsigned long long) size,
+                                 (unsigned char *) &stream.nonce, stream.key);
     assert(ret == 0);
     for (i = 0U; i < sizeof size; i++) {
         stream.key[i] ^= ((const unsigned char *) (const void *) &size)[i];
     }
-    randombytes_salsa20_random_xorhwrand();
+    randombytes_internal_random_xorhwrand();
     stream.nonce++;
-    crypto_stream_salsa20_xor(stream.key, stream.key, sizeof stream.key,
-                              (unsigned char *) &stream.nonce, stream.key);
+    crypto_stream_chacha20_xor(stream.key, stream.key, sizeof stream.key,
+                               (unsigned char *) &stream.nonce, stream.key);
 }
 
 /*
@@ -524,7 +586,7 @@ randombytes_salsa20_random_buf(void * const buf, const size_t size)
  */
 
 static uint32_t
-randombytes_salsa20_random(void)
+randombytes_internal_random(void)
 {
     uint32_t val;
     int      ret;
@@ -533,16 +595,16 @@ randombytes_salsa20_random(void)
     COMPILER_ASSERT(((sizeof stream.rnd32) - (sizeof stream.key))
                     % sizeof val == (size_t) 0U);
     if (stream.rnd32_outleft <= (size_t) 0U) {
-        randombytes_salsa20_random_stir_if_needed();
-        COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES);
-        ret = crypto_stream_salsa20((unsigned char *) stream.rnd32,
-                                    (unsigned long long) sizeof stream.rnd32,
-                                    (unsigned char *) &stream.nonce,
-                                    stream.key);
+        randombytes_internal_random_stir_if_needed();
+        COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_chacha20_NONCEBYTES);
+        ret = crypto_stream_chacha20((unsigned char *) stream.rnd32,
+                                     (unsigned long long) sizeof stream.rnd32,
+                                     (unsigned char *) &stream.nonce,
+                                     stream.key);
         assert(ret == 0);
         stream.rnd32_outleft = (sizeof stream.rnd32) - (sizeof stream.key);
-        randombytes_salsa20_random_xorhwrand();
-        randombytes_salsa20_random_xorkey(&stream.rnd32[stream.rnd32_outleft]);
+        randombytes_internal_random_xorhwrand();
+        randombytes_internal_random_xorkey(&stream.rnd32[stream.rnd32_outleft]);
         memset(&stream.rnd32[stream.rnd32_outleft], 0, sizeof stream.key);
         stream.nonce++;
     }
@@ -554,16 +616,16 @@ randombytes_salsa20_random(void)
 }
 
 static const char *
-randombytes_salsa20_implementation_name(void)
+randombytes_internal_implementation_name(void)
 {
-    return "salsa20";
+    return "internal";
 }
 
-struct randombytes_implementation randombytes_salsa20_implementation = {
-    SODIUM_C99(.implementation_name =) randombytes_salsa20_implementation_name,
-    SODIUM_C99(.random =) randombytes_salsa20_random,
-    SODIUM_C99(.stir =) randombytes_salsa20_random_stir,
+struct randombytes_implementation randombytes_internal_implementation = {
+    SODIUM_C99(.implementation_name =) randombytes_internal_implementation_name,
+    SODIUM_C99(.random =) randombytes_internal_random,
+    SODIUM_C99(.stir =) randombytes_internal_random_stir,
     SODIUM_C99(.uniform =) NULL,
-    SODIUM_C99(.buf =) randombytes_salsa20_random_buf,
-    SODIUM_C99(.close =) randombytes_salsa20_random_close
+    SODIUM_C99(.buf =) randombytes_internal_random_buf,
+    SODIUM_C99(.close =) randombytes_internal_random_close
 };
diff --git a/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c b/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c
deleted file mode 100644
index 85ffa9b29bbf961bf1f1960a762dd52698329caf..0000000000000000000000000000000000000000
--- a/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c
+++ /dev/null
@@ -1,61 +0,0 @@
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifdef __native_client__
-# include <irt.h>
-
-# include "core.h"
-# include "utils.h"
-# include "randombytes.h"
-# include "randombytes_nativeclient.h"
-
-static void
-randombytes_nativeclient_buf(void * const buf, const size_t size)
-{
-    unsigned char          *buf_ = (unsigned char *) buf;
-    struct nacl_irt_random  rand_intf;
-    size_t                  readnb = (size_t) 0U;
-    size_t                  toread = size;
-
-    if (nacl_interface_query(NACL_IRT_RANDOM_v0_1, &rand_intf,
-                             sizeof rand_intf) != sizeof rand_intf) {
-        sodium_misuse();
-    }
-    while (toread > (size_t) 0U) {
-        if (rand_intf.get_random_bytes(buf_, size, &readnb) != 0 ||
-            readnb > size) {
-            sodium_misuse();
-        }
-        toread -= readnb;
-        buf_ += readnb;
-    }
-}
-
-static uint32_t
-randombytes_nativeclient_random(void)
-{
-    uint32_t r;
-
-    randombytes_nativeclient_buf(&r, sizeof r);
-
-    return r;
-}
-
-static const char *
-randombytes_nativeclient_implementation_name(void)
-{
-    return "nativeclient";
-}
-
-struct randombytes_implementation randombytes_nativeclient_implementation = {
-    SODIUM_C99(.implementation_name =) randombytes_nativeclient_implementation_name,
-    SODIUM_C99(.random =) randombytes_nativeclient_random,
-    SODIUM_C99(.stir =) NULL,
-    SODIUM_C99(.uniform =) NULL,
-    SODIUM_C99(.buf =) randombytes_nativeclient_buf,
-    SODIUM_C99(.close =) NULL
-};
-
-#endif
diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c
index 4c1a536ef2595d925607c5e2851781383d80d6cc..8ac085fc17fcb593657f43fa526ead311a81e961 100644
--- a/src/libsodium/randombytes/randombytes.c
+++ b/src/libsodium/randombytes/randombytes.c
@@ -13,14 +13,11 @@
 #include "core.h"
 #include "crypto_stream_chacha20.h"
 #include "randombytes.h"
-#ifdef RANDOMBYTES_DEFAULT_IMPLEMENTATION
-# include "randombytes_default.h"
-#else
-# ifdef __native_client__
-#  include "randombytes_nativeclient.h"
-# else
-#  include "randombytes_sysrandom.h"
+#ifndef RANDOMBYTES_CUSTOM_IMPLEMENTATION
+# ifdef RANDOMBYTES_DEFAULT_IMPLEMENTATION
+#  include "randombytes_internal.h"
 # endif
+# include "randombytes_sysrandom.h"
 #endif
 #include "private/common.h"
 
@@ -33,11 +30,7 @@ static const randombytes_implementation *implementation;
 # ifdef __EMSCRIPTEN__
 #  define RANDOMBYTES_DEFAULT_IMPLEMENTATION NULL
 # else
-#  ifdef __native_client__
-#   define RANDOMBYTES_DEFAULT_IMPLEMENTATION &randombytes_nativeclient_implementation;
-#  else
-#   define RANDOMBYTES_DEFAULT_IMPLEMENTATION &randombytes_sysrandom_implementation;
-#  endif
+#  define RANDOMBYTES_DEFAULT_IMPLEMENTATION &randombytes_sysrandom_implementation;
 # endif
 #endif
 
diff --git a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c
index 99018f3571a5858575350a6fd2f098812006ccdb..6657e8e65ed712f547d388dea6499c83def6b561 100644
--- a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c
+++ b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c
@@ -8,29 +8,32 @@
 #ifndef _WIN32
 # include <unistd.h>
 #endif
-
 #include <stdlib.h>
+
 #include <sys/types.h>
 #ifndef _WIN32
 # include <sys/stat.h>
 # include <sys/time.h>
 #endif
 #ifdef __linux__
-# ifdef __dietlibc__
-#  define _LINUX_SOURCE
-#  include <sys/random.h>
+# define _LINUX_SOURCE
+#endif
+#ifdef HAVE_SYS_RANDOM_H
+# include <sys/random.h>
+#endif
+#ifdef __linux__
+# ifdef HAVE_GETRANDOM
 #  define HAVE_LINUX_COMPATIBLE_GETRANDOM
-# else /* __dietlibc__ */
+# else
 #  include <sys/syscall.h>
 #  if defined(SYS_getrandom) && defined(__NR_getrandom)
 #   define getrandom(B, S, F) syscall(SYS_getrandom, (B), (int) (S), (F))
 #   define HAVE_LINUX_COMPATIBLE_GETRANDOM
 #  endif
-# endif /* __dietlibc */
+# endif
 #elif defined(__FreeBSD__)
 # include <sys/param.h>
 # if defined(__FreeBSD_version) && __FreeBSD_version >= 1200000
-#  include <sys/random.h>
 #  define HAVE_LINUX_COMPATIBLE_GETRANDOM
 # endif
 #endif
@@ -72,7 +75,7 @@ BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
 # pragma comment(lib, "advapi32.lib")
 #endif
 
-#if defined(__OpenBSD__) || defined(__CloudABI__)
+#if defined(__OpenBSD__) || defined(__CloudABI__) || defined(__wasi__)
 # define HAVE_SAFE_ARC4RANDOM 1
 #endif
 
@@ -105,7 +108,7 @@ randombytes_sysrandom_close(void)
     return 0;
 }
 
-#else /* __OpenBSD__ */
+#else /* HAVE_SAFE_ARC4RANDOM */
 
 typedef struct SysRandom_ {
     int random_data_source_fd;
@@ -375,7 +378,7 @@ randombytes_sysrandom(void)
     return r;
 }
 
-#endif /* __OpenBSD__ */
+#endif /* HAVE_SAFE_ARC4RANDOM */
 
 static const char *
 randombytes_sysrandom_implementation_name(void)
diff --git a/src/libsodium/sodium/core.c b/src/libsodium/sodium/core.c
index f2456fe1c7a3cf586a7bb7685931688c6ebef991..7a6943d19c55e1bfd0b10b8f3093fa5280808e63 100644
--- a/src/libsodium/sodium/core.c
+++ b/src/libsodium/sodium/core.c
@@ -136,7 +136,7 @@ sodium_crit_leave(void)
     return pthread_mutex_unlock(&_sodium_lock);
 }
 
-#elif defined(HAVE_ATOMIC_OPS) && !defined(__EMSCRIPTEN__) && !defined(__native_client__)
+#elif defined(HAVE_ATOMIC_OPS) && !defined(__EMSCRIPTEN__)
 
 static volatile int _sodium_lock;
 
diff --git a/src/libsodium/sodium/runtime.c b/src/libsodium/sodium/runtime.c
index a5a89bcabc8984ab3baed2d62f948f3ced493a00..9dfe54f849dc95e1557b8fc3521077943dec188e 100644
--- a/src/libsodium/sodium/runtime.c
+++ b/src/libsodium/sodium/runtime.c
@@ -203,11 +203,13 @@ _sodium_runtime_intel_cpu_features(CPUFeatures * const cpu_features)
         unsigned int cpu_info7[4];
 
         _cpuid(cpu_info7, 0x00000007);
+        /* LCOV_EXCL_START */
         if ((cpu_info7[1] & CPUID_EBX_AVX512F) == CPUID_EBX_AVX512F &&
             (xcr0 & (XCR0_OPMASK | XCR0_ZMM_HI256 | XCR0_HI16_ZMM))
             == (XCR0_OPMASK | XCR0_ZMM_HI256 | XCR0_HI16_ZMM)) {
             cpu_features->has_avx512f = 1;
         }
+        /* LCOV_EXCL_STOP */
     }
 #endif
 
diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c
index d865eb904ac2ce53bf48791cca6461ed756ba0d8..1fbd3a375bc59814a923691bbc1212d33875b293 100644
--- a/src/libsodium/sodium/utils.c
+++ b/src/libsodium/sodium/utils.c
@@ -100,7 +100,7 @@ _sodium_dummy_symbol_to_prevent_memzero_lto(void *const  pnt,
 /* LCOV_EXCL_STOP */
 
 void
-sodium_memzero(void *const pnt, const size_t len)
+sodium_memzero(void * const pnt, const size_t len)
 {
 #ifdef _WIN32
     SecureZeroMemory(pnt, len);
@@ -113,8 +113,10 @@ sodium_memzero(void *const pnt, const size_t len)
 #elif defined(HAVE_EXPLICIT_MEMSET)
     explicit_memset(pnt, 0, len);
 #elif HAVE_WEAK_SYMBOLS
-    memset(pnt, 0, len);
-    _sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len);
+    if (len > 0U) {
+        memset(pnt, 0, len);
+        _sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len);
+    }
 # ifdef HAVE_INLINE_ASM
     __asm__ __volatile__ ("" : : "r"(pnt) : "memory");
 # endif
@@ -481,10 +483,12 @@ _mprotect_readwrite(void *ptr, size_t size)
 __attribute__((noreturn)) static void
 _out_of_bounds(void)
 {
-# ifdef SIGSEGV
+# ifndef __wasm__
+#  ifdef SIGSEGV
     raise(SIGSEGV);
-# elif defined(SIGKILL)
+#  elif defined(SIGKILL)
     raise(SIGKILL);
+#  endif
 # endif
     abort(); /* not something we want any higher-level API to catch */
 } /* LCOV_EXCL_LINE */
diff --git a/test/constcheck.sh b/test/constcheck.sh
index 4681d358a5f15b92f6c40c878e86d8cb29fca3d8..994c164262158ac4139a64f524345e8683cf18f5 100755
--- a/test/constcheck.sh
+++ b/test/constcheck.sh
@@ -13,6 +13,7 @@ for macro in $(egrep -r '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/includ
 done
 echo "return 0; }" >> "$CT"
 
+CPPFLAGS="${CPPFLAGS} -Wno-deprecated-declarations"
 ${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1
 ./a.out || exit 1
 rm -f a.out "$CT"
diff --git a/test/default/Makefile.am b/test/default/Makefile.am
index 128695903c8153bff4cdc9e39dfcd2479004f321..59f8595c4fe2caf9352350ddf51a335625329f5a 100644
--- a/test/default/Makefile.am
+++ b/test/default/Makefile.am
@@ -1,6 +1,7 @@
 
 EXTRA_DIST = \
 	cmptest.h \
+	wasi-test-wrapper.sh \
 	wintest.bat \
 	pre.js.inc \
 	aead_aes256gcm.exp \
@@ -25,6 +26,7 @@ EXTRA_DIST = \
 	chacha20.exp \
 	codecs.exp \
 	core_ed25519.exp \
+	core_ristretto255.exp \
 	core1.exp \
 	core2.exp \
 	core3.exp \
@@ -53,6 +55,7 @@ EXTRA_DIST = \
 	randombytes.exp \
 	scalarmult.exp \
 	scalarmult_ed25519.exp \
+	scalarmult_ristretto255.exp \
 	scalarmult2.exp \
 	scalarmult5.exp \
 	scalarmult6.exp \
@@ -103,6 +106,7 @@ DISTCLEANFILES = \
 	chacha20.res \
 	codecs.res \
 	core_ed25519.res \
+	core_ristretto255.res \
 	core1.res \
 	core2.res \
 	core3.res \
@@ -131,6 +135,7 @@ DISTCLEANFILES = \
 	randombytes.res \
 	scalarmult.res \
 	scalarmult_ed25519.res \
+	scalarmult_ristretto255.res \
 	scalarmult2.res \
 	scalarmult5.res \
 	scalarmult6.res \
@@ -158,158 +163,6 @@ DISTCLEANFILES = \
 	verify1.res \
 	xchacha20.res
 
-if NATIVECLIENT
-CLEANFILES = \
-	aead_aes256gcm.final \
-	aead_aes256gcm2.final \
-	aead_chacha20poly1305.final \
-	aead_chacha20poly13052.final \
-	aead_xchacha20poly1305.final \
-	auth.final \
-	auth2.final \
-	auth3.final \
-	auth5.final \
-	auth6.final \
-	auth7.final \
-	box.final \
-	box2.final \
-	box7.final \
-	box8.final \
-	box_easy.final \
-	box_easy2.final \
-	box_seal.final \
-	box_seed.final \
-	chacha20.final \
-	codecs.final \
-	core_ed25519.final \
-	core1.final \
-	core2.final \
-	core3.final \
-	core4.final \
-	core5.final \
-	core6.final \
-	ed25519_convert.final \
-	generichash.final \
-	generichash2.final \
-	generichash3.final \
-	hash.final \
-	hash2.final \
-	hash3.final \
-	kdf.final \
-	keygen.final \
-	kx.final \
-	metamorphic.final \
-	misuse.final \
-	onetimeauth.final \
-	onetimeauth2.final \
-	onetimeauth7.final \
-	pwhash_argon2i.final \
-	pwhash_argon2id.final \
-	pwhash_scrypt.final \
-	pwhash_scrypt_ll.final \
-	randombytes.final \
-	scalarmult.final \
-	scalarmult_ed25519.final \
-	scalarmult2.final \
-	scalarmult5.final \
-	scalarmult6.final \
-	scalarmult7.final \
-	scalarmult8.final \
-	secretbox.final \
-	secretbox2.final \
-	secretbox7.final \
-	secretbox8.final \
-	secretbox_easy.final \
-	secretbox_easy2.final \
-	secretstream.final \
-	shorthash.final \
-	sign.final \
-	siphashx24.final \
-	sodium_core.final \
-	sodium_utils.final \
-	sodium_version.final \
-	stream.final \
-	stream2.final \
-	stream3.final \
-	stream4.final \
-	verify1.final \
-	xchacha20.final \
-	aead_aes256gcm.nexe \
-	aead_aes256gcm2.nexe \
-	aead_chacha20poly1305.nexe \
-	aead_chacha20poly13052.nexe \
-	aead_xchacha20poly1305.nexe \
-	auth.nexe \
-	auth2.nexe \
-	auth3.nexe \
-	auth5.nexe \
-	auth6.nexe \
-	auth7.nexe \
-	box.nexe \
-	box2.nexe \
-	box7.nexe \
-	box8.nexe \
-	box_easy.nexe \
-	box_easy2.nexe \
-	box_seal.nexe \
-	box_seed.nexe \
-	chacha20.nexe \
-	codecs.nexe \
-	core_ed25519.nexe \
-	core1.nexe \
-	core2.nexe \
-	core3.nexe \
-	core4.nexe \
-	core5.nexe \
-	core6.nexe \
-	ed25519_convert.nexe \
-	generichash.nexe \
-	generichash2.nexe \
-	generichash3.nexe \
-	hash.nexe \
-	hash2.nexe \
-	hash3.nexe \
-	kdf.nexe \
-	keygen.nexe \
-	kx.nexe \
-	metamorphic.nexe \
-	misuse.nexe \
-	onetimeauth.nexe \
-	onetimeauth2.nexe \
-	onetimeauth7.nexe \
-	pwhash_argon2i.nexe \
-	pwhash_argon2id.nexe \
-	pwhash_scrypt.nexe \
-	pwhash_scrypt_ll.nexe \
-	randombytes.nexe \
-	scalarmult.nexe \
-	scalarmult_ed25519.nexe \
-	scalarmult2.nexe \
-	scalarmult5.nexe \
-	scalarmult6.nexe \
-	scalarmult7.nexe \
-	scalarmult8.nexe \
-	secretbox.nexe \
-	secretbox2.nexe \
-	secretbox7.nexe \
-	secretbox8.nexe \
-	secretbox_easy.nexe \
-	secretbox_easy2.nexe \
-	secretstream.nexe \
-	shorthash.nexe \
-	sign.nexe \
-	siphashx24.nexe \
-	sodium_core.nexe \
-	sodium_utils.nexe \
-	sodium_version.nexe \
-	stream.nexe \
-	stream2.nexe \
-	stream3.nexe \
-	stream4.nexe \
-	verify1.nexe \
-	xchacha20.nexe
-endif
-
 AM_CPPFLAGS = \
 	-DTEST_SRCDIR=\"@srcdir@\" \
 	-I$(top_srcdir)/src/libsodium/include \
@@ -390,12 +243,10 @@ TESTS_TARGETS = \
 	verify1
 
 if !EMSCRIPTEN
-if !NATIVECLIENT
 TESTS_TARGETS += \
 	sodium_utils2 \
 	sodium_utils3
 endif
-endif
 
 check_PROGRAMS = $(TESTS_TARGETS)
 
@@ -470,6 +321,9 @@ codecs_LDADD              = $(TESTS_LDADD)
 core_ed25519_SOURCE       = cmptest.h core_ed25519.c
 core_ed25519_LDADD        = $(TESTS_LDADD)
 
+core_ristretto255_SOURCE  = cmptest.h core_ristretto255.c
+core_ristretto255_LDADD   = $(TESTS_LDADD)
+
 core1_SOURCE              = cmptest.h core1.c
 core1_LDADD               = $(TESTS_LDADD)
 
@@ -551,6 +405,9 @@ scalarmult_LDADD          = $(TESTS_LDADD)
 scalarmult_ed25519_SOURCE = cmptest.h scalarmult_ed25519.c
 scalarmult_ed25519_LDADD  = $(TESTS_LDADD)
 
+scalarmult_ristretto255_SOURCE = cmptest.h scalarmult_ristretto255.c
+scalarmult_ristretto255_LDADD  = $(TESTS_LDADD)
+
 scalarmult2_SOURCE        = cmptest.h scalarmult2.c
 scalarmult2_LDADD         = $(TESTS_LDADD)
 
@@ -632,15 +489,17 @@ xchacha20_LDADD           = $(TESTS_LDADD)
 if !MINIMAL
 TESTS_TARGETS += \
 	core_ed25519 \
+	core_ristretto255 \
 	pwhash_scrypt \
 	pwhash_scrypt_ll \
 	scalarmult_ed25519 \
+	scalarmult_ristretto255 \
 	siphashx24 \
 	xchacha20
 endif
 
-if NATIVECLIENT
-LOG_COMPILER = ./nacl-test-wrapper.sh
+if WASI
+LOG_COMPILER = ./wasi-test-wrapper.sh
 endif
 
 verify: check
diff --git a/test/default/aead_xchacha20poly1305.c b/test/default/aead_xchacha20poly1305.c
index 9c51623a2d66976a20bb67f38cde9f5ca0415d82..12059b6e4fc0bad223c82d8d8187665f4f4886ef 100644
--- a/test/default/aead_xchacha20poly1305.c
+++ b/test/default/aead_xchacha20poly1305.c
@@ -20,7 +20,7 @@ tv(void)
         };
 #undef  MESSAGE
 #define MESSAGE "Ladies and Gentlemen of the class of '99: If I could offer you " \
-"only one tip for the future, sunscreen would be it."
+    "only one tip for the future, sunscreen would be it."
     unsigned char *m = (unsigned char *) sodium_malloc(MLEN);
     static const unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES]
         = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
@@ -64,6 +64,10 @@ tv(void)
         printf("detached ciphertext is bogus\n");
     }
 
+    if (crypto_aead_xchacha20poly1305_ietf_decrypt(NULL, 0, NULL, c, CLEN, ad,
+                                                   ADLEN, nonce, firstkey) != 0) {
+        printf("crypto_aead_xchacha20poly1305_ietf_decrypt() tag-only verification failed\n");
+    }
     if (crypto_aead_xchacha20poly1305_ietf_decrypt(m2, &m2len, NULL, c, CLEN, ad,
                                                    ADLEN, nonce, firstkey) != 0) {
         printf("crypto_aead_xchacha20poly1305_ietf_decrypt() failed\n");
diff --git a/test/default/auth.c b/test/default/auth.c
index 19af20d7dfa2652601f58eb7a515aca77e8a9410..23ac927713aac1d327811346a9c6f9adae5680d3 100644
--- a/test/default/auth.c
+++ b/test/default/auth.c
@@ -14,12 +14,14 @@ static unsigned char key2[] =
 
 static unsigned char a[crypto_auth_BYTES];
 static unsigned char a2[crypto_auth_hmacsha512_BYTES];
+static unsigned char a3[crypto_auth_hmacsha512_BYTES];
 
 int
 main(void)
 {
     crypto_auth_hmacsha512_state st;
     crypto_auth_hmacsha256_state st256;
+    crypto_auth_hmacsha512256_state st512_256;
     size_t                       i;
 
     assert(crypto_auth_hmacsha512_statebytes() ==
@@ -65,6 +67,60 @@ main(void)
             printf("\n");
     }
 
+    /* Empty message tests: HMAC-SHA512 */
+    memset(a2, 0, sizeof a2);
+    crypto_auth_hmacsha512_init(&st, key, sizeof key);
+    crypto_auth_hmacsha512_final(&st, a2);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha512_init(&st, key, sizeof key);
+    crypto_auth_hmacsha512_update(&st, a2, 0U);
+    crypto_auth_hmacsha512_final(&st, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha512_init(&st, key, sizeof key);
+    crypto_auth_hmacsha512_update(&st, guard_page, 0U);
+    crypto_auth_hmacsha512_final(&st, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    /* Empty message tests: HMAC-SHA512-256 */
+    memset(a2, 0, sizeof a2);
+    crypto_auth_hmacsha512256_init(&st512_256, key, sizeof key);
+    crypto_auth_hmacsha512256_final(&st512_256, a2);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha512256_init(&st512_256, key, sizeof key);
+    crypto_auth_hmacsha512256_update(&st512_256, a2, 0U);
+    crypto_auth_hmacsha512256_final(&st512_256, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha512256_init(&st512_256, key, sizeof key);
+    crypto_auth_hmacsha512256_update(&st512_256, guard_page, 0U);
+    crypto_auth_hmacsha512256_final(&st512_256, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    /* Empty message tests: HMAC-SHA256 */
+
+    memset(a2, 0, sizeof a2);
+    crypto_auth_hmacsha256_init(&st256, key, sizeof key);
+    crypto_auth_hmacsha256_final(&st256, a2);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha256_init(&st256, key, sizeof key);
+    crypto_auth_hmacsha256_update(&st256, a2, 0U);
+    crypto_auth_hmacsha256_final(&st256, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    memset(a3, 0, sizeof a3);
+    crypto_auth_hmacsha256_init(&st256, key, sizeof key);
+    crypto_auth_hmacsha256_update(&st256, guard_page, 0U);
+    crypto_auth_hmacsha256_final(&st256, a3);
+    assert(sodium_memcmp(a2, a3, sizeof a2) == 0);
+
+    /* --- */
+
     assert(crypto_auth_bytes() > 0U);
     assert(crypto_auth_keybytes() > 0U);
     assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0);
diff --git a/test/default/auth3.c b/test/default/auth3.c
index ac686a1ec3924706c924f571363e6c5ba9e4118b..ca90aa7b5a1336f751513f6402ebade1fdc88c90 100644
--- a/test/default/auth3.c
+++ b/test/default/auth3.c
@@ -25,7 +25,12 @@ static unsigned char a[32] = { 0x37, 0x2e, 0xfc, 0xf9, 0xb4, 0x0b, 0x35, 0xc2,
 int
 main(void)
 {
+    static unsigned char a2[crypto_auth_hmacsha256_BYTES];
+
     printf("%d\n", crypto_auth_hmacsha256_verify(a, c, sizeof c, key));
 
+    crypto_auth_hmacsha256(a2, guard_page, 0U, key);
+    assert(crypto_auth_hmacsha256_verify(a2, guard_page, 0U, key) == 0);
+
     return 0;
 }
diff --git a/test/default/auth5.c b/test/default/auth5.c
index 449314fe788fd418f91121d0b4332fbdde20e6aa..955c9cfbb537ca3e4c813fcd403731c8bd53401b 100644
--- a/test/default/auth5.c
+++ b/test/default/auth5.c
@@ -32,5 +32,10 @@ main(void)
             }
         }
     }
+
+    crypto_auth_keygen(key);
+    crypto_auth(a, guard_page, 0U, key);
+    assert(crypto_auth_verify(a, guard_page, 0U, key) == 0);
+
     return 0;
 }
diff --git a/test/default/auth7.c b/test/default/auth7.c
index f6a8bfaa6422c1aa61ade2f5ba8f3ba9fe6d11de..3d087f8eaa2babc0f64d4a5e039383ba3aeadc17 100644
--- a/test/default/auth7.c
+++ b/test/default/auth7.c
@@ -32,5 +32,10 @@ main(void)
             }
         }
     }
+
+    crypto_auth_keygen(key);
+    crypto_auth_hmacsha512(a, guard_page, 0U, key);
+    assert(crypto_auth_hmacsha512_verify(a, guard_page, 0U, key) == 0);
+
     return 0;
 }
diff --git a/test/default/box_easy.c b/test/default/box_easy.c
index 9a336d3f1a3bd02f07afe0eec5e47a55d62e25f0..2e6a20f98ba4c394c6979d5632b64a85fbf37dc3 100644
--- a/test/default/box_easy.c
+++ b/test/default/box_easy.c
@@ -50,12 +50,13 @@ main(void)
 
     /* Null message */
 
-    ret = crypto_box_easy(c, c, 0, nonce, bobpk, alicesk);
+    ret = crypto_box_easy(c, guard_page, 0, nonce, bobpk, alicesk);
     assert(ret == 0);
     for (i = 0; i < 1 + crypto_box_MACBYTES; ++i) {
         printf(",0x%02x", (unsigned int) c[i]);
     }
     printf("\n");
+
     ret =
         crypto_box_open_easy(c, c, crypto_box_MACBYTES, nonce, bobpk, alicesk);
     assert(ret == 0);
diff --git a/test/default/box_seal.c b/test/default/box_seal.c
index f9c970bca31e44aadaf1e18011beb0cc8272993f..01765ca8bcf785359b7639b8da94a490097a16bd 100644
--- a/test/default/box_seal.c
+++ b/test/default/box_seal.c
@@ -2,8 +2,8 @@
 #define TEST_NAME "box_seal"
 #include "cmptest.h"
 
-int
-main(void)
+static
+void tv1(void)
 {
     unsigned char  pk[crypto_box_PUBLICKEYBYTES];
     unsigned char  sk[crypto_box_SECRETKEYBYTES];
@@ -22,11 +22,11 @@ main(void)
     randombytes_buf(m, m_len);
     if (crypto_box_seal(c, m, m_len, pk) != 0) {
         printf("crypto_box_seal() failure\n");
-        return 1;
+        return;
     }
     if (crypto_box_seal_open(m2, c, c_len, pk, sk) != 0) {
         printf("crypto_box_seal_open() failure\n");
-        return 1;
+        return;
     }
     printf("%d\n", memcmp(m, m2, m_len));
 
@@ -39,6 +39,63 @@ main(void)
     sodium_free(m2);
 
     assert(crypto_box_sealbytes() == crypto_box_SEALBYTES);
+}
+
+#ifndef SODIUM_LIBRARY_MINIMAL
+static
+void tv2(void)
+{
+    unsigned char  pk[crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES];
+    unsigned char  sk[crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES];
+    unsigned char *c;
+    unsigned char *m;
+    unsigned char *m2;
+    size_t         m_len;
+    size_t         c_len;
+
+    crypto_box_curve25519xchacha20poly1305_keypair(pk, sk);
+    m_len = (size_t) randombytes_uniform(1000);
+    c_len = crypto_box_curve25519xchacha20poly1305_SEALBYTES + m_len;
+    m     = (unsigned char *) sodium_malloc(m_len);
+    m2    = (unsigned char *) sodium_malloc(m_len);
+    c     = (unsigned char *) sodium_malloc(c_len);
+    randombytes_buf(m, m_len);
+    if (crypto_box_curve25519xchacha20poly1305_seal(c, m, m_len, pk) != 0) {
+        printf("crypto_box_curve25519xchacha20poly1305_seal() failure\n");
+        return;
+    }
+    if (crypto_box_curve25519xchacha20poly1305_seal_open(m2, c, c_len, pk, sk) != 0) {
+        printf("crypto_box_curve25519xchacha20poly1305_seal_open() failure\n");
+        return;
+    }
+    printf("%d\n", memcmp(m, m2, m_len));
+
+    printf("%d\n", crypto_box_curve25519xchacha20poly1305_seal_open(m, c, 0U, pk, sk));
+    printf("%d\n", crypto_box_curve25519xchacha20poly1305_seal_open(m, c, c_len - 1U, pk, sk));
+    printf("%d\n", crypto_box_curve25519xchacha20poly1305_seal_open(m, c, c_len, sk, pk));
+
+    sodium_free(c);
+    sodium_free(m);
+    sodium_free(m2);
+
+    assert(crypto_box_curve25519xchacha20poly1305_sealbytes() ==
+           crypto_box_curve25519xchacha20poly1305_SEALBYTES);
+}
+
+#else
+
+static
+void tv2(void)
+{
+    printf("0\n-1\n-1\n-1\n");
+}
+#endif
+
+int
+main(void)
+{
+    tv1();
+    tv2();
 
     return 0;
 }
diff --git a/test/default/box_seal.exp b/test/default/box_seal.exp
index 78ea705a848a3dbc2aa3cd04a1d81ed8ce24e7c4..ded7a43cc06c713be16d62e50c2083098d00a6df 100644
--- a/test/default/box_seal.exp
+++ b/test/default/box_seal.exp
@@ -2,3 +2,7 @@
 -1
 -1
 -1
+0
+-1
+-1
+-1
diff --git a/test/default/cmptest.h b/test/default/cmptest.h
index 4625d551133f72f4a3c29e1a856b677287f223f9..1ecc5cd9946877e3d4edafcabc4018c3f6664b44 100644
--- a/test/default/cmptest.h
+++ b/test/default/cmptest.h
@@ -178,11 +178,15 @@ int main(void)
     if (sodium_init() != 0) {
         return 99;
     }
+# if defined(__EMSCRIPTEN__) || defined(__SANITIZE_ADDRESS__)
+    guard_page = _guard_page = NULL;
+#else
     if ((_guard_page = (unsigned char *) sodium_malloc(0)) == NULL) {
         perror("sodium_malloc()");
         return 99;
     }
     guard_page = _guard_page + 1;
+#endif
     if (xmain() != 0) {
         return 99;
     }
diff --git a/test/default/codecs.c b/test/default/codecs.c
index 711b4217e0dfeb32f6804fbcd2caa54210a34f06..726c96bc19114ad31189fbe2df52211b2b35dea3 100644
--- a/test/default/codecs.c
+++ b/test/default/codecs.c
@@ -20,6 +20,11 @@ main(void)
     printf("%s\n",
            sodium_bin2hex(buf3, 33U, (const unsigned char *) "0123456789ABCDEF",
                           16U));
+    printf("bin2hex(..., guard_page, 0):%s\n",
+           sodium_bin2hex(buf3, sizeof buf3, guard_page, 0U));
+    printf("bin2hex(..., \"\", 0):%s\n",
+           sodium_bin2hex(buf3, sizeof buf3, (const unsigned char *) "", 0U));
+
     hex = "Cafe : 6942";
     sodium_hex2bin(buf4, sizeof buf4, hex, strlen(hex), ": ", &bin_len,
                    &hex_end);
@@ -79,6 +84,13 @@ main(void)
         printf("sodium_hex2bin() with an extra character and no end pointer\n");
     }
 
+    assert(sodium_hex2bin(buf4, sizeof buf4, (const char *) guard_page, 0U,
+                          NULL, &bin_len, NULL) == 0);
+    assert(bin_len == 0);
+
+    assert(sodium_hex2bin(buf4, sizeof buf4, "", 0U, NULL, &bin_len, NULL) == 0);
+    assert(bin_len == 0);
+
     printf("%s\n",
            sodium_bin2base64(buf3, 31U, (const unsigned char *) "\xfb\xf0\xf1" "0123456789ABCDEFab",
                              21U, sodium_base64_VARIANT_ORIGINAL));
@@ -201,6 +213,14 @@ main(void)
     assert(sodium_base642bin(buf1, sizeof buf1, "ka*w*=*", (size_t) 7U, "*~", NULL, NULL,
                              sodium_base64_VARIANT_ORIGINAL) == 0);
 
+    assert(sodium_base642bin(buf1, sizeof buf1, (const char *) guard_page, 0U,
+                             NULL, &bin_len, NULL, sodium_base64_VARIANT_ORIGINAL) == 0);
+    assert(bin_len == 0);
+
+    assert(sodium_base642bin(buf1, sizeof buf1, "", 0U, NULL, &bin_len, NULL,
+                             sodium_base64_VARIANT_ORIGINAL) == 0);
+    assert(bin_len == 0);
+
     for (i = 0; i < 1000; i++) {
         assert(sizeof buf1 >= 100);
         bin_len = (size_t) randombytes_uniform(100);
diff --git a/test/default/codecs.exp b/test/default/codecs.exp
index 863091be93b11f6b26f9532e47e35088236c5cff..171834ed92ea9601f5e158a72a6383a3c3ce0479 100644
--- a/test/default/codecs.exp
+++ b/test/default/codecs.exp
@@ -1,4 +1,6 @@
 30313233343536373839414243444546
+bin2hex(..., guard_page, 0):
+bin2hex(..., "", 0):
 4:cafe6942
 dt1: 11
 4:cafe6942
diff --git a/test/default/core_ed25519.c b/test/default/core_ed25519.c
index b6bdfab9940fedcc19bc85fc127116d03659cc7e..e3f39c38c752094be29562079e04306b47a74fd5 100644
--- a/test/default/core_ed25519.c
+++ b/test/default/core_ed25519.c
@@ -44,29 +44,43 @@ add_l64(unsigned char * const S)
 int
 main(void)
 {
-    unsigned char *h;
+    unsigned char *h, *r;
     unsigned char *p, *p2, *p3;
     unsigned char *sc, *sc2, *sc3;
     unsigned char *sc64;
     char          *hex;
     unsigned int   i, j;
 
-    h = (unsigned char *) sodium_malloc(crypto_core_ed25519_UNIFORMBYTES);
+    h = (unsigned char *) sodium_malloc(crypto_core_ed25519_HASHBYTES);
+    r = (unsigned char *) sodium_malloc(crypto_core_ed25519_UNIFORMBYTES);
     p = (unsigned char *) sodium_malloc(crypto_core_ed25519_BYTES);
-    for (i = 0; i < 1000; i++) {
-        randombytes_buf(h, crypto_core_ed25519_UNIFORMBYTES);
-        if (crypto_core_ed25519_from_uniform(p, h) != 0) {
+    for (i = 0; i < 500; i++) {
+        randombytes_buf(r, crypto_core_ed25519_UNIFORMBYTES);
+        if (crypto_core_ed25519_from_uniform(p, r) != 0) {
             printf("crypto_core_ed25519_from_uniform() failed\n");
         }
         if (crypto_core_ed25519_is_valid_point(p) == 0) {
             printf("crypto_core_ed25519_from_uniform() returned an invalid point\n");
         }
+
+        randombytes_buf(h, crypto_core_ed25519_HASHBYTES);
+        if (crypto_core_ed25519_from_hash(p, h) != 0) {
+            printf("crypto_core_ed25519_from_hash() failed\n");
+        }
+        if (crypto_core_ed25519_is_valid_point(p) == 0) {
+            printf("crypto_core_ed25519_from_hash() returned an invalid point\n");
+        }
+
+        crypto_core_ed25519_random(p);
+        if (crypto_core_ed25519_is_valid_point(p) == 0) {
+            printf("crypto_core_ed25519_random() returned an invalid point\n");
+        }
     }
 
     p2 = (unsigned char *) sodium_malloc(crypto_core_ed25519_BYTES);
     p3 = (unsigned char *) sodium_malloc(crypto_core_ed25519_BYTES);
-    randombytes_buf(h, crypto_core_ed25519_UNIFORMBYTES);
-    crypto_core_ed25519_from_uniform(p2, h);
+
+    crypto_core_ed25519_random(p2);
 
     j = 1 + (unsigned int) randombytes_uniform(100);
     memcpy(p3, p, crypto_core_ed25519_BYTES);
@@ -145,9 +159,10 @@ main(void)
     assert(crypto_core_ed25519_sub(p3, non_canonical_invalid_p, p3) == -1);
 
     for (i = 0; i < 1000; i++) {
-        randombytes_buf(h, crypto_core_ed25519_UNIFORMBYTES);
-        crypto_core_ed25519_from_uniform(p, h);
-        crypto_core_ed25519_scalar_random(sc);
+        crypto_core_ed25519_random(p);
+        do {
+            crypto_core_ed25519_scalar_random(sc);
+        } while (sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES));
         if (crypto_scalarmult_ed25519_noclamp(p2, sc, p) != 0) {
             printf("crypto_scalarmult_ed25519_noclamp() failed\n");
         }
@@ -175,8 +190,8 @@ main(void)
         printf("crypto_core_ed25519_scalar_reduce() failed\n");
     }
 
-    randombytes_buf(h, crypto_core_ed25519_UNIFORMBYTES);
-    crypto_core_ed25519_from_uniform(p, h);
+    randombytes_buf(r, crypto_core_ed25519_UNIFORMBYTES);
+    crypto_core_ed25519_from_uniform(p, r);
     memcpy(p2, p, crypto_core_ed25519_BYTES);
     crypto_core_ed25519_scalar_random(sc);
     if (crypto_scalarmult_ed25519_noclamp(p, sc, p) != 0) {
@@ -187,15 +202,14 @@ main(void)
         printf("crypto_scalarmult_ed25519_noclamp() failed (2)\n");
     }
     crypto_core_ed25519_add(p3, p, p2);
-    crypto_core_ed25519_from_uniform(p, h);
+    crypto_core_ed25519_from_uniform(p, r);
     crypto_core_ed25519_sub(p, p, p3);
     assert(p[0] == 0x01);
     for (i = 1; i < crypto_core_ed25519_BYTES; i++) {
         assert(p[i] == 0);
     }
 
-    randombytes_buf(h, crypto_core_ed25519_UNIFORMBYTES);
-    crypto_core_ed25519_from_uniform(p, h);
+    crypto_core_ed25519_random(p);
     memcpy(p2, p, crypto_core_ed25519_BYTES);
     crypto_core_ed25519_scalar_random(sc);
     if (crypto_scalarmult_ed25519_noclamp(p, sc, p) != 0) {
@@ -306,8 +320,8 @@ main(void)
         assert(sodium_is_zero(sc3, crypto_core_ed25519_SCALARBYTES));
     }
 
-    memset(sc, 0x69, crypto_core_ed25519_UNIFORMBYTES);
-    memset(sc2, 0x42, crypto_core_ed25519_UNIFORMBYTES);
+    memset(sc, 0x69, crypto_core_ed25519_SCALARBYTES);
+    memset(sc2, 0x42, crypto_core_ed25519_SCALARBYTES);
     crypto_core_ed25519_scalar_add(sc, sc, sc2);
     crypto_core_ed25519_scalar_add(sc, sc2, sc);
     sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1,
@@ -320,8 +334,8 @@ main(void)
                    sc, crypto_core_ed25519_SCALARBYTES);
     printf("sub1: %s\n", hex);
 
-    memset(sc, 0xcd, crypto_core_ed25519_UNIFORMBYTES);
-    memset(sc2, 0x42, crypto_core_ed25519_UNIFORMBYTES);
+    memset(sc, 0xcd, crypto_core_ed25519_SCALARBYTES);
+    memset(sc2, 0x42, crypto_core_ed25519_SCALARBYTES);
     crypto_core_ed25519_scalar_add(sc, sc, sc2);
     crypto_core_ed25519_scalar_add(sc, sc2, sc);
     sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1,
@@ -334,6 +348,45 @@ main(void)
                    sc, crypto_core_ed25519_SCALARBYTES);
     printf("sub2: %s\n", hex);
 
+    memset(sc, 0x69, crypto_core_ed25519_SCALARBYTES);
+    memset(sc2, 0x42, crypto_core_ed25519_SCALARBYTES);
+    for (i = 0; i < 100; i++) {
+        crypto_core_ed25519_scalar_mul(sc, sc, sc2);
+        crypto_core_ed25519_scalar_mul(sc2, sc, sc2);
+    }
+    sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1,
+                   sc2, crypto_core_ed25519_SCALARBYTES);
+    printf("mul: %s\n", hex);
+    for (i = 0; i < 1000; i++) {
+        crypto_core_ed25519_scalar_random(sc);
+        memset(sc2, 0, crypto_core_ed25519_SCALARBYTES);
+        crypto_core_ed25519_scalar_mul(sc3, sc, sc2);
+        assert(sodium_is_zero(sc3, crypto_core_ed25519_SCALARBYTES));
+
+        sc2[0]++;
+        crypto_core_ed25519_scalar_mul(sc3, sc, sc2);
+        assert(memcmp(sc3, sc, crypto_core_ed25519_SCALARBYTES) == 0);
+
+        sc2[0]++;
+        crypto_core_ed25519_scalar_mul(sc3, sc, sc2);
+        crypto_core_ed25519_scalar_sub(sc3, sc3, sc);
+        crypto_core_ed25519_scalar_sub(sc3, sc3, sc);
+        assert(sodium_is_zero(sc3, crypto_core_ed25519_SCALARBYTES));
+
+        do {
+            crypto_core_ed25519_scalar_random(sc2);
+        } while (sodium_is_zero(sc2, crypto_core_ed25519_SCALARBYTES));
+        crypto_core_ed25519_scalar_mul(sc3, sc, sc2);
+        crypto_core_ed25519_scalar_invert(sc2, sc2);
+        crypto_core_ed25519_scalar_mul(sc3, sc3, sc2);
+        assert(memcmp(sc3, sc, crypto_core_ed25519_SCALARBYTES) == 0);
+
+        sc[31] |= 0x11;
+        memset(sc2, 0, crypto_core_ed25519_SCALARBYTES);
+        sc2[0] = 1;
+        crypto_core_ed25519_scalar_mul(sc3, sc, sc2);
+        assert(memcmp(sc3, sc, crypto_core_ed25519_SCALARBYTES) != 0);
+    }
     sodium_free(hex);
     sodium_free(sc64);
     sodium_free(sc3);
@@ -342,6 +395,7 @@ main(void)
     sodium_free(p3);
     sodium_free(p2);
     sodium_free(p);
+    sodium_free(r);
     sodium_free(h);
 
     assert(crypto_core_ed25519_BYTES == crypto_core_ed25519_bytes());
@@ -350,6 +404,8 @@ main(void)
     assert(crypto_core_ed25519_NONREDUCEDSCALARBYTES >= crypto_core_ed25519_SCALARBYTES);
     assert(crypto_core_ed25519_UNIFORMBYTES == crypto_core_ed25519_uniformbytes());
     assert(crypto_core_ed25519_UNIFORMBYTES >= crypto_core_ed25519_BYTES);
+    assert(crypto_core_ed25519_HASHBYTES == crypto_core_ed25519_hashbytes());
+    assert(crypto_core_ed25519_HASHBYTES >= 2 * crypto_core_ed25519_BYTES);
 
     printf("OK\n");
 
diff --git a/test/default/core_ed25519.exp b/test/default/core_ed25519.exp
index 89fbaa33f5bac1b9cd1bfd433c93c4f8c0b0772d..65295bfa76b698cd1e3c017abd829ab2bf363715 100644
--- a/test/default/core_ed25519.exp
+++ b/test/default/core_ed25519.exp
@@ -14,4 +14,5 @@ add1: f7567cd87c82ec1c355a6304c143bcc9ecedededededededededededededed0d
 sub1: f67c79849de0253ba142949e1db6224b13121212121212121212121212121202
 add2: b02e8581ce62f69922427c23f970f7e951525252525252525252525252525202
 sub2: 3da570db4b001cbeb35a7b7fe588e72aaeadadadadadadadadadadadadadad0d
+mul: 4453ef38408c06677c1b810e4bf8b1991f01c88716fbfa2f075a518b77da400b
 OK
diff --git a/test/default/core_ristretto255.c b/test/default/core_ristretto255.c
new file mode 100644
index 0000000000000000000000000000000000000000..bd67f71d10860d9f01d86f4724a28dbd6749ca85
--- /dev/null
+++ b/test/default/core_ristretto255.c
@@ -0,0 +1,270 @@
+#define TEST_NAME "core_ristretto255"
+#include "cmptest.h"
+
+static void
+tv1(void)
+{
+    static const char *bad_encodings_hex[] = {
+        /* Non-canonical field encodings */
+        "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f",
+        "f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f",
+        "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f",
+
+        /* Negative field elements */
+        "0100000000000000000000000000000000000000000000000000000000000000",
+        "01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f",
+        "ed57ffd8c914fb201471d1c3d245ce3c746fcbe63a3679d51b6a516ebebe0e20",
+        "c34c4e1826e5d403b78e246e88aa051c36ccf0aafebffe137d148a2bf9104562",
+        "c940e5a4404157cfb1628b108db051a8d439e1a421394ec4ebccb9ec92a8ac78",
+        "47cfc5497c53dc8e61c91d17fd626ffb1c49e2bca94eed052281b510b1117a24",
+        "f1c6165d33367351b0da8f6e4511010c68174a03b6581212c71c0e1d026c3c72",
+        "87260f7a2f12495118360f02c26a470f450dadf34a413d21042b43b9d93e1309",
+
+        /* Non-square x^2 */
+        "26948d35ca62e643e26a83177332e6b6afeb9d08e4268b650f1f5bbd8d81d371",
+        "4eac077a713c57b4f4397629a4145982c661f48044dd3f96427d40b147d9742f",
+        "de6a7b00deadc788eb6b6c8d20c0ae96c2f2019078fa604fee5b87d6e989ad7b",
+        "bcab477be20861e01e4a0e295284146a510150d9817763caf1a6f4b422d67042",
+        "2a292df7e32cababbd9de088d1d1abec9fc0440f637ed2fba145094dc14bea08",
+        "f4a9e534fc0d216c44b218fa0c42d99635a0127ee2e53c712f70609649fdff22",
+        "8268436f8c4126196cf64b3c7ddbda90746a378625f9813dd9b8457077256731",
+        "2810e5cbc2cc4d4eece54f61c6f69758e289aa7ab440b3cbeaa21995c2f4232b",
+
+        /* Negative xy value */
+        "3eb858e78f5a7254d8c9731174a94f76755fd3941c0ac93735c07ba14579630e",
+        "a45fdc55c76448c049a1ab33f17023edfb2be3581e9c7aade8a6125215e04220",
+        "d483fe813c6ba647ebbfd3ec41adca1c6130c2beeee9d9bf065c8d151c5f396e",
+        "8a2e1d30050198c65a54483123960ccc38aef6848e1ec8f5f780e8523769ba32",
+        "32888462f8b486c68ad7dd9610be5192bbeaf3b443951ac1a8118419d9fa097b",
+        "227142501b9d4355ccba290404bde41575b037693cef1f438c47f8fbf35d1165",
+        "5c37cc491da847cfeb9281d407efc41e15144c876e0170b499a96a22ed31e01e",
+        "445425117cb8c90edcbc7c1cc0e74f747f2c1efa5630a967c64f287792a48a4b",
+
+        /* s = -1, which causes y = 0 */
+        "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f"
+    };
+    unsigned char *s;
+    size_t         i;
+
+    s = (unsigned char *) sodium_malloc(crypto_core_ristretto255_BYTES);
+    for (i = 0; i < sizeof bad_encodings_hex / sizeof bad_encodings_hex[0]; i++) {
+        sodium_hex2bin(s, crypto_core_ristretto255_BYTES, bad_encodings_hex[i],
+                       crypto_core_ristretto255_BYTES * 2 + 1,
+                       NULL, NULL, NULL);
+        if (crypto_core_ristretto255_is_valid_point(s)) {
+            printf("[%s] was not rejected\n", bad_encodings_hex[i]);
+        }
+    }
+    sodium_free(s);
+};
+
+static void
+tv2(void)
+{
+    static const char *hash_hex[] = {
+        "5d1be09e3d0c82fc538112490e35701979d99e06ca3e2b5b54bffe8b4dc772c1"
+        "4d98b696a1bbfb5ca32c436cc61c16563790306c79eaca7705668b47dffe5bb6",
+
+        "f116b34b8f17ceb56e8732a60d913dd10cce47a6d53bee9204be8b44f6678b27"
+        "0102a56902e2488c46120e9276cfe54638286b9e4b3cdb470b542d46c2068d38",
+
+        "8422e1bbdaab52938b81fd602effb6f89110e1e57208ad12d9ad767e2e25510c"
+        "27140775f9337088b982d83d7fcf0b2fa1edffe51952cbe7365e95c86eaf325c",
+
+        "ac22415129b61427bf464e17baee8db65940c233b98afce8d17c57beeb7876c2"
+        "150d15af1cb1fb824bbd14955f2b57d08d388aab431a391cfc33d5bafb5dbbaf",
+
+        "165d697a1ef3d5cf3c38565beefcf88c0f282b8e7dbd28544c483432f1cec767"
+        "5debea8ebb4e5fe7d6f6e5db15f15587ac4d4d4a1de7191e0c1ca6664abcc413",
+
+        "a836e6c9a9ca9f1e8d486273ad56a78c70cf18f0ce10abb1c7172ddd605d7fd2"
+        "979854f47ae1ccf204a33102095b4200e5befc0465accc263175485f0e17ea5c",
+
+        "2cdc11eaeb95daf01189417cdddbf95952993aa9cb9c640eb5058d09702c7462"
+        "2c9965a697a3b345ec24ee56335b556e677b30e6f90ac77d781064f866a3c982"
+    };
+    unsigned char *s;
+    unsigned char *u;
+    char          *hex;
+    size_t         i;
+
+    s = (unsigned char *) sodium_malloc(crypto_core_ristretto255_BYTES);
+    u = (unsigned char *) sodium_malloc(crypto_core_ristretto255_HASHBYTES);
+    hex = (char *) sodium_malloc(crypto_core_ristretto255_BYTES * 2 + 1);
+    for (i = 0; i < sizeof hash_hex / sizeof hash_hex[0]; i++) {
+        sodium_hex2bin(u, crypto_core_ristretto255_HASHBYTES, hash_hex[i],
+                       crypto_core_ristretto255_HASHBYTES * 2 + 1,
+                       NULL, NULL, NULL);
+        crypto_core_ristretto255_from_hash(s, u);
+        sodium_bin2hex(hex, crypto_core_ristretto255_BYTES * 2 + 1,
+                       s, crypto_core_ristretto255_BYTES);
+        printf("%s\n", hex);
+    }
+    sodium_free(hex);
+    sodium_free(u);
+    sodium_free(s);
+}
+
+static void
+tv3(void)
+{
+    static const unsigned char l[crypto_core_ed25519_BYTES] =
+      { 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
+        0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 };
+
+    unsigned char *r =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+    unsigned char *r_inv =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+    unsigned char *ru =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_HASHBYTES);
+    unsigned char *s =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_BYTES);
+    unsigned char *s_ =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_BYTES);
+    unsigned char *s2 =
+        (unsigned char *) sodium_malloc(crypto_core_ristretto255_BYTES);
+    int            i;
+
+    for (i = 0; i < 1000; i++) {
+        crypto_core_ristretto255_scalar_random(r);
+        if (crypto_scalarmult_ristretto255_base(s, r) != 0 ||
+            crypto_core_ristretto255_is_valid_point(s) != 1) {
+            printf("crypto_scalarmult_ristretto255_base() failed\n");
+        }
+        crypto_core_ristretto255_random(s);
+        if (crypto_core_ristretto255_is_valid_point(s) != 1) {
+            printf("crypto_core_ristretto255_random() failed\n");
+        }
+        if (crypto_scalarmult_ristretto255(s, l, s) == 0) {
+            printf("s*l != inf (1)\n");
+        }
+        randombytes_buf(ru, crypto_core_ristretto255_HASHBYTES);
+        if (crypto_core_ristretto255_from_hash(s, ru) != 0 ||
+            crypto_core_ristretto255_is_valid_point(s) != 1) {
+            printf("crypto_core_ristretto255_from_hash() failed\n");
+        }
+        if (crypto_scalarmult_ristretto255(s2, l, s) == 0) {
+            printf("s*l != inf (2)\n");
+        }
+        if (crypto_scalarmult_ristretto255(s2, r, s) != 0  ||
+            crypto_core_ristretto255_is_valid_point(s2) != 1) {
+            printf("crypto_scalarmult_ristretto255() failed\n");
+        }
+        if (crypto_core_ristretto255_scalar_invert(r_inv, r) != 0) {
+            printf("crypto_core_ristretto255_scalar_invert() failed\n");
+        }
+        if (crypto_scalarmult_ristretto255(s_, r_inv, s2) != 0  ||
+            crypto_core_ristretto255_is_valid_point(s_) != 1) {
+            printf("crypto_scalarmult_ristretto255() failed\n");
+        }
+        if (memcmp(s, s_, crypto_core_ristretto255_BYTES) != 0) {
+            printf("inversion failed\n");
+        }
+        if (crypto_scalarmult_ristretto255(s2, l, s2) == 0) {
+            printf("s*l != inf (3)\n");
+        }
+        if (crypto_core_ristretto255_add(s2, s, s_) != 0) {
+            printf("addition failed");
+        }
+        if (crypto_core_ristretto255_sub(s2, s2, s_) != 0) {
+            printf("substraction failed");
+        }
+        if (crypto_core_ristretto255_is_valid_point(s2) == 0) {
+            printf("invalid point");
+        }
+        if (memcmp(s, s2, crypto_core_ristretto255_BYTES) != 0) {
+            printf("s2 + s - s_ != s\n");
+        }
+        if (crypto_core_ristretto255_sub(s2, s2, s) != 0) {
+            printf("substraction failed");
+        }
+        if (crypto_core_ristretto255_is_valid_point(s2) == -1) {
+            printf("s + s' - s - s' != 0");
+        }
+    }
+
+    crypto_core_ristretto255_random(s);
+    memset(s_, 0xfe, crypto_core_ristretto255_BYTES);
+    assert(crypto_core_ristretto255_add(s2, s_, s) == -1);
+    assert(crypto_core_ristretto255_add(s2, s, s_) == -1);
+    assert(crypto_core_ristretto255_add(s2, s_, s_) == -1);
+    assert(crypto_core_ristretto255_add(s2, s, s) == 0);
+    assert(crypto_core_ristretto255_sub(s2, s_, s) == -1);
+    assert(crypto_core_ristretto255_sub(s2, s, s_) == -1);
+    assert(crypto_core_ristretto255_sub(s2, s_, s_) == -1);
+    assert(crypto_core_ristretto255_sub(s2, s, s) == 0);
+
+    sodium_free(s2);
+    sodium_free(s_);
+    sodium_free(s);
+    sodium_free(ru);
+    sodium_free(r_inv);
+    sodium_free(r);
+}
+
+static void
+tv4(void)
+{
+    unsigned char *r;
+    unsigned char *s1;
+    unsigned char *s2;
+    unsigned char *s3;
+    unsigned char *s4;
+
+    r = (unsigned char *) sodium_malloc(crypto_core_ristretto255_NONREDUCEDSCALARBYTES);
+    s1 = (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+    s2 = (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+    s3 = (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+    s4 = (unsigned char *) sodium_malloc(crypto_core_ristretto255_SCALARBYTES);
+
+    crypto_core_ristretto255_scalar_random(s1);
+    randombytes_buf(r, crypto_core_ristretto255_NONREDUCEDSCALARBYTES);
+    crypto_core_ristretto255_scalar_reduce(s2, r);
+    memcpy(s4, s1, crypto_core_ristretto255_SCALARBYTES);
+    crypto_core_ristretto255_scalar_add(s3, s1, s2);
+    crypto_core_ristretto255_scalar_sub(s4, s1, s2);
+    crypto_core_ristretto255_scalar_add(s2, s3, s4);
+    crypto_core_ristretto255_scalar_sub(s2, s2, s1);
+    crypto_core_ristretto255_scalar_mul(s2, s3, s2);
+    crypto_core_ristretto255_scalar_invert(s4, s3);
+    crypto_core_ristretto255_scalar_mul(s2, s2, s4);
+    crypto_core_ristretto255_scalar_negate(s1, s1);
+    crypto_core_ristretto255_scalar_add(s2, s2, s1);
+    crypto_core_ristretto255_scalar_complement(s1, s2);
+    s1[0]--;
+    assert(sodium_is_zero(s1, crypto_core_ristretto255_SCALARBYTES));
+
+    sodium_free(s1);
+    sodium_free(s2);
+    sodium_free(s3);
+    sodium_free(s4);
+    sodium_free(r);
+}
+
+int
+main(void)
+{
+    tv1();
+    tv2();
+    tv3();
+    tv4();
+
+    assert(crypto_core_ristretto255_BYTES == crypto_core_ristretto255_bytes());
+    assert(crypto_core_ristretto255_SCALARBYTES == crypto_core_ristretto255_scalarbytes());
+    assert(crypto_core_ristretto255_NONREDUCEDSCALARBYTES == crypto_core_ristretto255_nonreducedscalarbytes());
+    assert(crypto_core_ristretto255_NONREDUCEDSCALARBYTES >= crypto_core_ristretto255_SCALARBYTES);
+    assert(crypto_core_ristretto255_HASHBYTES == crypto_core_ristretto255_hashbytes());
+    assert(crypto_core_ristretto255_HASHBYTES >= crypto_core_ristretto255_BYTES);
+    assert(crypto_core_ristretto255_BYTES == crypto_core_ed25519_BYTES);
+    assert(crypto_core_ristretto255_SCALARBYTES == crypto_core_ed25519_SCALARBYTES);
+    assert(crypto_core_ristretto255_NONREDUCEDSCALARBYTES == crypto_core_ed25519_NONREDUCEDSCALARBYTES);
+    assert(crypto_core_ristretto255_HASHBYTES >= 2 * crypto_core_ed25519_UNIFORMBYTES);
+
+    printf("OK\n");
+
+    return 0;
+}
diff --git a/test/default/core_ristretto255.exp b/test/default/core_ristretto255.exp
new file mode 100644
index 0000000000000000000000000000000000000000..8618d892da6018c473a03329d22c18c08b6efdf8
--- /dev/null
+++ b/test/default/core_ristretto255.exp
@@ -0,0 +1,8 @@
+3066f82a1a747d45120d1740f14358531a8f04bbffe6a819f86dfe50f44a0a46
+f26e5b6f7d362d2d2a94c5d0e7602cb4773c95a2e5c31a64f133189fa76ed61b
+006ccd2a9e6867e6a2c5cea83d3302cc9de128dd2a9a57dd8ee7b9d7ffe02826
+f8f0c87cf237953c5890aec3998169005dae3eca1fbb04548c635953c817f92a
+ae81e7dedf20a497e10c304a765c1767a42d6e06029758d2d7e8ef7cc4c41179
+e2705652ff9f5e44d3e841bf1c251cf7dddb77d140870d1ab2ed64f1a9ce8628
+80bd07262511cdde4863f8a7434cef696750681cb9510eea557088f76d9e5065
+OK
diff --git a/test/default/nacl-test-wrapper.sh b/test/default/nacl-test-wrapper.sh
deleted file mode 100755
index 0e4cffa94164538015ca853f3ba3557942397708..0000000000000000000000000000000000000000
--- a/test/default/nacl-test-wrapper.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-
-if [ -z "$NACL_SDK_ROOT" ]; then
-  echo "The following variable needs to be set:
-  \$NACL_SDK_ROOT=$NACL_SDK_ROOT" >&2
-  exit 1
-fi
-
-if [ -z "$PNACL_FINALIZE" -o -z "$PNACL_TRANSLATE" ]; then
-  exe="$1"
-else
-  exe="$1.nexe"
-  if [ ! -f "$exe" ]; then
-    $PNACL_FINALIZE "$1" -o "$1.final"
-    $PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$exe"
-  fi
-fi
-
-command -v command >/dev/null 2>&1 || {
-  echo "command is required, but wasn't found on this system" >&2
-  exit 1
-}
-
-command -v python >/dev/null 2>&1 || {
-  echo "Python not found. Aborting." >&2
-  exit 1
-}
-
-SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
-if [ -z "$SEL_LDR" ]; then
-  echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT" >&2
-  exit 1
-fi
-
-exec python "$SEL_LDR" "$exe"
diff --git a/test/default/pwhash_scrypt.c b/test/default/pwhash_scrypt.c
index 334c2ed3d25a103d7f26736c0f7003c63eafbf65..a0efcd7aab87e93235109feda2cfb5cbd7c15d1a 100644
--- a/test/default/pwhash_scrypt.c
+++ b/test/default/pwhash_scrypt.c
@@ -265,8 +265,6 @@ tv3(void)
           "$7$.6..../.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
         { "test",
           "$7$z6..../.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
-        { "test",
-          "$7$8zzzzz/.....lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
         { "test",
           "$7$8zzzzzzzzzz.lgPchkGHqbeONR/xtuXyjCrt9kUSg6NlKFQO0OSxo/$.DbajbPYH9T7sg3fOtcgxvJzzfIgJBIxMkeQ8b24YQ." },
         { "test",
diff --git a/test/default/pwhash_scrypt.exp b/test/default/pwhash_scrypt.exp
index fa9320d617e59e66296e709d73f6d5b85acf9956..2f98d0e8b69984db6ae54239bdbd910528ef8552 100644
--- a/test/default/pwhash_scrypt.exp
+++ b/test/default/pwhash_scrypt.exp
@@ -34,5 +34,4 @@ pwhash_str failure: [29]
 pwhash_str failure: [30]
 pwhash_str failure: [31]
 pwhash_str failure: [32]
-pwhash_str failure: [33]
 OK
diff --git a/test/default/randombytes.c b/test/default/randombytes.c
index bdc5cca46183b613fc885e1d9ed9f7c41d6bd53b..d08066e8aee10682e8fe5b3ad79b977151fa890a 100644
--- a/test/default/randombytes.c
+++ b/test/default/randombytes.c
@@ -42,8 +42,6 @@ randombytes_tests(void)
 #ifndef BENCHMARKS
 # ifdef __EMSCRIPTEN__
     assert(strcmp(randombytes_implementation_name(), "js") == 0);
-# elif defined(__native_client__)
-    assert(strcmp(randombytes_implementation_name(), "nativeclient") == 0);
 # else
     assert(strcmp(randombytes_implementation_name(), "sysrandom") == 0);
 # endif
@@ -73,8 +71,9 @@ randombytes_tests(void)
     assert(randombytes_uniform(1U) == 0U);
     randombytes_close();
 #ifndef __EMSCRIPTEN__
-    randombytes_set_implementation(&randombytes_salsa20_implementation);
-    assert(strcmp(randombytes_implementation_name(), "salsa20") == 0);
+    assert(&randombytes_internal_implementation == &randombytes_salsa20_implementation);
+    randombytes_set_implementation(&randombytes_internal_implementation);
+    assert(strcmp(randombytes_implementation_name(), "internal") == 0);
 #endif
     randombytes_stir();
     for (i = 0; i < 256; ++i) {
@@ -129,11 +128,7 @@ randombytes_uniform_impl(const uint32_t upper_bound)
 static int
 impl_tests(void)
 {
-#ifndef __native_client__
     randombytes_implementation impl = randombytes_sysrandom_implementation;
-#else
-    randombytes_implementation impl = randombytes_nativeclient_implementation;
-#endif
     uint32_t                   v = randombytes_random();
 
     impl.uniform = randombytes_uniform_impl;
diff --git a/test/default/scalarmult_ed25519.c b/test/default/scalarmult_ed25519.c
index 26d431ae5eac411b7078467138b6715b4391ecf2..795647b5bb521108c70aee6781a5c7288170698d 100644
--- a/test/default/scalarmult_ed25519.c
+++ b/test/default/scalarmult_ed25519.c
@@ -83,6 +83,18 @@ main(void)
     if (memcmp(q, q2, crypto_scalarmult_ed25519_BYTES) == 0) {
         printf("clamping not applied\n");
     }
+
+    n[0] = 9;
+    if (crypto_scalarmult_ed25519_base(q, n) != 0) {
+        printf("crypto_scalarmult_ed25519_base() failed\n");
+    }
+    if (crypto_scalarmult_ed25519_base_noclamp(q2, n) != 0) {
+        printf("crypto_scalarmult_ed25519_base_noclamp() failed\n");
+    }
+    if (memcmp(q, q2, crypto_scalarmult_ed25519_BYTES) == 0) {
+        printf("clamping not applied\n");
+    }
+
     n[0] = 8;
     n[31] = 64;
     if (crypto_scalarmult_ed25519_noclamp(q2, n, p) != 0) {
diff --git a/test/default/scalarmult_ristretto255.c b/test/default/scalarmult_ristretto255.c
new file mode 100644
index 0000000000000000000000000000000000000000..1acd12169f358df9094cc85bd4cb251829c17072
--- /dev/null
+++ b/test/default/scalarmult_ristretto255.c
@@ -0,0 +1,51 @@
+#define TEST_NAME "scalarmult_ristretto255"
+#include "cmptest.h"
+
+#define B_HEX "e2f2ae0a6abc4e71a884a961c500515f58e30b6aa582dd8db6a65945e08d2d76"
+
+int
+main(void)
+{
+    unsigned char *b =
+        (unsigned char *) sodium_malloc(crypto_scalarmult_ristretto255_BYTES);
+    unsigned char *n =
+        (unsigned char *) sodium_malloc(crypto_scalarmult_ristretto255_SCALARBYTES);
+    unsigned char *p =
+        (unsigned char *) sodium_malloc(crypto_scalarmult_ristretto255_BYTES);
+    unsigned char *p2 =
+        (unsigned char *) sodium_malloc(crypto_scalarmult_ristretto255_BYTES);
+    char          *hex =
+        (char *) sodium_malloc(2 * crypto_scalarmult_ristretto255_BYTES + 1);
+    int            i;
+
+    sodium_hex2bin(b, crypto_scalarmult_ristretto255_BYTES,
+                   B_HEX, sizeof B_HEX - (size_t) 1U, NULL, NULL, NULL);
+    memset(n, 0, crypto_scalarmult_ristretto255_SCALARBYTES);
+    for (i = 0; i < 16; i++) {
+        crypto_scalarmult_ristretto255_base(p, n);
+        if (crypto_scalarmult_ristretto255(p2, n, b) != 0) {
+            printf("crypto_scalarmult_ristretto255(%d) != 0\n", i);
+        }
+        sodium_bin2hex(hex, 2 * crypto_scalarmult_ristretto255_BYTES + 1,
+                       p, crypto_scalarmult_ristretto255_BYTES);
+        printf("%s\n", hex);
+        assert(memcmp(p, p2, crypto_scalarmult_ristretto255_BYTES) == 0);
+        sodium_increment(n, crypto_scalarmult_ristretto255_SCALARBYTES);
+    }
+
+    memset(p, 0xfe, crypto_scalarmult_ristretto255_BYTES);
+    assert(crypto_scalarmult_ristretto255(guard_page, n, p) == -1);
+
+    sodium_free(hex);
+    sodium_free(p2);
+    sodium_free(p);
+    sodium_free(n);
+    sodium_free(b);
+
+    assert(crypto_scalarmult_ristretto255_BYTES == crypto_scalarmult_ristretto255_bytes());
+    assert(crypto_scalarmult_ristretto255_SCALARBYTES == crypto_scalarmult_ristretto255_scalarbytes());
+
+    printf("OK\n");
+
+    return 0;
+}
diff --git a/test/default/scalarmult_ristretto255.exp b/test/default/scalarmult_ristretto255.exp
new file mode 100644
index 0000000000000000000000000000000000000000..919a7621b71eb45e63cc4c53e7c6a203e0f62165
--- /dev/null
+++ b/test/default/scalarmult_ristretto255.exp
@@ -0,0 +1,18 @@
+crypto_scalarmult_ristretto255(0) != 0
+0000000000000000000000000000000000000000000000000000000000000000
+e2f2ae0a6abc4e71a884a961c500515f58e30b6aa582dd8db6a65945e08d2d76
+6a493210f7499cd17fecb510ae0cea23a110e8d5b901f8acadd3095c73a3b919
+94741f5d5d52755ece4f23f044ee27d5d1ea1e2bd196b462166b16152a9d0259
+da80862773358b466ffadfe0b3293ab3d9fd53c5ea6c955358f568322daf6a57
+e882b131016b52c1d3337080187cf768423efccbb517bb495ab812c4160ff44e
+f64746d3c92b13050ed8d80236a7f0007c3b3f962f5ba793d19a601ebb1df403
+44f53520926ec81fbd5a387845beb7df85a96a24ece18738bdcfa6a7822a176d
+903293d8f2287ebe10e2374dc1a53e0bc887e592699f02d077d5263cdd55601c
+02622ace8f7303a31cafc63f8fc48fdc16e1c8c8d234b2f0d6685282a9076031
+20706fd788b2720a1ed2a5dad4952b01f413bcf0e7564de8cdc816689e2db95f
+bce83f8ba5dd2fa572864c24ba1810f9522bc6004afe95877ac73241cafdab42
+e4549ee16b9aa03099ca208c67adafcafa4c3f3e4e5303de6026e3ca8ff84460
+aa52e000df2e16f55fb1032fc33bc42742dad6bd5a8fc0be0167436c5948501f
+46376b80f409b29dc2b5f6f0c52591990896e5716f41477cd30085ab7f10301e
+e0c418f7c8d9c4cdd7395b93ea124f3ad99021bb681dfc3302a9d99a2e53e64e
+OK
diff --git a/test/default/sodium_utils.c b/test/default/sodium_utils.c
index 379518fc271079859060a94e1296eb6a916836df..844e16cfbfd747ced665394a945b621922184902 100644
--- a/test/default/sodium_utils.c
+++ b/test/default/sodium_utils.c
@@ -29,6 +29,10 @@ main(void)
     printf("%d\n", sodium_memcmp(buf1, buf2, 0U));
     sodium_memzero(buf2, sizeof buf2 / 2);
     printf("%d\n", sodium_memcmp(buf1, buf2, sizeof buf1));
+    printf("%d\n", sodium_memcmp(buf1, guard_page, 0U));
+    printf("%d\n", sodium_memcmp(guard_page, buf2, 0U));
+    printf("%d\n", sodium_memcmp(guard_page, guard_page, 0U));
+    sodium_memzero(guard_page, 0U);
 
     memset(nonce, 0, sizeof nonce);
     sodium_increment(nonce, sizeof nonce);
@@ -70,6 +74,8 @@ main(void)
                    (unsigned int) bin_len);
         }
     }
+    printf("%d\n", sodium_compare(buf1, NULL, 0U));
+    printf("%d\n", sodium_compare(NULL, buf1, 0U));
     memset(buf1, 0, sizeof buf1);
     if (sodium_is_zero(buf1, sizeof buf1) != 1) {
         printf("sodium_is_zero() failed\n");
@@ -154,6 +160,21 @@ main(void)
     sodium_add(nonce, nonce, 24U);
     printf("%s\n",
            sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce));
+    sodium_add(nonce, nonce, 0U);
+    printf("%s\n",
+           sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce));
+    sodium_add(nonce, guard_page, 0U);
+    printf("%s\n",
+           sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce));
+    sodium_add(guard_page, nonce, 0U);
+
+    sodium_sub(nonce, nonce, 0U);
+    printf("%s\n",
+           sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce));
+    sodium_sub(nonce, guard_page, 0U);
+    printf("%s\n",
+           sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce));
+    sodium_sub(guard_page, nonce, 0U);
 
     randombytes_buf(buf1, 64U);
     randombytes_buf(buf2, 64U);
diff --git a/test/default/sodium_utils.exp b/test/default/sodium_utils.exp
index 84ec7fd54c482daf327a5f54f79dfa2ec93e4392..c97a1db384b1c6f5ce13029db6d09a5faa9ec2b1 100644
--- a/test/default/sodium_utils.exp
+++ b/test/default/sodium_utils.exp
@@ -3,14 +3,23 @@
 -1
 0
 0
+0
+0
+0
 010000000000000000000000000000000000000000000000
 000000000000000000000000000000000000000000000000
 010100000000000000000000000000000000000000000000
 020000000000000000000000000000000000000000000000
 0001ff000000000000000000000000000000000000000000
+0
+0
 000000000000fffefefefefefefefefefefefefefefefefe
 00000000000000000000fffefefefefefefefefefefefefe
 00000000000000000000000000000000000000000000fffe
 fcfffffffffffbfdfefefefefefefefefefefefefefefefe
 fcfffffffffffffffffffbfdfefefefefefefefefefefefe
 fcfffffffffffffffffffffffffffffffffffffffffffbfd
+fcfffffffffffffffffffffffffffffffffffffffffffbfd
+fcfffffffffffffffffffffffffffffffffffffffffffbfd
+fcfffffffffffffffffffffffffffffffffffffffffffbfd
+fcfffffffffffffffffffffffffffffffffffffffffffbfd
diff --git a/test/default/sodium_utils2.c b/test/default/sodium_utils2.c
index 844f5866010c84614ccac582ba2df5128dca5c23..a1801b1ae3df3e3423359c574b1a849812951472 100644
--- a/test/default/sodium_utils2.c
+++ b/test/default/sodium_utils2.c
@@ -23,14 +23,16 @@ segv_handler(int sig)
 
     printf("Intentional segfault / bus error caught\n");
     printf("OK\n");
-#ifdef SIGSEGV
+#ifdef SIG_DFL
+# ifdef SIGSEGV
     signal(SIGSEGV, SIG_DFL);
-#endif
-#ifdef SIGBUS
+# endif
+# ifdef SIGBUS
     signal(SIGBUS, SIG_DFL);
-#endif
-#ifdef SIGABRT
+# endif
+# ifdef SIGABRT
     signal(SIGABRT, SIG_DFL);
+# endif
 #endif
     exit(0);
 }
@@ -70,15 +72,16 @@ main(void)
         sodium_free(buf);
     }
     printf("OK\n");
-
-#ifdef SIGSEGV
+#ifdef SIG_DFL
+# ifdef SIGSEGV
     signal(SIGSEGV, segv_handler);
-#endif
-#ifdef SIGBUS
+# endif
+# ifdef SIGBUS
     signal(SIGBUS, segv_handler);
-#endif
-#ifdef SIGABRT
+# endif
+# ifdef SIGABRT
     signal(SIGABRT, segv_handler);
+# endif
 #endif
     size = 1U + randombytes_uniform(100000U);
     buf  = sodium_malloc(size);
diff --git a/test/default/sodium_utils3.c b/test/default/sodium_utils3.c
index 3f2b600e79407ccb54fcab50a3d77922497a8b45..a39f0ee42b918a3db69c73e2298657b729b71449 100644
--- a/test/default/sodium_utils3.c
+++ b/test/default/sodium_utils3.c
@@ -19,14 +19,16 @@ segv_handler(int sig)
 
     printf("Intentional segfault / bus error caught\n");
     printf("OK\n");
-#ifdef SIGSEGV
+#ifdef SIG_DFL
+# ifdef SIGSEGV
     signal(SIGSEGV, SIG_DFL);
-#endif
-#ifdef SIGBUS
+# endif
+# ifdef SIGBUS
     signal(SIGBUS, SIG_DFL);
-#endif
-#ifdef SIGABRT
+# endif
+# ifdef SIGABRT
     signal(SIGABRT, SIG_DFL);
+# endif
 #endif
     exit(0);
 }
@@ -37,14 +39,16 @@ main(void)
     void * buf;
     size_t size;
 
-#ifdef SIGSEGV
+#ifdef SIG_DFL
+# ifdef SIGSEGV
     signal(SIGSEGV, segv_handler);
-#endif
-#ifdef SIGBUS
+# endif
+# ifdef SIGBUS
     signal(SIGBUS, segv_handler);
-#endif
-#ifdef SIGABRT
+# endif
+# ifdef SIGABRT
     signal(SIGABRT, segv_handler);
+# endif
 #endif
     size = 1U + randombytes_uniform(100000U);
     buf  = sodium_malloc(size);
diff --git a/test/default/stream.c b/test/default/stream.c
index 150fe78031d0a8cd0116cefaf7b51553bd65c53b..87ef3712e8519e78b13ee3dfd8ab45f5438ee758 100644
--- a/test/default/stream.c
+++ b/test/default/stream.c
@@ -2,48 +2,55 @@
 #define TEST_NAME "stream"
 #include "cmptest.h"
 
-static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85,
-                                      0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a,
-                                      0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac,
-                                      0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08,
-                                      0x44, 0xf6, 0x83, 0x89 };
+static const unsigned char firstkey[32] = {
+    0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85,
+    0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a,
+    0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac,
+    0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08,
+    0x44, 0xf6, 0x83, 0x89
+};
 
-static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6,
-                                   0x2b, 0x73, 0xcd, 0x62, 0xbd, 0xa8,
-                                   0x75, 0xfc, 0x73, 0xd6, 0x82, 0x19,
-                                   0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 };
-
-static unsigned char output[4194304];
-
-static unsigned char h[32];
-static char          hex[2 * 192 + 1];
+static const unsigned char nonce[24] = {
+    0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6,
+    0x2b, 0x73, 0xcd, 0x62, 0xbd, 0xa8,
+    0x75, 0xfc, 0x73, 0xd6, 0x82, 0x19,
+    0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37
+};
 
 int
 main(void)
 {
-    int i;
+    unsigned char  h[32];
+    char          *hex;
+    unsigned char *output;
+    size_t         sizeof_hex = 17 * 64 * 2 + 1;
+    size_t         sizeof_output = 4194304;
+    int            i;
 
-    randombytes_buf(output, sizeof output);
-    crypto_stream(output, sizeof output, nonce, firstkey);
-    crypto_hash_sha256(h, output, sizeof output);
-    sodium_bin2hex(hex, sizeof hex, h, sizeof h);
+    output = (unsigned char *) sodium_malloc(sizeof_output);
+    hex = (char *) sodium_malloc(sizeof_hex);
+
+    randombytes_buf(output, sizeof_output);
+    crypto_stream(output, sizeof_output, nonce, firstkey);
+    crypto_hash_sha256(h, output, sizeof_output);
+    sodium_bin2hex(hex, sizeof_hex, h, sizeof h);
     printf("%s\n", hex);
 
-    assert(sizeof output > 4000);
+    assert(sizeof_output > 4000);
 
     crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 0U, firstkey);
     for (i = 0; i < 4000; i++) {
         assert(output[i] == 0);
     }
     crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 1U, firstkey);
-    crypto_hash_sha256(h, output, sizeof output);
-    sodium_bin2hex(hex, sizeof hex, h, sizeof h);
+    crypto_hash_sha256(h, output, sizeof_output);
+    sodium_bin2hex(hex, sizeof_hex, h, sizeof h);
     printf("%s\n", hex);
 
     for (i = 0; i < 64; i++) {
         memset(output, i, 64);
         crypto_stream(output, (int) (i & 0xff), nonce, firstkey);
-        sodium_bin2hex(hex, sizeof hex, output, 64);
+        sodium_bin2hex(hex, sizeof_hex, output, 64);
         printf("%s\n", hex);
     }
 
@@ -53,6 +60,18 @@ main(void)
     sodium_bin2hex(hex, 192 * 2 + 1, output, 192);
     printf("%s\n", hex);
 
+    for (i = 16; i > 0; i--) {
+        memset(output, 0, 17 * 64);
+        crypto_stream_xsalsa20_xor_ic(output, output, 17 * 64, nonce,
+                                      (1ULL << 32) - (unsigned long long) i,
+                                      firstkey);
+        sodium_bin2hex(hex, 2 * 17 * 64 + 1, output, 17 * 64);
+        printf("%s\n", hex);
+    }
+
+    sodium_free(hex);
+    sodium_free(output);
+
     assert(crypto_stream_keybytes() > 0U);
     assert(crypto_stream_noncebytes() > 0U);
     assert(crypto_stream_messagebytes_max() > 0U);
diff --git a/test/default/stream.exp b/test/default/stream.exp
index 6e0268adb2847ebcfb50076dfec75610ca70ab9c..68ff67b4f0c4b19d4929ea0f6de7125e13c07420 100644
--- a/test/default/stream.exp
+++ b/test/default/stream.exp
@@ -65,3 +65,19 @@ eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a6
 eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e55853e3e
 eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880309e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c093c5e5585573f
 b46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44
+e825afc24db1b82ca241ef61bbd68003af106fbc07c41df1493b963b5ce45b72540ababca323c71ca3c903e1eec355121fbe9fad8bef90721c819eeba906ef7300b84696929a86d2a95aacebef2f38c489617398a39bc36762b5de6ccf544dde7fa47a839e3bf36903e3b7e9539c5c1c1794cfc991a414e2eef16bcf1b16d07cfb1ff0d77e5940a858f9025563334efeea808e3a82a54a0998e5587fddcb8b48e05de4cdb6ed1df7ddfca886d7122590844bc060178e13ba22a3c60f6fd53bb48f12931a32c81cbdde25e2fe3141682ff0443a9fb890e0520d328f91e19c4c0b0d05bd391351459dd5b15da237cfb3c36c95cfbfb076637b9181d9d9b42ae8ee3655eef4662a0c8737e5620ed7760a577afac32aa37baa35323a52287dfba632abcbff3e40aee172648c3d6f8e468262a49bbc2fb7876e97bb9d06ce6038e9eb425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe
+00b84696929a86d2a95aacebef2f38c489617398a39bc36762b5de6ccf544dde7fa47a839e3bf36903e3b7e9539c5c1c1794cfc991a414e2eef16bcf1b16d07cfb1ff0d77e5940a858f9025563334efeea808e3a82a54a0998e5587fddcb8b48e05de4cdb6ed1df7ddfca886d7122590844bc060178e13ba22a3c60f6fd53bb48f12931a32c81cbdde25e2fe3141682ff0443a9fb890e0520d328f91e19c4c0b0d05bd391351459dd5b15da237cfb3c36c95cfbfb076637b9181d9d9b42ae8ee3655eef4662a0c8737e5620ed7760a577afac32aa37baa35323a52287dfba632abcbff3e40aee172648c3d6f8e468262a49bbc2fb7876e97bb9d06ce6038e9eb425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44
+fb1ff0d77e5940a858f9025563334efeea808e3a82a54a0998e5587fddcb8b48e05de4cdb6ed1df7ddfca886d7122590844bc060178e13ba22a3c60f6fd53bb48f12931a32c81cbdde25e2fe3141682ff0443a9fb890e0520d328f91e19c4c0b0d05bd391351459dd5b15da237cfb3c36c95cfbfb076637b9181d9d9b42ae8ee3655eef4662a0c8737e5620ed7760a577afac32aa37baa35323a52287dfba632abcbff3e40aee172648c3d6f8e468262a49bbc2fb7876e97bb9d06ce6038e9eb425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef5
+8f12931a32c81cbdde25e2fe3141682ff0443a9fb890e0520d328f91e19c4c0b0d05bd391351459dd5b15da237cfb3c36c95cfbfb076637b9181d9d9b42ae8ee3655eef4662a0c8737e5620ed7760a577afac32aa37baa35323a52287dfba632abcbff3e40aee172648c3d6f8e468262a49bbc2fb7876e97bb9d06ce6038e9eb425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0
+3655eef4662a0c8737e5620ed7760a577afac32aa37baa35323a52287dfba632abcbff3e40aee172648c3d6f8e468262a49bbc2fb7876e97bb9d06ce6038e9eb425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58
+425927287fb9ac67e41be494a883668602f4fcf76cc2c6bc62c3240bb63c233316630a645d5309af5c49813b8cc23e149ce40db089c7124431935e93fcc34dd1326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbb
+326fc6b1b8e71c37a3ee97a334f2c6bf579c5e986858a88b07136dd6b254543b16e14f38c7cb22cdb41a9028e3a6af9233c45ba06d1667746d48fc7b5c47601237fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766e
+37fb2bde1e5a5551a1b4bf848734310103edb75a815e4ced8be43163ca13b3e399e91bf32b28de0b37c17d155f7129e23aec3deb2416122d7008a5684d5d0080f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2d
+f15e5eef787d292097cd781b3f95449b5f5a059a2cfbcd2cb10cc88a4759f2227f20d550c4cee567ab3e297191e8f1c3d537f1fc265c93ce900ae588d7d6a971cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ac
+cb0f0ae663a41347797bc4384568e439e10fa3cb24fefddf51202b17e35e5e3aba42fb067d15854bdeb400e8e96dfd097d5ffa793f3135cc819edefbf18c26c7e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f2808
+e7a830988e8e1612a06c2d1f3bc03efb7ce5ca6538c4be7ba033a8f369fc479d527ca82cbc8198ef815ba7946fb7f4e7f503d280bddc767e39c4fb0ed54c86065a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b199413
+5a301ce502d083eeabcbcfd79dfc0de676d444c500d83d123367639d741e4fc4d87eea89f203fadd7e38f9a17b01a34ffe48f2469565751aca063c59614007c41aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b1994131fa61652a5574f50fa159d47f8f28776e25e21b51103b91afc8345cfbedf46586e17269bfb521ae07f2cd202d308110abcb2b6f0157a55bc6aa6936812c1074d
+1aff83247f8daae106f5cd50177b4b98388e6963cf51baaa1de17e90831b5977016aa71973485b4d8524b7aa4f6b7e0a8d994662b922aaab519ab0f8e0d1513ccf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b1994131fa61652a5574f50fa159d47f8f28776e25e21b51103b91afc8345cfbedf46586e17269bfb521ae07f2cd202d308110abcb2b6f0157a55bc6aa6936812c1074dcd3dc1365d431608687e158b5b3622375e0ddda9cfccb2f16b4a966fc3ecababaa3ea4f8311b37c4578c4692a0d2bdd251c18a886c9b48671531db2759828959
+cf9906615f1bb36a01a9916b27484414e3f3b559e52cf3380b422df71eda463fd1ef24a8d84e82d9718fb46d51d13687352ea76737209d618e77119b066161e2d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b1994131fa61652a5574f50fa159d47f8f28776e25e21b51103b91afc8345cfbedf46586e17269bfb521ae07f2cd202d308110abcb2b6f0157a55bc6aa6936812c1074dcd3dc1365d431608687e158b5b3622375e0ddda9cfccb2f16b4a966fc3ecababaa3ea4f8311b37c4578c4692a0d2bdd251c18a886c9b48671531db27598289593cf82813da4f43eb854142ef39c4e5950f86b29e291737413396ae4c62f4472fe12659e12b61b84619a96b03a386dd6adb6b74ce09bc11330482e01564d3eb1a
+d93cc6ac5cb77a7a0d14988e3355e07a2f02bed2f8cec08807c544efd8ccc5ca3475e8be3143997d402aecfb56e80697f57179e6d631e38741ff3ef57a7ff80cb46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b1994131fa61652a5574f50fa159d47f8f28776e25e21b51103b91afc8345cfbedf46586e17269bfb521ae07f2cd202d308110abcb2b6f0157a55bc6aa6936812c1074dcd3dc1365d431608687e158b5b3622375e0ddda9cfccb2f16b4a966fc3ecababaa3ea4f8311b37c4578c4692a0d2bdd251c18a886c9b48671531db27598289593cf82813da4f43eb854142ef39c4e5950f86b29e291737413396ae4c62f4472fe12659e12b61b84619a96b03a386dd6adb6b74ce09bc11330482e01564d3eb1a688a80b912ad6d8ce2b939e06e7ecc18c358772ea0c92e82ef26d9bbe342a18babc0d54f676ed9c380fc990a7d576c958d19f6e15fda4fe08752bb8d1eedb05f
+b46af0bf761b78533e01a0dd7e07216c9710ef35f09a28d1e5fa469b602472ca5085f6dbcc6a6b51fb89986f8feca85658d05701f5677d0bb340a1f2c769547219f5420c62ffff7d1304dad82b6dec2bdc59ec12a9e18a774eed128c2c90610a9d4c75c0817d64817a76bbc12746971ae897af210a072c1bc9fb044e086b7bfe85fad95d5c2bbb28c12de5755b1ccde63e93cc892b4d2bcbd7dc0706b094c2492e329e3b9a98a9cbc7d01031cf1d5861f576e1291df6286c28146b0b4df9ad44a8d40ce05f73fa3de1a92f948c38fe88a296db696a16742c5073aed1f26c6289675c28c763ab90a070b643ecf1c50f4165b82cf5b8eda4137903765f42cbaef571f6303486a899aef83ca9c8c1e53af717293a6e219675aa1f479eac02d30df16649fc1c83b24855617385b5330b054c13f8fe8670ea2383552fe7fa096a6ff0d90d3922c26b77fb632041df8a3c585f295488aa98d73bc6a3a43eac5644b59440e02ed8a6b9a8acb9f33e732c1850ed6f811975a84b65cb8775df2f55f15f58af8a27936cf507dcc7ec480ffce410373c81374fddcbad758a1976894d58e68d84f3da8a0bbbfd3d62d09679378ee94686866e0ef101e05ccb7cc8fdf6f31cbbf757c4d17aa607bc1decad9a65b8120adb7ef3b9d18a9c07226adf6f73f93c2ff79956f5e19b7c613dff1e907a8381863eb9ca536b44a3034cd522d6caa1766eda2dadd40a0f32380a30c0a0be3ad991007c8778ec855f0c2e9869718f07562ef2bce1d6fa7b551454eda2f86a514d0cd754188715d5f73cbe47d940b8a98a2de9cb66cba3830b2e732aa836df30b279f434ac98182114990d0b8d423813f75b5527dfa7982a167712380786bda08836976c21358a0d50e735f3efcb59ff69ace37ddc48ef2b83bcc1931cf6673dfa726ac5229b83be548b60416ed5c7daf3a3201db9aadd1ffe632a7d3012d94668d5191010dd35d8ba9dc881005e112f28083f085c8094de717acd2516b631760110c176bff91d3e8cd4d2df79f79d450e54a5007e34caf791d9ac10aa98f45e52d987addf59f4beb5e62ef59e2e1b1994131fa61652a5574f50fa159d47f8f28776e25e21b51103b91afc8345cfbedf46586e17269bfb521ae07f2cd202d308110abcb2b6f0157a55bc6aa6936812c1074dcd3dc1365d431608687e158b5b3622375e0ddda9cfccb2f16b4a966fc3ecababaa3ea4f8311b37c4578c4692a0d2bdd251c18a886c9b48671531db27598289593cf82813da4f43eb854142ef39c4e5950f86b29e291737413396ae4c62f4472fe12659e12b61b84619a96b03a386dd6adb6b74ce09bc11330482e01564d3eb1a688a80b912ad6d8ce2b939e06e7ecc18c358772ea0c92e82ef26d9bbe342a18babc0d54f676ed9c380fc990a7d576c958d19f6e15fda4fe08752bb8d1eedb05fbb420713aa2c9df64fc3fcb136d739466a36b38c515e44b1fd8e04717ab838bb8ad38ee6613c173d1d973f478cb0abcd6e69ac2570b8c9b78264ceb9d4a975c8
diff --git a/test/default/stream2.c b/test/default/stream2.c
index 8e5b3f67b9828f805d98e5ae241f1e1e8fad164a..1e178a478bff7788a643991ee5c7e3cde2b456f5 100644
--- a/test/default/stream2.c
+++ b/test/default/stream2.c
@@ -2,42 +2,54 @@
 #define TEST_NAME "stream2"
 #include "cmptest.h"
 
-static unsigned char secondkey[32] = { 0xdc, 0x90, 0x8d, 0xda, 0x0b, 0x93, 0x44,
-                                       0xa9, 0x53, 0x62, 0x9b, 0x73, 0x38, 0x20,
-                                       0x77, 0x88, 0x80, 0xf3, 0xce, 0xb4, 0x21,
-                                       0xbb, 0x61, 0xb9, 0x1c, 0xbd, 0x4c, 0x3e,
-                                       0x66, 0x25, 0x6c, 0xe4 };
+static const unsigned char secondkey[32] = {
+    0xdc, 0x90, 0x8d, 0xda, 0x0b, 0x93, 0x44,
+    0xa9, 0x53, 0x62, 0x9b, 0x73, 0x38, 0x20,
+    0x77, 0x88, 0x80, 0xf3, 0xce, 0xb4, 0x21,
+    0xbb, 0x61, 0xb9, 0x1c, 0xbd, 0x4c, 0x3e,
+    0x66, 0x25, 0x6c, 0xe4
+};
 
-static unsigned char noncesuffix[8] = { 0x82, 0x19, 0xe0, 0x03,
-                                        0x6b, 0x7a, 0x0b, 0x37 };
+static const unsigned char noncesuffix[8] = {
+    0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37
+};
 
-static unsigned char output[4194304];
 
-static unsigned char h[32];
 
 int
 main(void)
 {
-    int i;
-    crypto_stream_salsa20(output, sizeof output, noncesuffix, secondkey);
-    crypto_hash_sha256(h, output, sizeof output);
-    for (i = 0; i < 32; ++i)
-        printf("%02x", h[i]);
-    printf("\n");
+    unsigned char *output;
+    char          *hex;
+    unsigned char  h[32];
+    size_t         sizeof_hex = 32 * 2 + 1;
+    size_t         sizeof_output = 4194304;
+    int            i;
 
-    assert(sizeof output > 4000);
+    output = (unsigned char *) sodium_malloc(sizeof_output);
+    hex = (char *) sodium_malloc(sizeof_hex);
+
+    crypto_stream_salsa20(output, sizeof_output, noncesuffix, secondkey);
+    crypto_hash_sha256(h, output, sizeof_output);
+    sodium_bin2hex(hex, sizeof_hex, h, sizeof h);
+    printf("%s\n", hex);
+
+    assert(sizeof_output > 4000);
 
     crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 0U,
                                  secondkey);
-    for (i = 0; i < 4000; ++i)
+    for (i = 0; i < 4000; i++) {
         assert(output[i] == 0);
+    }
 
     crypto_stream_salsa20_xor_ic(output, output, 4000, noncesuffix, 1U,
                                  secondkey);
-    crypto_hash_sha256(h, output, sizeof output);
-    for (i = 0; i < 32; ++i)
-        printf("%02x", h[i]);
-    printf("\n");
+    crypto_hash_sha256(h, output, sizeof_output);
+    sodium_bin2hex(hex, sizeof_hex, h, sizeof h);
+    printf("%s\n", hex);
+
+    sodium_free(hex);
+    sodium_free(output);
 
     assert(crypto_stream_salsa20_keybytes() > 0U);
     assert(crypto_stream_salsa20_noncebytes() > 0U);
diff --git a/test/default/wasi-test-wrapper.sh b/test/default/wasi-test-wrapper.sh
new file mode 100755
index 0000000000000000000000000000000000000000..af64884c5db566104f743d14068ec3d4580fa072
--- /dev/null
+++ b/test/default/wasi-test-wrapper.sh
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+MAX_MEMORY_TESTS="67108864"
+
+if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then
+  if command -v wasmtime >/dev/null; then
+    wasmtime -o --dir=. "$1" && exit 0
+  fi
+fi
+
+if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "lucet" ]; then
+  if command -v lucetc-wasi >/dev/null && command -v lucet-wasi >/dev/null; then
+    lucetc-wasi \
+      --reserved-size "${MAX_MEMORY_TESTS}" \
+      -o "${1}.so" --opt-level fast "$1" &&
+      lucet-wasi --dir=.:. --max-heap-size "${MAX_MEMORY_TESTS}" "${1}.so" &&
+      rm -f "${1}.so" && exit 0
+  fi
+fi
+
+if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then
+  if command -v wasmer >/dev/null; then
+    wasmer run "$1" --backend "${WASMER_BACKEND:-cranelift}" --dir=. && exit 0
+  fi
+fi
+
+echo "WebAssembly runtime failed" >&2
+exit 1
diff --git a/test/quirks/quirks.h b/test/quirks/quirks.h
index 65935a47714f5167877ad33e25998d4f9692d268..69fe3693617476b55da3f134631b49b49d0eda2f 100644
--- a/test/quirks/quirks.h
+++ b/test/quirks/quirks.h
@@ -4,23 +4,6 @@
 /* C++Builder defines a "random" macro */
 #undef random
 
-#ifdef __native_client__
-# define memset(dst, c, n) xmemset(dst, c, n)
-
-static void *
-xmemset(void *dst, int c, size_t n)
-{
-    unsigned char *     dst_ = (unsigned char *) dst;
-    const unsigned char c_   = (unsigned char) c;
-    size_t              i;
-
-    for (i = 0; i < n; i++) {
-        dst_[i] = c_;
-    }
-    return dst;
-}
-#endif
-
 #ifdef __EMSCRIPTEN__
 # define strcmp(s1, s2) xstrcmp(s1, s2)