diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97c09dccb..18ac92f22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: architecture: ${{ matrix.WINDOWS.ARCH }} - name: 'Extract libsodium libraries' run: | - Expand-Archive src/libsodium-1.0.18-stable-msvc.zip -DestinationPath c:\ + Expand-Archive src/libsodium-1.0.20-stable-msvc.zip -DestinationPath c:\ shell: powershell - name: Install tox and coverage run: pip install tox coverage diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index 538bf1824..e17786dd4 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -139,7 +139,7 @@ jobs: architecture: ${{ matrix.WINDOWS.ARCH }} - name: Extract libsodium libraries run: | - Expand-Archive src/libsodium-1.0.18-stable-msvc.zip -DestinationPath c:\ + Expand-Archive src/libsodium-1.0.20-stable-msvc.zip -DestinationPath c:\ shell: powershell - name: Add sodium to paths run: | diff --git a/setup.py b/setup.py index ee32016bb..1d4625620 100644 --- a/setup.py +++ b/setup.py @@ -127,13 +127,7 @@ def run(self): # Ensure all of our executable files have their permission set for filename in [ "src/libsodium/autogen.sh", - "src/libsodium/compile", "src/libsodium/configure", - "src/libsodium/depcomp", - "src/libsodium/install-sh", - "src/libsodium/missing", - "src/libsodium/msvc-scripts/process.bat", - "src/libsodium/test/default/wintest.bat", ]: os.chmod(here(filename), 0o755) diff --git a/src/libsodium-1.0.18-stable-msvc.zip b/src/libsodium-1.0.20-stable-msvc.zip similarity index 61% rename from src/libsodium-1.0.18-stable-msvc.zip rename to src/libsodium-1.0.20-stable-msvc.zip index 67b05fdf5..f73f56f5a 100644 Binary files a/src/libsodium-1.0.18-stable-msvc.zip and b/src/libsodium-1.0.20-stable-msvc.zip differ diff --git a/src/libsodium/.github/workflows/ci.yml b/src/libsodium/.github/workflows/ci.yml index 88b503788..c8502d901 100644 --- a/src/libsodium/.github/workflows/ci.yml +++ b/src/libsodium/.github/workflows/ci.yml @@ -12,13 +12,14 @@ jobs: tcc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies - run: sudo apt-get install -y build-essential libtool autoconf automake tcc + run: | + sudo apt-get install -y build-essential libtool autoconf automake tcc - name: Autogen run: ./autogen.sh -s @@ -31,10 +32,39 @@ jobs: make uninstall make distclean + zig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Update packages list + run: sudo apt-get update + + - name: Install Zig + uses: goto-bus-stop/setup-zig@d866436887ad1b24590684f9d00480376663dd36 + with: + version: 0.12.0 + + - name: Autogen + run: ./autogen.sh -s + + - name: Compilation with zig + run: | + zig build + zig build -Dtarget=x86_64-linux + zig build -Dtarget=aarch64-linux + zig build -Dtarget=x86_64-windows + zig build -Dtarget=aarch64-windows + zig build -Dtarget=x86_64-macos + zig build -Dtarget=aarch64-macos + zig build -Dtarget=wasm32-wasi + zig build -Doptimize=ReleaseFast + rm -fr zig-cache zig-out + regular: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update @@ -63,7 +93,7 @@ jobs: check-globals: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update @@ -81,7 +111,7 @@ jobs: other-comp: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update @@ -107,13 +137,13 @@ jobs: other-arch: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies - run: sudo apt-get install -y build-essential libtool autoconf automake qemu-user-static gcc-powerpc-linux-gnu + run: sudo apt-get install -y build-essential libtool autoconf automake gcc-powerpc-linux-gnu - name: Autogen run: ./autogen.sh -s @@ -123,3 +153,27 @@ jobs: env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --host=powerpc-linux-gnu make -j $(nproc) make clean > /dev/null + + android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Update packages list + run: sudo apt-get update + + - name: Install base dependencies + run: sudo apt-get install -y libtool autoconf automake unzip + + - name: Autogen + run: ./autogen.sh -s + + - name: Install Android NDK + run: | + mkdir /tmp/android && cd /tmp/android + curl -o ndk.zip -L https://dl.google.com/android/repository/android-ndk-r25c-linux.zip + unzip ndk.zip && rm -f *.zip && mv android-ndk* ndk + + - name: Android compilation + run: | + env ANDROID_NDK_HOME=/tmp/android/ndk ./dist-build/android-aar.sh diff --git a/src/libsodium/.github/workflows/codeql-analysis.yml b/src/libsodium/.github/workflows/codeql-analysis.yml index bd58e1fe0..a54836d28 100644 --- a/src/libsodium/.github/workflows/codeql-analysis.yml +++ b/src/libsodium/.github/workflows/codeql-analysis.yml @@ -4,28 +4,27 @@ on: push: pull_request: schedule: - - cron: '0 17 * * 2' + - cron: "0 17 * * 2" jobs: CodeQL-Build: - runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: cpp + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: cpp - - run: | - ./autogen.sh -s - env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking - make -j $(nproc) check + - run: | + ./autogen.sh -s + env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking + make -j $(nproc) check - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/src/libsodium/.github/workflows/dotnet-core.yml b/src/libsodium/.github/workflows/dotnet-core.yml index 7cba736c2..001dd1e11 100644 --- a/src/libsodium/.github/workflows/dotnet-core.yml +++ b/src/libsodium/.github/workflows/dotnet-core.yml @@ -3,314 +3,340 @@ name: .NET Package on: push: branches: - - stable - - next + - stable + - next -jobs: +permissions: + id-token: write + attestations: write + contents: read - build-windows: +jobs: + build-windows-msvc: runs-on: windows-latest steps: - - uses: actions/checkout@v1 - - name: buildbase.bat - run: buildbase.bat ..\vs2019\libsodium.sln 16 - working-directory: builds/msvc/build/ - shell: cmd - - uses: actions/upload-artifact@v2 - with: - name: build-win-x64 - path: bin/x64/Release/v142/dynamic/libsodium.dll - - uses: actions/upload-artifact@v2 - with: - name: build-win-x86 - path: bin/Win32/Release/v142/dynamic/libsodium.dll - - build-linux-glibc: - runs-on: ubuntu-latest - container: - image: ubuntu:20.04 - steps: - - name: Set up build environment - run: | - apt-get update && apt-get install -y build-essential - - uses: actions/checkout@v1 - - name: configure - run: ./configure --disable-debug --prefix=$PWD/.libsodium-build - - name: make - run: make - - name: make check - run: make check - - name: make install - run: make install - - name: strip - run: strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 - with: - name: build-linux-x64 - path: .libsodium-build/lib/libsodium.so - - build-linux-glibc-arm64: + - uses: actions/checkout@v4 + - name: buildbase.bat + run: buildbase.bat ..\vs2022\libsodium.sln 17 + working-directory: builds/msvc/build/ + shell: cmd + - uses: actions/upload-artifact@v3 + with: + name: build-win-x64 + path: bin/x64/Release/v143/dynamic/libsodium.dll + - uses: actions/upload-artifact@v3 + with: + name: build-win-x86 + path: bin/Win32/Release/v143/dynamic/libsodium.dll + + build-others: runs-on: ubuntu-latest steps: - - name: Set up build environment - run: | - export DEBIAN_FRONTEND=noninteractive - - cat <<-EOF | sudo tee /etc/apt/sources.list.d/arm64.list >/dev/null - deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted - deb [arch=arm64] http://ports.ubuntu.com/ focal universe - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe - deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse - deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse - deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse - EOF - - sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list - - sudo dpkg --add-architecture arm64 - - sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64 - - - uses: actions/checkout@v1 - - name: configure - run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu - - name: make - run: make -j $(nproc) - - - name: make check - run: | - make check - - - name: make install - run: make install - - - name: strip - run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 - with: - name: build-linux-arm64 - path: .libsodium-build/lib/libsodium.so - - build-linux-glibc-arm: - runs-on: ubuntu-20.04 - steps: - - name: Set up build environment - run: | - export DEBIAN_FRONTEND=noninteractive - - cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null - deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted - deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted - deb [arch=armhf] http://ports.ubuntu.com/ focal universe - deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe - deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse - deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse - deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse - EOF - - sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list - - sudo dpkg --add-architecture armhf - - sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf - - - uses: actions/checkout@v1 - - name: configure - run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf - - name: make - run: make -j $(nproc) - - - name: make check - run: | - make check - - - name: make install - run: make install - - - name: strip - run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 - with: - name: build-linux-arm - path: .libsodium-build/lib/libsodium.so - - build-linux-musl: - runs-on: ubuntu-latest - container: - image: alpine:3.13 - steps: - - name: Set up build environment - run: | - apk update - apk add alpine-sdk ca-certificates - - uses: actions/checkout@v1 - - name: configure - run: ./configure --disable-debug --prefix=$PWD/.libsodium-build - - name: make - run: make - - name: make check - run: make check - - name: make install - run: make install - - name: strip - run: strip --strip-all .libsodium-build/lib/libsodium.so - - uses: actions/upload-artifact@v2 - with: - name: build-linux-musl-x64 - path: .libsodium-build/lib/libsodium.so - - build-macos: + - name: Install Zig + uses: goto-bus-stop/setup-zig@2a9625d550eefc3a9b1a43d342ad655f563f8241 + with: + version: 0.12.0 + - uses: actions/checkout@v4 + + - name: build-win-arm64 + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=aarch64-windows; ls -lR zig-out + - uses: actions/upload-artifact@v3 + with: + name: build-win-arm64 + path: zig-out/lib/libsodium.dll + + - name: build-linux-x64 + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu.2.17 + - name: tests + run: cd zig-out/bin && ./run.sh + - uses: actions/upload-artifact@v3 + with: + name: build-linux-x64 + path: zig-out/lib/libsodium.so + + - name: Set up arm and aarch64 emulation environment + run: | + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update + sudo apt-get install -y build-essential qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf libc6-armhf-cross gcc-aarch64-linux-gnu libc6-arm64-cross + sudo dpkg --add-architecture armhf + sudo update-binfmts --enable qemu-arm + sudo update-binfmts --display + sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib + sudo dpkg --add-architecture arm64 + sudo update-binfmts --enable qemu-aarch64 + sudo update-binfmts --display + sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib + + - name: build-linux-arm + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-gnueabihf.2.23 + - name: tests + run: | + cd zig-out/bin && env LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib ./run.sh + - uses: actions/upload-artifact@v3 + with: + name: build-linux-arm + path: zig-out/lib/libsodium.so + + - name: build-linux-arm64 + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-gnu.2.23 + - name: tests + run: | + cd zig-out/bin && env LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib ./run.sh + - uses: actions/upload-artifact@v3 + with: + name: build-linux-arm64 + path: zig-out/lib/libsodium.so + + - name: build-linux-musl-x64 + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl + - uses: actions/upload-artifact@v3 + with: + name: build-linux-musl-x64 + path: zig-out/lib/libsodium.so + + - name: build-linux-musl-arm + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-musleabihf + - uses: actions/upload-artifact@v3 + with: + name: build-linux-musl-arm + path: zig-out/lib/libsodium.so + + - name: build-linux-musl-arm64 + run: | + rm -fr zig-out zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl + - uses: actions/upload-artifact@v3 + with: + name: build-linux-musl-arm64 + path: zig-out/lib/libsodium.so + + build-apple: runs-on: macos-latest steps: - - uses: actions/checkout@v1 - - name: configure - run: ./configure --disable-debug --prefix=$PWD/.libsodium-build - - name: make - run: make - - name: make check - run: make check - - name: make install - run: make install - - uses: actions/upload-artifact@v2 - with: - name: build-osx-x64 - path: .libsodium-build/lib/libsodium.dylib - + - uses: actions/checkout@v4 + - name: configure + run: ./configure + - name: build-xcframework + run: env LIBSODIUM_FULL_BUILD=1 LIBSODIUM_SKIP_SIMULATORS=1 dist-build/apple-xcframework.sh + - uses: actions/upload-artifact@v3 + with: + name: build-macos + path: libsodium-apple/macos/lib/libsodium.dylib + - uses: actions/upload-artifact@v3 + with: + name: build-ios + path: libsodium-apple/ios/lib/libsodium.a + - uses: actions/upload-artifact@v3 + with: + name: build-tvos + path: libsodium-apple/tvos/lib/libsodium.a + - uses: actions/upload-artifact@v3 + with: + name: build-maccatalyst + path: libsodium-apple/catalyst/lib/libsodium.a pack: runs-on: ubuntu-latest needs: - - build-windows - - build-linux-glibc - - build-linux-glibc-arm - - build-linux-glibc-arm64 - - build-linux-musl - - build-macos + - build-windows-msvc + - build-apple + - build-others container: - image: mcr.microsoft.com/dotnet/sdk:5.0 + image: mcr.microsoft.com/dotnet/sdk:6.0 env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - uses: actions/checkout@v1 - - uses: actions/download-artifact@v2 - with: - name: build-win-x64 - path: .libsodium-pack/runtimes/win-x64/native/ - - uses: actions/download-artifact@v2 - with: - name: build-win-x86 - path: .libsodium-pack/runtimes/win-x86/native/ - - uses: actions/download-artifact@v2 - with: - name: build-linux-x64 - path: .libsodium-pack/runtimes/linux-x64/native/ - - uses: actions/download-artifact@v2 - with: - name: build-linux-arm64 - path: .libsodium-pack/runtimes/linux-arm64/native/ - - uses: actions/download-artifact@v2 - with: - name: build-linux-arm - path: .libsodium-pack/runtimes/linux-arm/native/ - - uses: actions/download-artifact@v2 - with: - name: build-linux-musl-x64 - path: .libsodium-pack/runtimes/linux-musl-x64/native/ - - uses: actions/download-artifact@v2 - with: - name: build-osx-x64 - path: .libsodium-pack/runtimes/osx-x64/native/ - - name: Copy files - run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ - - name: Create NuGet package - run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj - - uses: actions/upload-artifact@v2 - with: - name: nuget-package - path: .libsodium-pack/bin/Release/*.nupkg + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: build-win-x64 + path: .libsodium-pack/runtimes/win-x64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-win-x86 + path: .libsodium-pack/runtimes/win-x86/native/ + - uses: actions/download-artifact@v3 + with: + name: build-win-arm64 + path: .libsodium-pack/runtimes/win-arm64/native/ + + - uses: actions/download-artifact@v3 + with: + name: build-linux-x64 + path: .libsodium-pack/runtimes/linux-x64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-linux-arm64 + path: .libsodium-pack/runtimes/linux-arm64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-linux-arm + path: .libsodium-pack/runtimes/linux-arm/native/ + - uses: actions/download-artifact@v3 + with: + name: build-linux-musl-x64 + path: .libsodium-pack/runtimes/linux-musl-x64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-linux-musl-arm + path: .libsodium-pack/runtimes/linux-musl-arm/native/ + - uses: actions/download-artifact@v3 + with: + name: build-linux-musl-arm64 + path: .libsodium-pack/runtimes/linux-musl-arm64/native/ + + - uses: actions/download-artifact@v3 + with: + name: build-macos + path: .libsodium-pack/runtimes/osx-x64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-macos + path: .libsodium-pack/runtimes/osx-arm64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-ios + path: .libsodium-pack/runtimes/ios-arm64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-tvos + path: .libsodium-pack/runtimes/tvos-arm64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-maccatalyst + path: .libsodium-pack/runtimes/maccatalyst-x64/native/ + - uses: actions/download-artifact@v3 + with: + name: build-maccatalyst + path: .libsodium-pack/runtimes/maccatalyst-arm64/native/ + + - name: Copy files + run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ + - name: Create NuGet package + run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj + - uses: actions/upload-artifact@v3 + with: + name: nuget-package + path: .libsodium-pack/bin/Release/*.nupkg + + - name: Attest Build Provenance + uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 + with: + subject-path: .libsodium-pack/bin/Release/*.nupkg build-test-binaries: runs-on: ubuntu-latest needs: - - pack + - pack container: - image: mcr.microsoft.com/dotnet/sdk:5.0 + image: mcr.microsoft.com/dotnet/sdk:6.0 env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - uses: actions/checkout@v1 - - uses: actions/download-artifact@v2 - with: - name: nuget-package - path: .libsodium-pack/ - - name: dotnet new - run: dotnet new console -n Tests -o .libsodium-test/ - - name: dotnet add package libsodium - run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack - - name: Copy files - run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs - - name: dotnet publish linux-x64 - run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true - working-directory: .libsodium-test/ - - name: dotnet publish linux-arm - run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true - working-directory: .libsodium-test/ - - name: dotnet publish linux-arm64 - run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true - working-directory: .libsodium-test/ - - name: Move Build Output - run: | - mkdir .libsodium-builds - mv .libsodium-test/bin/Release/net5.0/linux-arm/publish .libsodium-builds/linux-arm - mv .libsodium-test/bin/Release/net5.0/linux-arm64/publish .libsodium-builds/linux-arm64 - mv .libsodium-test/bin/Release/net5.0/linux-x64/publish .libsodium-builds/linux-x64 - - uses: actions/upload-artifact@v2 - with: - name: test-builds - path: .libsodium-builds/* - - run-test-binaries: - runs-on: ubuntu-20.04 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: nuget-package + path: .libsodium-pack/ + - name: dotnet new + run: dotnet new console -n Tests -o .libsodium-test/ + - name: dotnet add package libsodium + run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack + - name: Copy files + run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs + - name: dotnet publish linux-x64 + run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: dotnet publish linux-arm + run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: dotnet publish linux-arm64 + run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: Move Build Output + run: | + mkdir .libsodium-builds + mv .libsodium-test/bin/Release/net6.0/linux-arm/publish .libsodium-builds/linux-arm + mv .libsodium-test/bin/Release/net6.0/linux-arm64/publish .libsodium-builds/linux-arm64 + mv .libsodium-test/bin/Release/net6.0/linux-x64/publish .libsodium-builds/linux-x64 + - uses: actions/upload-artifact@v3 + with: + name: test-builds + path: .libsodium-builds/* + + run-test-binaries-os-versions: + runs-on: ubuntu-latest needs: - build-test-binaries - env: - DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 strategy: matrix: - arch: [x64, arm, arm64] + # CentOS 7 and Debian 10 use an older GCC version; make sure we can run on those platforms. + arch: [ 'centos:7', 'debian:10' ] + container: + image: ${{ matrix.arch }} + env: + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - - name: Set up build environment - run: | - export DEBIAN_FRONTEND=noninteractive - - cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse - deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse - EOF - - sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list - - sudo dpkg --add-architecture armhf - sudo dpkg --add-architecture arm64 - - sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64 - - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: test-builds path: .libsodium-builds/ - - - name: Run ${{ matrix.arch }} + - name: Run x64 tests run: | - chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests - .libsodium-builds/linux-${{ matrix.arch }}/Tests + chmod +x .libsodium-builds/linux-x64/Tests + .libsodium-builds/linux-x64/Tests + run-test-binaries-cross-plat: + runs-on: ubuntu-22.04 + needs: + - build-test-binaries + env: + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + strategy: + matrix: + include: + - arch: x64 + libs: /usr/lib + - arch: arm + libs: /usr/arm-linux-gnueabihf/lib + - arch: arm64 + libs: /usr/aarch64-linux-gnu/lib + arch: [x64, arm, arm64] + steps: + - name: Set up build environment + run: | + export DEBIAN_FRONTEND=noninteractive + + # On virtualization systems such as the one used by WSL2, the ARM crypto extensions + # don't work as expected. As a result, installing on Ubuntu fails during integrity + # checks. As a workaround, the following command disables hardware acceleration for + # gcrypt, which the apt-get command relies on. + sudo mkdir -p /etc/gcrypt && echo all | sudo tee /etc/gcrypt/hwf.deny + + sudo apt-get update && sudo apt-get install -y qemu binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libc6-armhf-cross libc6-arm64-cross + sudo dpkg --add-architecture armhf + sudo dpkg --add-architecture arm64 + sudo update-binfmts --enable qemu-aarch64 + sudo update-binfmts --enable qemu-arm + sudo update-binfmts --display + sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib + sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib + + - uses: actions/download-artifact@v3 + with: + name: test-builds + path: .libsodium-builds/ + + - name: Run ${{ matrix.arch }} + run: | + chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests + env LD_LIBRARY_PATH=${{ matrix.libs }} .libsodium-builds/linux-${{ matrix.arch }}/Tests \ No newline at end of file diff --git a/src/libsodium/.gitignore b/src/libsodium/.gitignore index c842285d3..be1e7d3c1 100644 --- a/src/libsodium/.gitignore +++ b/src/libsodium/.gitignore @@ -80,6 +80,8 @@ test-driver test/default/*.asm.js test/default/*.res test/default/*.trs +test/default/aead_aegis128l +test/default/aead_aegis256 test/default/aead_aes256gcm test/default/aead_aes256gcm2 test/default/aead_chacha20poly1305 @@ -117,6 +119,7 @@ test/default/generichash3 test/default/hash test/default/hash3 test/default/kdf +test/default/kdf_hkdf test/default/keygen test/default/kx test/default/metamorphic @@ -143,7 +146,7 @@ test/default/secretbox7 test/default/secretbox8 test/default/secretbox_easy test/default/secretbox_easy2 -test/default/secretstream +test/default/secretstream_xchacha20poly1305 test/default/shorthash test/default/sign test/default/siphashx24 @@ -160,3 +163,5 @@ test/default/verify1 test/default/xchacha20 test/js.done testing +zig-cache +zig-out diff --git a/src/libsodium/AUTHORS b/src/libsodium/AUTHORS index f4a4b9d88..597b2c6d0 100644 --- a/src/libsodium/AUTHORS +++ b/src/libsodium/AUTHORS @@ -45,8 +45,7 @@ siphash Jean-Philippe Aumasson Implementors ============ -crypto_aead/aes256gcm/aesni Romain Dolbeau - Frank Denis +crypto_aead/aes256gcm/aesni Frank Denis crypto_aead/chacha20poly1305 Frank Denis diff --git a/src/libsodium/CITATION.cff b/src/libsodium/CITATION.cff new file mode 100644 index 000000000..209028074 --- /dev/null +++ b/src/libsodium/CITATION.cff @@ -0,0 +1,18 @@ +cff-version: 1.2.0 +title: libsodium +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - given-names: Frank + family-names: Denis + orcid: 'https://orcid.org/0009-0008-4417-1713' +repository-code: 'https://github.com/jedisct1/libsodium' +url: 'https://libsodium.org' +abstract: 'A modern, portable, easy-to-use cryptographic library.' +keywords: + - cryptography + - library + - nacl +license: ISC diff --git a/src/libsodium/ChangeLog b/src/libsodium/ChangeLog index 9388fd101..d394f8295 100644 --- a/src/libsodium/ChangeLog +++ b/src/libsodium/ChangeLog @@ -1,3 +1,91 @@ +* Version 1.0.20 + This point release includes all the changes from 1.0.19-stable, +mainly addressing compilation issues and improvements to the .NET +packages. + +* Version 1.0.19-stable + - Building with `zig build` now requires Zig 0.12. + - When using the traditional build system, -O3 is used instead of -Ofast. + - Improved detection of the compiler flags required on aarch64. + - Improved compatibility with custom build systems on aarch64. + - apple-xcframework: VisionOS packages are not built if Xcode doesn't +include that SDK. + - `crypto_kdf_hkdf_sha512_statebytes()` was added. + - When using Visual Studio, runtime CPU feature detection is now enabled +on Windows/aarch64. + - There were issues with C++ guards affecting usage of libsodium +using Swift on Windows. This has been fixed. + - Emscripten: `crypto_aead_aegis*()` functions are now exported in +JavaScript builds + - Emscripten: unsupported `--memory-init-file` option has been removed. + - apple-xcframework: the minimal deployment target can be set to iOS 11+. + - .NET packages now include precompiled libraries for Windows/arm64, +iOS, TvOS and Catalyst. + - .NET precompiled libraries now work on any CPUs, using only runtime +feature detection. + - SYSV assembly should not be used when targeting Windows (reported by +@meiyese, thanks!) + - Compatibility issues with LLVM 18 and AVX512 have been addressed. + - GitHub attestation build provenance are now added to NuGet packages. + - JavaScript tests can now use Bun as an alternative to Node. + +* Version 1.0.19 + This release includes all the changes from 1.0.18-stable, as well as two +additions: + + - New AEADs: AEGIS-128L and AEGIS-256 are now available in the +`crypto_aead_aegis128l_*()` and `crypto_aead_aegis256_*()` namespaces. +AEGIS is a family of authenticated ciphers for high-performance applications, +leveraging hardware AES acceleration on `x86_64` and `aarch64`. In addition +to performance, AEGIS ciphers have unique properties making them easier and +safer to use than AES-GCM. They can also be used as high-performance MACs. + - The HKDF key derivation mechanism, required by many standard protocols, is +now available in the `crypto_kdf_hkdf_*()` namespace. It is implemented for +the SHA-256 and SHA-512 hash functions. + - The `osx.sh` build script was renamed to `macos.sh`. + - Support for android-mips was removed. + +* Version 1.0.18-stable + - Visual Studio: support for Windows/ARM64 builds has been added. + - Visual Studio: AVX512 implementations are enabled on supported CPUs. + - Visual Studio: an MSVC 2022 solution was added. + - Apple XCFramework: support for VisionOS was added. + - Apple XCFramework: support for Catalyst was added. + - Apple XCFramework: building the simulators is now optional. + - iOS: bitcode is not generated any more, as it was deprecated by Apple. + - watchOS: support for arm64 was added. + - The Zig toolchain can now be used as a modern build system to replace +autoconf/automake/libtool/make/ccache and the compiler. This enables faster +compilation times, easier cross compilation, and static libraries optimized +for any CPU. + - The Zig toolchain is now the recommended way to compile `libsodium` +to WebAssembly/WASI(X). + - libsodium can now be added as a dependency to Zig projects. + - Memory fences were added to remove some gadgets that could be used +alongside speculative loads. + - The AES-GCM implementation was completely rewritten. It is now faster, +and also available on aarch64, including Windows/ARM64. + - Compatibility with CET instrumentation / IBT / Shadow Stack was added. + - Emscripten: the `crypto_pwhash_*()` functions have been removed from Sumo +builds, as they reserve a substantial amount of JavaScript memory, even when +not used. + - Benchmarks now use `CLOCK_MONOTONIC` if possible. + - WebAssembly: tests can now run using Bun, WasmEdge, Wazero, wasm3 and +wasmer-js. Support for WAVM and Lucet have been removed, as these projects +have reached EOL. + - .NET: the minimum supported macOS version is now 1.0.15; this matches +Microsoft guidelines. + - .NET: all the packages are now built using Zig, on all platforms. This +allows us to easily match Microsoft's requirements, including supported glibc +versions. However, on x86_64, targets are expected to support at least the +AVX instruction set. + - .NET: packages for ARM64 are now available. + - C23 `memset_explicit()` is now used, when available. + - Compilation now uses `-Ofast` or `-O3` instead of `-O2` by default. + - Portability improvements to help compile libsodium to modern game consoles. + - JavaScript: a default `unhandledRejection` handler is not set any more. + - Slightly faster 25519 operations. + - OpenBSD: leverage `MAP_CONCEAL`. * Version 1.0.18 - Enterprise versions of Visual Studio are now supported. @@ -29,6 +117,12 @@ to be `NULL`. - The `-ftree-vectorize` and `-ftree-slp-vectorize` compiler switches are now used, if available, for optimized builds. +* Version 1.0.17-stable + - AVX512 detection has been improved. + - A compilation option was added to enable retpoline support. + - `-ftls-model=global-dynamic` is now set, if available. + - Portability and documentation improvements. + * 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/src/libsodium/LICENSE b/src/libsodium/LICENSE index 5336e429e..6bce7f058 100644 --- a/src/libsodium/LICENSE +++ b/src/libsodium/LICENSE @@ -1,7 +1,7 @@ /* * ISC License * - * Copyright (c) 2013-2021 + * Copyright (c) 2013-2024 * Frank Denis * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index 1f43ff317..7fc179281 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -2,9 +2,9 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ - libsodium.sln \ - libsodium.vcxproj \ - libsodium.vcxproj.filters \ + build.zig \ + ChangeLog \ + CITATION.cff \ LICENSE \ README.markdown \ THANKS @@ -13,7 +13,6 @@ SUBDIRS = \ builds \ contrib \ dist-build \ - msvc-scripts \ src \ test diff --git a/src/libsodium/Makefile.in b/src/libsodium/Makefile.in index cfb207e10..23c8efdf1 100644 --- a/src/libsodium/Makefile.in +++ b/src/libsodium/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -194,9 +194,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/libsodium-uninstalled.pc.in \ @@ -270,6 +267,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -282,6 +280,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -298,8 +298,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -421,9 +423,9 @@ valgrind_tools = @valgrind_tools@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ - libsodium.sln \ - libsodium.vcxproj \ - libsodium.vcxproj.filters \ + build.zig \ + ChangeLog \ + CITATION.cff \ LICENSE \ README.markdown \ THANKS @@ -432,7 +434,6 @@ SUBDIRS = \ builds \ contrib \ dist-build \ - msvc-scripts \ src \ test @@ -617,7 +618,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/README.markdown b/src/libsodium/README.markdown index 940c5c001..41d99f2a4 100644 --- a/src/libsodium/README.markdown +++ b/src/libsodium/README.markdown @@ -23,12 +23,10 @@ as well as Javascript and Webassembly. ## Documentation -The documentation is available on Gitbook and built from the [libsodium-doc](https://github.com/jedisct1/libsodium-doc) repository: +The documentation is available on Gitbook and built from the +[libsodium-doc](https://github.com/jedisct1/libsodium-doc) repository: -* [libsodium documentation](https://download.libsodium.org/doc/) - -online, requires Javascript. -* [offline documentation](https://www.gitbook.com/book/jedisct1/libsodium/details) -in PDF format. +* [libsodium documentation](https://doc.libsodium.org) - online, requires Javascript. ## Integrity Checking diff --git a/src/libsodium/aclocal.m4 b/src/libsodium/aclocal.m4 index 243e15a2c..ec19ad09c 100644 --- a/src/libsodium/aclocal.m4 +++ b/src/libsodium/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.3], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.3])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -130,7 +130,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -161,7 +161,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -352,7 +352,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -420,7 +420,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -448,6 +448,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -484,7 +488,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -536,6 +540,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -617,7 +635,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -638,7 +656,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -660,7 +678,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -695,7 +713,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -738,7 +756,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -772,7 +790,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -801,7 +819,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -848,7 +866,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -867,7 +885,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -948,7 +966,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1008,7 +1026,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1036,7 +1054,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1055,7 +1073,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/libsodium/appveyor.yml b/src/libsodium/appveyor.yml index 5fdcdc8a4..f272ff6c4 100644 --- a/src/libsodium/appveyor.yml +++ b/src/libsodium/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.18.{build} +version: 1.0.20.{build} os: Visual Studio 2017 @@ -20,5 +20,5 @@ init: msbuild /version build: parallel: true - project: libsodium.vcxproj - verbosity: minimal + project: ci/appveyor/libsodium.vcxproj + verbosity: normal diff --git a/src/libsodium/azure-pipelines.yml b/src/libsodium/azure-pipelines.yml index 3ce8a1cf7..615415281 100644 --- a/src/libsodium/azure-pipelines.yml +++ b/src/libsodium/azure-pipelines.yml @@ -5,37 +5,13 @@ trigger: pr: none jobs: - - job: "wasi" - pool: - vmImage: "ubuntu-20.04" - steps: - - script: | - sudo apt-get install build-essential curl cmake lld - displayName: Install system packages - - script: | - curl https://get.wasmer.io -sSfL | sh - displayName: Install wasmer - - script: | - curl -sL -o - https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz | tar xJ -f - -C /opt/ - sudo mv /opt/zig-* /opt/zig - env PATH=/opt/zig/bin:/opt/zig:$PATH - displayName: Install the Zig SDK - - script: | - env WASMER_DIR=${HOME}/.wasmer PATH=${HOME}/.wasmer/bin:/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" + vmImage: "windows-2022" steps: - powershell: | cd builds\msvc\build - & .\buildbase.bat ..\vs2019\libsodium.sln 16 + & .\buildbase.bat ..\vs2022\libsodium.sln 17 displayName: Compile it all - powershell: | mkdir bin\include\sodium @@ -48,14 +24,19 @@ jobs: pathToPublish: bin artifactName: libsodium - - job: "windows_old" + - job: "windows_2019" pool: - vmImage: "vs2017-win2016" + vmImage: "windows-2019" steps: - powershell: | cd builds\msvc\build - & .\buildbase.bat ..\vs2017\libsodium.sln 15 + & .\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: @@ -67,7 +48,7 @@ jobs: vmImage: "windows-2019" steps: - powershell: | - (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe", "sfx.exe") + (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2024-05-07/msys2-base-x86_64-20240507.sfx.exe", "sfx.exe") .\sfx.exe -y -o\ del sfx.exe displayName: Install MSYS2 @@ -106,7 +87,7 @@ jobs: vmImage: "windows-2019" steps: - powershell: | - (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe", "sfx.exe") + (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2024-05-07/msys2-base-x86_64-20240507.sfx.exe", "sfx.exe") .\sfx.exe -y -o\ del sfx.exe displayName: Install MSYS2 diff --git a/src/libsodium/build-aux/compile b/src/libsodium/build-aux/compile index 23fcba011..df363c8fb 100755 --- a/src/libsodium/build-aux/compile +++ b/src/libsodium/build-aux/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff --git a/src/libsodium/build-aux/config.guess b/src/libsodium/build-aux/config.guess index f7727026b..7f76b6228 100755 --- a/src/libsodium/build-aux/config.guess +++ b/src/libsodium/build-aux/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2021-01-01' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -32,7 +34,15 @@ timestamp='2021-01-01' # Please send patches to . -me=$(echo "$0" | sed -e 's,.*/,,') +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,6 +94,9 @@ if test $# != 0; then exit 1 fi +# Just in case it came from the environment. +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -102,8 +115,8 @@ set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } @@ -112,7 +125,7 @@ set_cc_for_build() { ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -131,12 +144,12 @@ if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown -UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown -UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown -UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown @@ -157,7 +170,8 @@ Linux|GNU|GNU/*) #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && @@ -176,7 +190,7 @@ esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -188,12 +202,11 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)) - case "$UNAME_MACHINE_ARCH" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; @@ -201,15 +214,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') - endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') - machine="${arch}${endian}"-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -230,10 +243,10 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -241,76 +254,82 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) - case "$ALPHA_CPU_TYPE" in + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -347,68 +366,69 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case $(/usr/bin/uname -p) in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 @@ -417,47 +437,50 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "$(/usr/bin/arch -k)" in + case `/usr/bin/arch -k` in Series*|S4*) - UNAME_RELEASE=$(uname -v) + UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "$(/bin/arch)" in + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -467,41 +490,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -526,78 +549,79 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && - SYSTEM_NAME=$("$dummy" "$dummyarg") && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then - IBM_REV=$(/usr/bin/oslevel) + IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -612,68 +636,68 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) - IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then - IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - case "$UNAME_MACHINE" in + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then - sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) - sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) - case "$sc_cpu_version" in + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 @@ -715,7 +739,7 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac @@ -740,12 +764,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -773,38 +797,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -812,17 +836,18 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -830,114 +855,129 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=$(/usr/bin/uname -p) - case "$UNAME_PROCESSOR" in + UNAME_PROCESSOR=`/usr/bin/uname -p` + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -948,63 +988,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1049,65 +1089,66 @@ EOF #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC @@ -1116,71 +1157,71 @@ EOF (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then - LIBCABI="$LIBC"x32 + LIBCABI=${LIBC}x32 fi fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; i*86:*:4.*:*) - UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case $(/bin/uname -X | grep "^Machine") in + case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1188,11 +1229,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1200,37 +1241,37 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1241,7 +1282,7 @@ EOF NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1249,118 +1290,118 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1394,109 +1435,119 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" </dev/null); + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1628,7 +1679,7 @@ main () } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1636,7 +1687,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown) -uname -r = $( (uname -r) 2>/dev/null || echo unknown) -uname -s = $( (uname -s) 2>/dev/null || echo unknown) -uname -v = $( (uname -v) 2>/dev/null || echo unknown) +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) -/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` -hostinfo = $( (hostinfo) 2>/dev/null) -/bin/universe = $( (/bin/universe) 2>/dev/null) -/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) -/bin/arch = $( (/bin/arch) 2>/dev/null) -/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) -/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" diff --git a/src/libsodium/build-aux/config.sub b/src/libsodium/build-aux/config.sub index d80c5d759..2c6a07ab3 100644 --- a/src/libsodium/build-aux/config.sub +++ b/src/libsodium/build-aux/config.sub @@ -1,14 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2021 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-07-03' +timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -76,13 +76,13 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2021 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -121,14 +121,16 @@ esac # Split fields of configuration type # shellcheck disable=SC2162 +saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -143,7 +145,8 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -172,6 +175,10 @@ case $1 in basic_machine=$field1 basic_os=$field2 ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ @@ -931,11 +938,13 @@ case $basic_machine in *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1293,11 +1287,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then -# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1313,9 +1308,11 @@ case $basic_os in ;; *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read kernel os <&2 + fi + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- ) + ;; + uclinux-uclibc*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) ;; - uclinux-uclibc* ) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -uclibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 ;; - nto-qnx*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - os2-emx) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - -*) + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1862,7 +1960,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/src/libsodium/build-aux/depcomp b/src/libsodium/build-aux/depcomp index 6b391623c..715e34311 100755 --- a/src/libsodium/build-aux/depcomp +++ b/src/libsodium/build-aux/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/libsodium/build-aux/ltmain.sh b/src/libsodium/build-aux/ltmain.sh index 0f0a2da3f..2a50d7f6f 100644 --- a/src/libsodium/build-aux/ltmain.sh +++ b/src/libsodium/build-aux/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1708,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1730,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1751,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1761,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1801,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1830,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1859,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1871,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1883,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1918,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1974,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2008,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2067,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2083,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2095,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2121,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2163,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2210,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,7 +2306,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2124,7 +2362,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2270,6 +2508,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2533,16 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2554,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2634,20 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2451,8 +2704,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3671,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3745,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3901,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4008,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4352,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4363,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4165,12 +4421,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4437,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4734,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5514,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5525,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6868,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7106,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7283,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7303,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7333,20 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7487,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7503,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7535,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7272,12 +7553,17 @@ func_mode_link () # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7298,15 +7584,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7426,8 +7712,8 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8632,7 +8918,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8805,7 +9091,7 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8896,7 +9182,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9122,7 +9408,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9933,8 +10219,8 @@ EOF for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10027,8 +10313,8 @@ EOF eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10502,12 +10788,13 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10747,13 +11034,15 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/src/libsodium/build-aux/missing b/src/libsodium/build-aux/missing index 8d0eaad25..1fe1611f1 100755 --- a/src/libsodium/build-aux/missing +++ b/src/libsodium/build-aux/missing @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff --git a/src/libsodium/build-aux/test-driver b/src/libsodium/build-aux/test-driver index 9759384aa..be73b80ad 100755 --- a/src/libsodium/build-aux/test-driver +++ b/src/libsodium/build-aux/test-driver @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -105,8 +105,11 @@ trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -128,7 +131,7 @@ esac # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff --git a/src/libsodium/build.zig b/src/libsodium/build.zig new file mode 100644 index 000000000..d15afdc6b --- /dev/null +++ b/src/libsodium/build.zig @@ -0,0 +1,280 @@ +const std = @import("std"); +const fmt = std.fmt; +const fs = std.fs; +const heap = std.heap; +const mem = std.mem; +const Compile = std.Build.Step.Compile; +const Target = std.Target; + +fn initLibConfig(b: *std.Build, target: std.Build.ResolvedTarget, lib: *Compile) void { + lib.linkLibC(); + lib.addIncludePath(b.path("src/libsodium/include/sodium")); + lib.defineCMacro("_GNU_SOURCE", "1"); + lib.defineCMacro("CONFIGURED", "1"); + lib.defineCMacro("DEV_MODE", "1"); + lib.defineCMacro("HAVE_ATOMIC_OPS", "1"); + lib.defineCMacro("HAVE_C11_MEMORY_FENCES", "1"); + lib.defineCMacro("HAVE_CET_H", "1"); + lib.defineCMacro("HAVE_GCC_MEMORY_FENCES", "1"); + lib.defineCMacro("HAVE_INLINE_ASM", "1"); + lib.defineCMacro("HAVE_INTTYPES_H", "1"); + lib.defineCMacro("HAVE_STDINT_H", "1"); + lib.defineCMacro("HAVE_TI_MODE", "1"); + lib.want_lto = false; + + const endian = target.result.cpu.arch.endian(); + switch (endian) { + .big => lib.defineCMacro("NATIVE_BIG_ENDIAN", "1"), + .little => lib.defineCMacro("NATIVE_LITTLE_ENDIAN", "1"), + } + + switch (target.result.os.tag) { + .linux => { + lib.defineCMacro("ASM_HIDE_SYMBOL", ".hidden"); + lib.defineCMacro("TLS", "_Thread_local"); + + lib.defineCMacro("HAVE_CATCHABLE_ABRT", "1"); + lib.defineCMacro("HAVE_CATCHABLE_SEGV", "1"); + lib.defineCMacro("HAVE_CLOCK_GETTIME", "1"); + lib.defineCMacro("HAVE_GETPID", "1"); + lib.defineCMacro("HAVE_MADVISE", "1"); + lib.defineCMacro("HAVE_MLOCK", "1"); + lib.defineCMacro("HAVE_MMAP", "1"); + lib.defineCMacro("HAVE_MPROTECT", "1"); + lib.defineCMacro("HAVE_NANOSLEEP", "1"); + lib.defineCMacro("HAVE_POSIX_MEMALIGN", "1"); + lib.defineCMacro("HAVE_PTHREAD_PRIO_INHERIT", "1"); + lib.defineCMacro("HAVE_PTHREAD", "1"); + lib.defineCMacro("HAVE_RAISE", "1"); + lib.defineCMacro("HAVE_SYSCONF", "1"); + lib.defineCMacro("HAVE_SYS_AUXV_H", "1"); + lib.defineCMacro("HAVE_SYS_MMAN_H", "1"); + lib.defineCMacro("HAVE_SYS_PARAM_H", "1"); + lib.defineCMacro("HAVE_SYS_RANDOM_H", "1"); + lib.defineCMacro("HAVE_WEAK_SYMBOLS", "1"); + }, + .windows => { + lib.defineCMacro("HAVE_RAISE", "1"); + lib.defineCMacro("HAVE_SYS_PARAM_H", "1"); + if (lib.isStaticLibrary()) { + lib.defineCMacro("SODIUM_STATIC", "1"); + } + }, + .macos => { + lib.defineCMacro("ASM_HIDE_SYMBOL", ".private_extern"); + lib.defineCMacro("TLS", "_Thread_local"); + + lib.defineCMacro("HAVE_ARC4RANDOM", "1"); + lib.defineCMacro("HAVE_ARC4RANDOM_BUF", "1"); + lib.defineCMacro("HAVE_CATCHABLE_ABRT", "1"); + lib.defineCMacro("HAVE_CATCHABLE_SEGV", "1"); + lib.defineCMacro("HAVE_CLOCK_GETTIME", "1"); + lib.defineCMacro("HAVE_GETENTROPY", "1"); + lib.defineCMacro("HAVE_GETPID", "1"); + lib.defineCMacro("HAVE_MADVISE", "1"); + lib.defineCMacro("HAVE_MEMSET_S", "1"); + lib.defineCMacro("HAVE_MLOCK", "1"); + lib.defineCMacro("HAVE_MMAP", "1"); + lib.defineCMacro("HAVE_MPROTECT", "1"); + lib.defineCMacro("HAVE_NANOSLEEP", "1"); + lib.defineCMacro("HAVE_POSIX_MEMALIGN", "1"); + lib.defineCMacro("HAVE_PTHREAD", "1"); + lib.defineCMacro("HAVE_PTHREAD_PRIO_INHERIT", "1"); + lib.defineCMacro("HAVE_RAISE", "1"); + lib.defineCMacro("HAVE_SYSCONF", "1"); + lib.defineCMacro("HAVE_SYS_MMAN_H", "1"); + lib.defineCMacro("HAVE_SYS_PARAM_H", "1"); + lib.defineCMacro("HAVE_SYS_RANDOM_H", "1"); + lib.defineCMacro("HAVE_WEAK_SYMBOLS", "1"); + }, + .wasi => { + lib.defineCMacro("HAVE_ARC4RANDOM", "1"); + lib.defineCMacro("HAVE_ARC4RANDOM_BUF", "1"); + lib.defineCMacro("HAVE_CLOCK_GETTIME", "1"); + lib.defineCMacro("HAVE_GETENTROPY", "1"); + lib.defineCMacro("HAVE_NANOSLEEP", "1"); + lib.defineCMacro("HAVE_POSIX_MEMALIGN", "1"); + lib.defineCMacro("HAVE_SYS_AUXV_H", "1"); + lib.defineCMacro("HAVE_SYS_PARAM_H", "1"); + lib.defineCMacro("HAVE_SYS_RANDOM_H", "1"); + }, + else => {}, + } + + switch (target.result.cpu.arch) { + .x86_64 => { + switch (target.result.os.tag) { + .windows => {}, + else => { + lib.defineCMacro("HAVE_AMD64_ASM", "1"); + lib.defineCMacro("HAVE_AVX_ASM", "1"); + }, + } + lib.defineCMacro("HAVE_CPUID", "1"); + lib.defineCMacro("HAVE_MMINTRIN_H", "1"); + lib.defineCMacro("HAVE_EMMINTRIN_H", "1"); + lib.defineCMacro("HAVE_PMMINTRIN_H", "1"); + lib.defineCMacro("HAVE_TMMINTRIN_H", "1"); + lib.defineCMacro("HAVE_SMMINTRIN_H", "1"); + lib.defineCMacro("HAVE_AVXINTRIN_H", "1"); + lib.defineCMacro("HAVE_AVX2INTRIN_H", "1"); + lib.defineCMacro("HAVE_AVX512FINTRIN_H", "1"); + lib.defineCMacro("HAVE_WMMINTRIN_H", "1"); + lib.defineCMacro("HAVE_RDRAND", "1"); + }, + .aarch64, .aarch64_be => { + lib.defineCMacro("HAVE_ARMCRYPTO", "1"); + }, + .wasm32, .wasm64 => { + lib.defineCMacro("__wasm__", "1"); + }, + else => {}, + } + + switch (target.result.os.tag) { + .wasi => { + lib.defineCMacro("__wasi__", "1"); + }, + else => {}, + } +} + +pub fn build(b: *std.Build) !void { + const root_path = b.pathFromRoot("."); + var cwd = try fs.openDirAbsolute(root_path, .{}); + defer cwd.close(); + + const src_path = "src/libsodium"; + const src_dir = try fs.Dir.openDir(cwd, src_path, .{ .iterate = true, .no_follow = true }); + + var target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const enable_benchmarks = b.option(bool, "enable_benchmarks", "Whether tests should be benchmarks.") orelse false; + const benchmarks_iterations = b.option(u32, "iterations", "Number of iterations for benchmarks.") orelse 200; + var build_static = b.option(bool, "static", "Build libsodium as a static library.") orelse true; + var build_shared = b.option(bool, "shared", "Build libsodium as a shared library.") orelse true; + + const build_tests = b.option(bool, "test", "Build the tests (implies -Dstatic=true)") orelse true; + + if (target.result.isWasm()) { + build_shared = false; + } + if (build_tests) { + build_static = true; + } + + switch (target.result.cpu.arch) { + .aarch64, .aarch64_be, .aarch64_32 => { + // ARM CPUs supported by Windows are assumed to have NEON support + if (target.result.isMinGW()) { + target.query.cpu_features_add.addFeature(@intFromEnum(Target.aarch64.Feature.neon)); + } + }, + else => {}, + } + + const static_lib = b.addStaticLibrary(.{ + .name = if (target.result.isMinGW()) "libsodium-static" else "sodium", + .target = target, + .optimize = optimize, + }); + const shared_lib = b.addSharedLibrary(.{ + .name = if (target.result.isMinGW()) "libsodium" else "sodium", + .target = target, + .optimize = optimize, + .strip = optimize != .Debug and !target.result.isMinGW(), + }); + + // work out which libraries we are building + var libs = std.ArrayList(*Compile).init(b.allocator); + defer libs.deinit(); + if (build_static) { + try libs.append(static_lib); + } + if (build_shared) { + try libs.append(shared_lib); + } + + const prebuilt_version_file_path = "builds/msvc/version.h"; + const version_file_path = "include/sodium/version.h"; + + if (src_dir.access(version_file_path, .{ .mode = .read_only })) {} else |_| { + try cwd.copyFile(prebuilt_version_file_path, src_dir, version_file_path, .{}); + } + + for (libs.items) |lib| { + b.installArtifact(lib); + lib.installHeader(b.path(src_path ++ "/include/sodium.h"), "sodium.h"); + lib.installHeadersDirectory(b.path(src_path ++ "/include/sodium"), "sodium", .{}); + + initLibConfig(b, target, lib); + + const flags = &.{ + "-fvisibility=hidden", + "-fno-strict-aliasing", + "-fno-strict-overflow", + "-fwrapv", + "-flax-vector-conversions", + }; + + const allocator = heap.page_allocator; + + var walker = try src_dir.walk(allocator); + while (try walker.next()) |entry| { + const name = entry.basename; + if (mem.endsWith(u8, name, ".c")) { + const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path }); + + lib.addCSourceFiles(.{ + .files = &.{full_path}, + .flags = flags, + }); + } else if (mem.endsWith(u8, name, ".S")) { + const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path }); + lib.addAssemblyFile(b.path(full_path)); + } + } + } + + const test_path = "test/default"; + const out_bin_path = "zig-out/bin"; + const test_dir = try fs.Dir.openDir(cwd, test_path, .{ .iterate = true, .no_follow = true }); + fs.Dir.makePath(cwd, out_bin_path) catch {}; + const out_bin_dir = try fs.Dir.openDir(cwd, out_bin_path, .{}); + try test_dir.copyFile("run.sh", out_bin_dir, "run.sh", .{}); + const allocator = heap.page_allocator; + var walker = try test_dir.walk(allocator); + if (build_tests) { + while (try walker.next()) |entry| { + const name = entry.basename; + if (mem.endsWith(u8, name, ".exp")) { + try test_dir.copyFile(name, out_bin_dir, name, .{}); + continue; + } + if (!mem.endsWith(u8, name, ".c")) { + continue; + } + const exe_name = name[0 .. name.len - 2]; + var exe = b.addExecutable(.{ + .name = exe_name, + .target = target, + .optimize = optimize, + .strip = true, + }); + exe.linkLibC(); + exe.linkLibrary(static_lib); + exe.addIncludePath(b.path("src/libsodium/include")); + exe.addIncludePath(b.path("test/quirks")); + const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ test_path, entry.path }); + exe.addCSourceFiles(.{ .files = &.{full_path} }); + if (enable_benchmarks) { + exe.defineCMacro("BENCHMARKS", "1"); + var buf: [16]u8 = undefined; + exe.defineCMacro("ITERATIONS", std.fmt.bufPrintIntToSlice(&buf, benchmarks_iterations, 10, .lower, .{})); + } + + b.installArtifact(exe); + } + } +} diff --git a/src/libsodium/builds/Makefile.am b/src/libsodium/builds/Makefile.am index 23dfe9d23..f6974bef5 100644 --- a/src/libsodium/builds/Makefile.am +++ b/src/libsodium/builds/Makefile.am @@ -1,6 +1,7 @@ EXTRA_DIST = \ msvc/build/buildall.bat \ msvc/build/buildbase.bat \ + msvc/properties/ARM64.props \ msvc/properties/Common.props \ msvc/properties/Debug.props \ msvc/properties/DebugDEXE.props \ @@ -69,4 +70,12 @@ EXTRA_DIST = \ msvc/vs2019/libsodium/libsodium.xml \ msvc/vs2019/libsodium.import.props \ msvc/vs2019/libsodium.import.xml \ - msvc/vs2019/libsodium.sln + msvc/vs2019/libsodium.sln \ + msvc/vs2022/libsodium.sln \ + msvc/vs2022/libsodium/libsodium.props \ + msvc/vs2022/libsodium/libsodium.vcxproj \ + msvc/vs2022/libsodium/libsodium.vcxproj.filters \ + msvc/vs2022/libsodium/libsodium.xml \ + msvc/vs2022/libsodium.import.props \ + msvc/vs2022/libsodium.import.xml \ + msvc/vs2022/libsodium.sln diff --git a/src/libsodium/builds/Makefile.in b/src/libsodium/builds/Makefile.in index e7d00deff..b4896ab99 100644 --- a/src/libsodium/builds/Makefile.in +++ b/src/libsodium/builds/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -146,6 +146,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -158,6 +159,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -174,8 +177,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -297,6 +302,7 @@ valgrind_tools = @valgrind_tools@ EXTRA_DIST = \ msvc/build/buildall.bat \ msvc/build/buildbase.bat \ + msvc/properties/ARM64.props \ msvc/properties/Common.props \ msvc/properties/Debug.props \ msvc/properties/DebugDEXE.props \ @@ -365,7 +371,15 @@ EXTRA_DIST = \ msvc/vs2019/libsodium/libsodium.xml \ msvc/vs2019/libsodium.import.props \ msvc/vs2019/libsodium.import.xml \ - msvc/vs2019/libsodium.sln + msvc/vs2019/libsodium.sln \ + msvc/vs2022/libsodium.sln \ + msvc/vs2022/libsodium/libsodium.props \ + msvc/vs2022/libsodium/libsodium.vcxproj \ + msvc/vs2022/libsodium/libsodium.vcxproj.filters \ + msvc/vs2022/libsodium/libsodium.xml \ + msvc/vs2022/libsodium.import.props \ + msvc/vs2022/libsodium.import.xml \ + msvc/vs2022/libsodium.sln all: all-am @@ -411,7 +425,6 @@ ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/builds/msvc/build/buildall.bat b/src/libsodium/builds/msvc/build/buildall.bat index 4f0b42110..93dd27d86 100644 --- a/src/libsodium/builds/msvc/build/buildall.bat +++ b/src/libsodium/builds/msvc/build/buildall.bat @@ -1,5 +1,7 @@ @ECHO OFF +CALL buildbase.bat ..\vs2022\libsodium.sln 17 +ECHO. CALL buildbase.bat ..\vs2019\libsodium.sln 16 ECHO. CALL buildbase.bat ..\vs2017\libsodium.sln 15 diff --git a/src/libsodium/builds/msvc/build/buildbase.bat b/src/libsodium/builds/msvc/build/buildbase.bat index b68cd2ca8..933527322 100644 --- a/src/libsodium/builds/msvc/build/buildbase.bat +++ b/src/libsodium/builds/msvc/build/buildbase.bat @@ -8,6 +8,17 @@ SET version=%2 SET log=build_%version%.log SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat +IF %version% == 17 ( + SET tools=Microsoft Visual Studio\2022\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\2022\Community\VC\Auxiliary\Build\vcvarsall.bat + ) + ) +) + IF %version% == 16 ( SET tools=Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat SET environment="%programfiles%\!tools!" diff --git a/src/libsodium/builds/msvc/properties/ARM64.props b/src/libsodium/builds/msvc/properties/ARM64.props new file mode 100644 index 000000000..a5b8f5467 --- /dev/null +++ b/src/libsodium/builds/msvc/properties/ARM64.props @@ -0,0 +1,23 @@ + + + + + <_PropertySheetDisplayName>ARM64 Settings + + + + + WIN32;_WIN32;WIN64;_WIN64;%(PreprocessorDefinitions) + + + ARM64;%(PreprocessorDefinitions) + + + MachineARM64 + + + /MACHINE:ARM64 %(AdditionalOptions) + + + + diff --git a/src/libsodium/builds/msvc/properties/DebugLIB.props b/src/libsodium/builds/msvc/properties/DebugLIB.props index c5f101282..86eb04495 100644 --- a/src/libsodium/builds/msvc/properties/DebugLIB.props +++ b/src/libsodium/builds/msvc/properties/DebugLIB.props @@ -12,10 +12,10 @@ - OldStyle + ProgramDatabase MultiThreadedDebug true - \ No newline at end of file + diff --git a/src/libsodium/builds/msvc/properties/Release.props b/src/libsodium/builds/msvc/properties/Release.props index 1c5415bcb..1f754ca56 100644 --- a/src/libsodium/builds/msvc/properties/Release.props +++ b/src/libsodium/builds/msvc/properties/Release.props @@ -14,7 +14,7 @@ /Oy- %(AdditionalOptions) - + ProgramDatabase true true OnlyExplicitInline @@ -38,4 +38,4 @@ - \ No newline at end of file + diff --git a/src/libsodium/builds/msvc/resource.rc b/src/libsodium/builds/msvc/resource.rc index feb27d5aa..3697e3ac5 100644 --- a/src/libsodium/builds/msvc/resource.rc +++ b/src/libsodium/builds/msvc/resource.rc @@ -4,14 +4,16 @@ #include "windows.h" //specify the version numbers for the dll's -#define LIBSODIUM_VERSION_STRING "1.0.18.0" -#define LIBSODIUM_VERSION_BIN 1,0,18,0 +#define LIBSODIUM_VERSION_STRING "1.0.20.0" +#define LIBSODIUM_VERSION_BIN 1,0,20,0 //specify the product name for the dlls based on the platform we are compiling for #if defined(x64) #define LIBSODIUM_PRODUCT_NAME "libsodium (x64)" #elif defined(Win32) #define LIBSODIUM_PRODUCT_NAME "libsodium (x86)" +#elif defined(ARM64) + #define LIBSODIUM_PRODUCT_NAME "libsodium (arm64)" #else #define LIBSODIUM_PRODUCT_NAME "libsodium" #endif @@ -44,10 +46,10 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "FileDescription", "The Sodium crypto library (libsodium) " + VALUE "FileDescription", "The Sodium crypto library (libsodium)" VALUE "FileVersion", LIBSODIUM_VERSION_STRING VALUE "InternalName", "libsodium" - VALUE "LegalCopyright", "Copyright (c) 2013-2019 The libsodium authors." + VALUE "LegalCopyright", "Copyright (c) 2013-2024 The libsodium authors." VALUE "OriginalFilename", "libsodium.dll" VALUE "ProductName", LIBSODIUM_PRODUCT_NAME VALUE "ProductVersion", LIBSODIUM_VERSION_STRING diff --git a/src/libsodium/builds/msvc/version.h b/src/libsodium/builds/msvc/version.h index 174d9921e..e07ae90d9 100644 --- a/src/libsodium/builds/msvc/version.h +++ b/src/libsodium/builds/msvc/version.h @@ -4,10 +4,11 @@ #include "export.h" -#define SODIUM_VERSION_STRING "1.0.18" +#define SODIUM_VERSION_STRING "1.0.20" + +#define SODIUM_LIBRARY_VERSION_MAJOR 26 +#define SODIUM_LIBRARY_VERSION_MINOR 2 -#define SODIUM_LIBRARY_VERSION_MAJOR 10 -#define SODIUM_LIBRARY_VERSION_MINOR 3 #ifdef __cplusplus extern "C" { diff --git a/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj index 123ded8ac..744c45abf 100644 --- a/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,50 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 - + ReleaseDLL - x64 - - - DebugLTCG Win32 - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG + + ReleaseDLL x64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + ReleaseLIB + Win32 + ReleaseLIB x64 + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + StaticLibrary @@ -66,16 +67,6 @@ - - - - - - - - - - @@ -113,13 +104,15 @@ - + + + @@ -172,14 +165,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +202,10 @@ + + @@ -222,6 +228,7 @@ + @@ -238,6 +245,7 @@ + @@ -246,6 +254,7 @@ + @@ -256,9 +265,11 @@ + + @@ -305,6 +316,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj index 38de00704..8603afb6c 100644 --- a/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,50 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 - + ReleaseDLL - x64 - - - DebugLTCG Win32 - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG + + ReleaseDLL x64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + ReleaseLIB + Win32 + ReleaseLIB x64 + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + StaticLibrary @@ -66,16 +67,6 @@ - - - - - - - - - - @@ -113,13 +104,15 @@ - + + + @@ -172,14 +165,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +202,10 @@ + + @@ -222,6 +228,7 @@ + @@ -238,6 +245,7 @@ + @@ -246,6 +254,7 @@ + @@ -256,9 +265,11 @@ + + @@ -305,6 +316,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj index e63f6aa26..10bf61c3d 100644 --- a/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,50 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 - + ReleaseDLL - x64 - - - DebugLTCG Win32 - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG + + ReleaseDLL x64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + ReleaseLIB + Win32 + ReleaseLIB x64 + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + StaticLibrary @@ -66,16 +67,6 @@ - - - - - - - - - - @@ -113,13 +104,15 @@ - + + + @@ -172,14 +165,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +202,10 @@ + + @@ -222,6 +228,7 @@ + @@ -238,6 +245,7 @@ + @@ -246,6 +254,7 @@ + @@ -256,9 +265,11 @@ + + @@ -305,6 +316,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj index 24fcca6dc..e53baf0a9 100644 --- a/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,50 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 - + ReleaseDLL - x64 - - - DebugLTCG Win32 - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG + + ReleaseDLL x64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + ReleaseLIB + Win32 + ReleaseLIB x64 + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + StaticLibrary @@ -66,16 +67,6 @@ - - - - - - - - - - @@ -113,13 +104,15 @@ - + + + @@ -172,14 +165,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +202,10 @@ + + @@ -222,6 +228,7 @@ + @@ -238,6 +245,7 @@ + @@ -246,6 +254,7 @@ + @@ -256,9 +265,11 @@ + + @@ -305,6 +316,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj index 9c9e3a5b4..c1286caca 100644 --- a/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,50 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 - + ReleaseDLL - x64 - - - DebugLTCG Win32 - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG + + ReleaseDLL x64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + ReleaseLIB + Win32 + ReleaseLIB x64 + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + StaticLibrary @@ -66,16 +67,6 @@ - - - - - - - - - - @@ -113,13 +104,15 @@ - + + + @@ -172,14 +165,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +202,10 @@ + + @@ -222,6 +228,7 @@ + @@ -238,6 +245,7 @@ + @@ -246,6 +254,7 @@ + @@ -256,9 +265,11 @@ + + @@ -305,6 +316,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj index 06d4f3d3b..5fb34c5c6 100644 --- a/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj +++ b/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj @@ -1,5 +1,6 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium @@ -10,50 +11,74 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 + + DebugDLL + ARM64 + + + ReleaseDLL + Win32 + ReleaseDLL x64 - - DebugLTCG - Win32 + + ReleaseDLL + ARM64 - - ReleaseLTCG + + DebugLIB Win32 - - DebugLTCG - x64 - - - ReleaseLTCG + + DebugLIB x64 - + DebugLIB - Win32 + ARM64 ReleaseLIB Win32 - - DebugLIB + + ReleaseLIB x64 - + ReleaseLIB + ARM64 + + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + DebugLTCG + ARM64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG x64 + + ReleaseLTCG + ARM64 + StaticLibrary @@ -66,16 +91,6 @@ - - - - - - - - - - @@ -113,13 +128,15 @@ - + + + @@ -172,14 +189,25 @@ - + + + + + + + + + + - + + + @@ -198,8 +226,10 @@ + + @@ -222,6 +252,7 @@ + @@ -238,6 +269,7 @@ + @@ -246,6 +278,7 @@ + @@ -256,9 +289,11 @@ + + @@ -305,6 +340,16 @@ + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters index 4967e5b16..d80be171f 100644 --- a/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters +++ b/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters @@ -132,8 +132,8 @@ crypto_pwhash\scryptsalsa208sha256\sse - - crypto_verify\sodium + + crypto_verify crypto_auth @@ -153,6 +153,12 @@ crypto_kdf\blake2b + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + crypto_shorthash @@ -309,14 +315,44 @@ crypto_hash\sha256\cp - - crypto_aead\xchacha20poly1305\sodium + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm crypto_aead\aes256gcm\aesni - - crypto_aead\chacha20poly1305\sodium + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 crypto_secretstream\xchacha20poly1305 @@ -333,6 +369,9 @@ crypto_core\hsalsa20\ref2 + + crypto_core\softaes + crypto_core\ed25519 @@ -383,12 +422,18 @@ include\sodium + + include\sodium + include\sodium include\sodium + + include\sodium + include\sodium @@ -455,6 +500,9 @@ include\sodium + + include\sodium + include\sodium @@ -503,6 +551,9 @@ include\sodium + + include\sodium + include\sodium @@ -527,6 +578,9 @@ include\sodium + + include\sodium + include\sodium @@ -557,6 +611,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -566,6 +623,9 @@ include\sodium\private + + include\sodium\private + include\sodium\private @@ -704,6 +764,36 @@ crypto_stream\salsa20\xmm6 + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + crypto_core\ed25519\ref10\fe_25_5 @@ -733,24 +823,27 @@ {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} {7eb51140-a50f-3f50-b379-83677a82496c} + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} - - {b145288f-68ad-3e79-93cb-e36537b20e26} - {3122f223-e6c2-3ab1-ad85-ca289b47419e} - - {2720c2c8-c517-356e-83ed-c2997ab782c3} - {0a3af0f3-56f7-3551-a64e-6284feccc423} @@ -802,6 +895,9 @@ {eb259fd9-56f0-32db-a903-6bc1549a7326} + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + {e53b6258-fcdd-34c8-96c5-44510a34a390} @@ -832,6 +928,9 @@ {3d42d2a2-b192-33dd-9162-508916414707} + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + {898b6bd5-1360-3a34-adcd-0fade7561685} @@ -964,9 +1063,6 @@ {49fb9272-ffe2-3993-b562-b19d5f2c9b40} - - {80669cf5-3c9c-3c60-b409-9d8fb305bc77} - {96da72eb-3aa0-3850-83eb-32788f91e5bd} diff --git a/src/libsodium/builds/msvc/vs2022/libsodium.import.props b/src/libsodium/builds/msvc/vs2022/libsodium.import.props new file mode 100644 index 000000000..b3d7e4fd8 --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium.import.props @@ -0,0 +1,52 @@ + + + + + <_PropertySheetDisplayName>Libsodium Import Settings + + + + + + + + + + + + + $(ProjectDir)..\..\..\..\..\libsodium\src\libsodium\include;$(ProjectDir)..\..\..\..\..\libsodium\src\libsodium\include\sodium\;%(AdditionalIncludeDirectories) + SODIUM_STATIC;%(PreprocessorDefinitions) + + + advapi32.lib;libsodium.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libsodium)\;%(AdditionalLibraryDirectories) + $(ProjectDir)..\..\..\..\..\libsodium\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libsodium)\;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/libsodium/builds/msvc/vs2022/libsodium.import.xml b/src/libsodium/builds/msvc/vs2022/libsodium.import.xml new file mode 100644 index 000000000..dbcf4e5ab --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium.import.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/libsodium/builds/msvc/vs2022/libsodium.sln b/src/libsodium/builds/msvc/vs2022/libsodium.sln new file mode 100644 index 000000000..43296cb06 --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium.sln @@ -0,0 +1,70 @@ + +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 + DynDebug|ARM64 = DynDebug|ARM64 + DynRelease|Win32 = DynRelease|Win32 + DynRelease|x64 = DynRelease|x64 + DynRelease|ARM64 = DynRelease|ARM64 + LtcgDebug|Win32 = LtcgDebug|Win32 + LtcgDebug|x64 = LtcgDebug|x64 + LtcgDebug|ARM64 = LtcgDebug|ARM64 + LtcgRelease|Win32 = LtcgRelease|Win32 + LtcgRelease|x64 = LtcgRelease|x64 + LtcgRelease|ARM64 = LtcgRelease|ARM64 + StaticDebug|Win32 = StaticDebug|Win32 + StaticDebug|x64 = StaticDebug|x64 + StaticDebug|ARM64 = StaticDebug|ARM64 + StaticRelease|Win32 = StaticRelease|Win32 + StaticRelease|x64 = StaticRelease|x64 + StaticRelease|ARM64 = StaticRelease|ARM64 + 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}.DynDebug|ARM64.ActiveCfg = DebugDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|ARM64.Build.0 = DebugDLL|ARM64 + {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}.DynRelease|ARM64.ActiveCfg = ReleaseDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|ARM64.Build.0 = ReleaseDLL|ARM64 + {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}.LtcgDebug|ARM64.ActiveCfg = DebugLTCG|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|ARM64.Build.0 = DebugLTCG|ARM64 + {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}.LtcgRelease|ARM64.ActiveCfg = ReleaseLTCG|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|ARM64.Build.0 = ReleaseLTCG|ARM64 + {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}.StaticDebug|ARM64.ActiveCfg = DebugLIB|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|ARM64.Build.0 = DebugLIB|ARM64 + {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 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|ARM64.ActiveCfg = ReleaseLIB|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|ARM64.Build.0 = ReleaseLIB|ARM64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.props b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.props new file mode 100644 index 000000000..5a23903c4 --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.props @@ -0,0 +1,48 @@ + + + + + <_PropertySheetDisplayName>Libsodium Common Settings + AllRules.ruleset + false + + + + + + + + + + + + + copy "$(BuildRoot)version.h" "$(RepoRoot)src\libsodium\include\sodium\" + + + $(RepoRoot)src\libsodium\include;$(RepoRoot)src\libsodium\include\sodium\;%(AdditionalIncludeDirectories) + 4146;4244;%(DisableSpecificWarnings) + false + inline=__inline;NATIVE_LITTLE_ENDIAN;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + SODIUM_STATIC;%(PreprocessorDefinitions) + SODIUM_DLL_EXPORT;%(PreprocessorDefinitions) + HAVE_AMD64_ASM;%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + advapi32.lib + + + diff --git a/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj new file mode 100644 index 000000000..b381812ad --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj @@ -0,0 +1,370 @@ + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + libsodium + v143 + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + DebugDLL + ARM64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + ReleaseDLL + ARM64 + + + DebugLIB + Win32 + + + DebugLIB + x64 + + + DebugLIB + ARM64 + + + ReleaseLIB + Win32 + + + ReleaseLIB + x64 + + + ReleaseLIB + ARM64 + + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + DebugLTCG + ARM64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + + + ReleaseLTCG + ARM64 + + + + StaticLibrary + DynamicLibrary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters new file mode 100644 index 000000000..d80be171f --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters @@ -0,0 +1,1088 @@ + + + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + + + + + + crypto_generichash + + + crypto_generichash\blake2b + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_kx + + + crypto_sign + + + crypto_sign\ed25519 + + + crypto_sign\ed25519\ref10 + + + crypto_sign\ed25519\ref10 + + + crypto_sign\ed25519\ref10 + + + crypto_sign\ed25519\ref10 + + + crypto_secretbox + + + crypto_secretbox + + + crypto_secretbox\xsalsa20poly1305 + + + crypto_secretbox\xchacha20poly1305 + + + crypto_pwhash + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_pwhash\scryptsalsa208sha256\nosse + + + crypto_pwhash\scryptsalsa208sha256\sse + + + crypto_verify + + + crypto_auth + + + crypto_auth\hmacsha512 + + + crypto_auth\hmacsha512256 + + + crypto_auth\hmacsha256 + + + crypto_kdf + + + crypto_kdf\blake2b + + + crypto_kdf\hkdf + + + crypto_kdf\hkdf + + + crypto_shorthash + + + crypto_shorthash\siphash24 + + + crypto_shorthash\siphash24 + + + crypto_shorthash\siphash24\ref + + + crypto_shorthash\siphash24\ref + + + crypto_scalarmult + + + crypto_scalarmult\ristretto255\ref10 + + + crypto_scalarmult\ed25519\ref10 + + + crypto_scalarmult\curve25519 + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\ref10 + + + crypto_onetimeauth + + + crypto_onetimeauth\poly1305 + + + crypto_onetimeauth\poly1305\donna + + + crypto_onetimeauth\poly1305\sse2 + + + randombytes + + + randombytes\sysrandom + + + randombytes\internal + + + crypto_box + + + crypto_box + + + crypto_box + + + crypto_box\curve25519xsalsa20poly1305 + + + crypto_box\curve25519xchacha20poly1305 + + + crypto_box\curve25519xchacha20poly1305 + + + sodium + + + sodium + + + sodium + + + sodium + + + sodium + + + crypto_stream + + + crypto_stream\xchacha20 + + + crypto_stream\chacha20 + + + crypto_stream\chacha20\ref + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\salsa20 + + + crypto_stream\salsa20\ref + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6 + + + crypto_stream\salsa2012 + + + crypto_stream\salsa2012\ref + + + crypto_stream\salsa208 + + + crypto_stream\salsa208\ref + + + crypto_stream\xsalsa20 + + + crypto_hash + + + crypto_hash\sha512 + + + crypto_hash\sha512\cp + + + crypto_hash\sha256 + + + crypto_hash\sha256\cp + + + crypto_aead\xchacha20poly1305 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aes256gcm + + + crypto_aead\aes256gcm\aesni + + + crypto_aead\aes256gcm\armcrypto + + + crypto_aead\chacha20poly1305 + + + crypto_secretstream\xchacha20poly1305 + + + crypto_core\salsa\ref + + + crypto_core\hchacha20 + + + crypto_core\hsalsa20 + + + crypto_core\hsalsa20\ref2 + + + crypto_core\softaes + + + crypto_core\ed25519 + + + crypto_core\ed25519 + + + crypto_core\ed25519\ref10 + + + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_generichash\blake2b\ref + + + crypto_sign\ed25519\ref10 + + + include + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + include\sodium\private + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\argon2 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_pwhash\scryptsalsa208sha256 + + + crypto_shorthash\siphash24\ref + + + crypto_scalarmult\curve25519 + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\sandy2x + + + crypto_scalarmult\curve25519\ref10 + + + crypto_onetimeauth\poly1305 + + + crypto_onetimeauth\poly1305\donna + + + crypto_onetimeauth\poly1305\donna + + + crypto_onetimeauth\poly1305\donna + + + crypto_onetimeauth\poly1305\sse2 + + + crypto_stream\chacha20 + + + crypto_stream\chacha20\ref + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\chacha20\dolbeau + + + crypto_stream\salsa20 + + + crypto_stream\salsa20\ref + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6int + + + crypto_stream\salsa20\xmm6 + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis128l + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_aead\aegis256 + + + crypto_core\ed25519\ref10\fe_25_5 + + + crypto_core\ed25519\ref10\fe_25_5 + + + crypto_core\ed25519\ref10\fe_25_5 + + + crypto_core\ed25519\ref10\fe_25_5 + + + crypto_core\ed25519\ref10\fe_51 + + + crypto_core\ed25519\ref10\fe_51 + + + crypto_core\ed25519\ref10\fe_51 + + + crypto_core\ed25519\ref10\fe_51 + + + + + {a6837e41-3751-38c9-bb90-dd59d5f4af7b} + + + {9e2a023d-fef1-3231-90ba-9a0ffc9bc9ab} + + + {6897a4cc-0091-3970-b712-c0ac75c16b67} + + + {3e53394c-b59c-30cc-ae69-a4f46f9edfa3} + + + {7eb51140-a50f-3f50-b379-83677a82496c} + + + {507bb9aa-b65c-3034-946b-bcd375b7deaa} + + + {1f4d6dd1-517f-3eeb-b974-2304ada5e67a} + + + {3122f223-e6c2-3ab1-ad85-ca289b47419e} + + + {0a3af0f3-56f7-3551-a64e-6284feccc423} + + + {64e89b4f-eec9-38c9-90f2-4881bf5e84c0} + + + {0c0b4001-ae11-3d0f-8e73-75ac9b6e1ae8} + + + {f5065d74-beda-3e1e-819a-f606279c7fe9} + + + {f7aedb93-94a6-3ede-9374-ff41daca4841} + + + {0e7473c9-9c69-36b3-ab6c-d953647a15a6} + + + {d75db64c-eb08-3f10-9b99-1b6e6827f348} + + + {73194d5d-588a-342f-bee6-f28b4486f20b} + + + {7c5e6f81-e4ce-3018-a776-a1f125072d73} + + + {76990c08-d692-367f-b286-c728a8cad6bf} + + + {bf04f786-7862-3bde-aeba-ed82ee59ca22} + + + {98b6126a-3725-3707-a4cc-ff3af657cba0} + + + {8b704d11-af1f-30c0-9981-479da6d88dc3} + + + {342e684b-4e18-311c-953c-8391a544a04f} + + + {c6b8e28c-7c54-3af7-bee3-2948ba7b2082} + + + {4e9a1d6b-ee07-3bbc-ad78-6d0ba0e6d9d3} + + + {eb259fd9-56f0-32db-a903-6bc1549a7326} + + + {05997596-e3d7-3bf1-ad4d-39e4c5fd56f6} + + + {e53b6258-fcdd-34c8-96c5-44510a34a390} + + + {8bd3b558-2d08-3c3a-81ca-22677dde943b} + + + {16a8dd41-b0ab-39a7-80c8-3052d8b63811} + + + {d7ec3690-bae7-3653-8c53-66a3142cfcfa} + + + {722ef422-8c03-3008-ba2a-3a7e91c6647c} + + + {8c7d8b62-7b4f-3eb9-85b7-18e8d925be14} + + + {8fb6a906-dbd6-3746-9b0f-f49e7028daec} + + + {f2d6a22b-dd67-3561-90a4-88696169cb7b} + + + {aaf59186-1c0d-33cf-a34d-93e14bb87226} + + + {3d42d2a2-b192-33dd-9162-508916414707} + + + {baf7d894-9298-391d-8dc2-e4c3010f5ddc} + + + {898b6bd5-1360-3a34-adcd-0fade7561685} + + + {323c0a15-3c1d-39b2-9ec1-299deb299497} + + + {52c2080d-37c0-34c2-864a-c201c728e5d8} + + + {ff618a41-caeb-3a18-ad36-d34b049a8f50} + + + {ffc3712d-dfe0-3b51-8257-f5ffc9c9cea3} + + + {f54b65b6-71cf-3ab3-9c8c-f89c81846836} + + + {1bd97a78-befa-3805-8e9c-80d7c1aff37b} + + + {e785f104-1212-37bf-8511-cc518b9ace66} + + + {447b993f-59fb-3efd-8c59-a1712c97dfe8} + + + {cdb8d233-06b0-3872-a62b-c1ccf4cb4314} + + + {402a1c5a-d499-333a-a2fa-acd0e6a3c2b2} + + + {77f5a2e9-2ef1-3a72-b63c-88e8e4b92678} + + + {6c9c7c30-0808-3fad-8a88-944d7645e5d5} + + + {5d2fb1a2-f063-32db-a81a-41f79e36fd23} + + + {7bec6074-fbc7-330b-9e18-7dc3e868569a} + + + {834d4827-81e4-3de3-baa1-a216763f11d6} + + + {52bf28eb-7ffd-399a-be35-0df3e8e99c15} + + + {39cc576f-4b54-3d71-b14c-27445bc4b138} + + + {b9b02bee-5c1f-36d2-b97d-983f865a4cc6} + + + {41f1f35b-4639-3424-be85-7dfba02f3c5e} + + + {8bf11d29-2f5a-3f10-8ae6-82229d19c5b0} + + + {62f7ae38-4ce6-3976-acc3-47c462db4fbe} + + + {e07a28cd-775a-3798-bfdb-97842d3614d6} + + + {bb073c16-adc8-3cff-80b9-99cf5a28de6c} + + + {63de0ec8-ecde-35e3-8b97-6e9e4da342ee} + + + {29925210-53eb-342c-8527-7ebc173e668f} + + + {b2f989b6-87a6-3388-a35c-2d0d59cb4236} + + + {bc6466a1-57b0-3a35-9973-ad488a4bef8c} + + + {5599d9ab-b5b2-3310-b541-ae0fb70eecf1} + + + {eaedd08a-46f8-3d12-9e8d-bb3ee3ead5f6} + + + {806b6ff3-578b-308a-a359-0f5ed8472ecc} + + + {5a1d852e-67bb-3dc1-9ec5-99ef74b7faca} + + + {33e45d9c-e12a-3e76-9ef2-4f5510244a5b} + + + {048ba2a8-b22b-346c-9886-668b63c88c68} + + + {f08a312f-f8a3-350b-87ab-1f79d33e513f} + + + {c403f690-cd22-3ed4-9cc7-3f46e73081fd} + + + {c34d03f5-cf47-39fe-a5ad-5eb917006203} + + + {4da0c5ca-33d1-34e0-9689-12e69ae2dbd6} + + + {dd6b294c-5871-386c-92ec-aa46fcc411d4} + + + {07aca978-0547-329a-b70b-29aa579cacc5} + + + {f171fa05-35c4-32a0-b035-b5d6680ab714} + + + {ede2279c-1ba7-3d62-8345-733c6c1965e7} + + + {9c15151b-10dc-3dfe-b97b-a7d8c6b58920} + + + {49fb9272-ffe2-3993-b562-b19d5f2c9b40} + + + {96da72eb-3aa0-3850-83eb-32788f91e5bd} + + + {56bb40fc-d381-3a9e-925b-681774c48dde} + + + {fde88485-0fe6-3b22-9480-1d2b49fade53} + + + {ef090484-4db4-3dc2-aca7-c59bab1db23b} + + + {14c126fd-bb91-37ea-b807-b60c386be601} + + + {ac56c38f-7e17-3b79-bf47-58e9476b3b89} + + + {5dfc520b-f690-3d5f-a86a-8b667f2e7490} + + + diff --git a/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.xml b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.xml new file mode 100644 index 000000000..808ccb9fe --- /dev/null +++ b/src/libsodium/builds/msvc/vs2022/libsodium/libsodium.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/libsodium/libsodium.sln b/src/libsodium/ci/appveyor/libsodium.sln similarity index 100% rename from src/libsodium/libsodium.sln rename to src/libsodium/ci/appveyor/libsodium.sln diff --git a/src/libsodium/ci/appveyor/libsodium.vcxproj b/src/libsodium/ci/appveyor/libsodium.vcxproj new file mode 100644 index 000000000..98c7c5230 --- /dev/null +++ b/src/libsodium/ci/appveyor/libsodium.vcxproj @@ -0,0 +1,594 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir)..\..\;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libsodium/ci/appveyor/libsodium.vcxproj.filters b/src/libsodium/ci/appveyor/libsodium.vcxproj.filters new file mode 100644 index 000000000..2745d3ede --- /dev/null +++ b/src/libsodium/ci/appveyor/libsodium.vcxproj.filters @@ -0,0 +1,813 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + diff --git a/src/libsodium/ci/appveyor/msvc-scripts/process.bat b/src/libsodium/ci/appveyor/msvc-scripts/process.bat new file mode 100755 index 000000000..b09efd825 --- /dev/null +++ b/src/libsodium/ci/appveyor/msvc-scripts/process.bat @@ -0,0 +1,5 @@ +cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/1.0.20/ < ..\..\src\libsodium\include\sodium\version.h.in > tmp +cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/26/ < 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_MINIMAL_DEF@// < tmp3 > ..\..\src\libsodium\include\sodium\version.h +del tmp tmp2 tmp3 diff --git a/src/libsodium/msvc-scripts/rep.vbs b/src/libsodium/ci/appveyor/msvc-scripts/rep.vbs similarity index 100% rename from src/libsodium/msvc-scripts/rep.vbs rename to src/libsodium/ci/appveyor/msvc-scripts/rep.vbs diff --git a/src/libsodium/msvc-scripts/sodium.props b/src/libsodium/ci/appveyor/msvc-scripts/sodium.props similarity index 70% rename from src/libsodium/msvc-scripts/sodium.props rename to src/libsodium/ci/appveyor/msvc-scripts/sodium.props index 41e1e471b..b5665f68f 100644 --- a/src/libsodium/msvc-scripts/sodium.props +++ b/src/libsodium/ci/appveyor/msvc-scripts/sodium.props @@ -1,24 +1,25 @@  - + - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) true UNICODE;_UNICODE;%(PreprocessorDefinitions) NATIVE_LITTLE_ENDIAN=1;%(PreprocessorDefinitions) inline=__inline;%(PreprocessorDefinitions) - "$(SolutionDir)/msvc-scripts/process.bat" + "$(SolutionDir)\msvc-scripts\process.bat" Process .in files - "$(SolutionDir)/test/default/wintest.bat" $(Configuration) $(Platform) + "$(SolutionDir)..\..\test\default\wintest.bat" $(Configuration) $(Platform) Run the test suite diff --git a/src/libsodium/compile b/src/libsodium/compile deleted file mode 100755 index 531136b06..000000000 --- a/src/libsodium/compile +++ /dev/null @@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/libsodium/configure b/src/libsodium/configure index 72cddb807..e1b94d69c 100755 --- a/src/libsodium/configure +++ b/src/libsodium/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libsodium 1.0.18. +# Generated by GNU Autoconf 2.72 for libsodium 1.0.20. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -195,14 +196,15 @@ test \$(( 1 + 1 )) = 2 || exit 1 if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -235,12 +237,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -262,7 +265,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -282,7 +285,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -321,14 +325,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -397,11 +393,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -415,21 +412,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -503,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -551,7 +543,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -563,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -590,10 +581,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -621,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libsodium' PACKAGE_TARNAME='libsodium' -PACKAGE_VERSION='1.0.18' -PACKAGE_STRING='libsodium 1.0.18' +PACKAGE_VERSION='1.0.20' +PACKAGE_STRING='libsodium 1.0.20' PACKAGE_BUGREPORT='https://github.com/jedisct1/libsodium/issues' PACKAGE_URL='https://libsodium.org' @@ -693,6 +686,7 @@ CFLAGS_SSSE3 CFLAGS_SSE3 CFLAGS_SSE2 CFLAGS_MMX +CFLAGS_ARMCRYPTO LIBTOOL_DEPS LT_SYS_LIBRARY_PATH OTOOL64 @@ -706,12 +700,15 @@ ac_ct_AR AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP +EGREP +GREP LIBTOOL CWFLAGS VALGRIND_CHECK_RULES @@ -732,8 +729,6 @@ PTHREAD_LIBS PTHREAD_CXX PTHREAD_CC ax_pthread_config -EGREP -GREP CPP SED SODIUM_LIBRARY_MINIMAL_DEF @@ -771,6 +766,9 @@ AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -1001,7 +999,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1027,7 +1025,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1240,7 +1238,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1256,7 +1254,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1286,8 +1284,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1295,7 +1293,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1345,7 +1343,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1413,7 +1411,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1441,7 +1439,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libsodium 1.0.18 to adapt to many kinds of systems. +'configure' configures libsodium 1.0.20 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1455,11 +1453,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1467,10 +1465,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1513,7 +1511,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libsodium 1.0.18:";; + short | recursive ) echo "Configuration of libsodium 1.0.20:";; esac cat <<\_ACEOF @@ -1567,7 +1565,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pthreads use pthreads library, or --without-pthreads to - disable threading support. + disable threading support --with-safecode For maintainers only - please do not use --with-ctgrind For maintainers only - please do not use --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use @@ -1592,12 +1590,12 @@ Some influential environment variables: CPP C preprocessor SAFECODE_HOME set to the safecode base directory - CWFLAGS define to compilation flags for generating extra warnings + CWFLAGS compilation flags for generating extra warnings LT_SYS_LIBRARY_PATH User-defined run-time library search path. AR path to the ar utility -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1665,10 +1663,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libsodium configure 1.0.18 -generated by GNU Autoconf 2.71 +libsodium configure 1.0.20 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1707,11 +1705,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1730,8 +1729,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1739,10 +1738,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1782,11 +1783,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1825,11 +1827,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1866,12 +1869,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1890,15 +1894,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1909,7 +1913,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1928,11 +1932,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1953,8 +1959,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1984,12 +1990,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2021,8 +2029,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libsodium $as_me 1.0.18, which was -generated by GNU Autoconf 2.71. Invocation command line was +It was created by libsodium $as_me 1.0.20, which was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2268,10 +2276,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2307,9 +2315,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2323,6 +2329,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2350,16 +2371,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2409,7 +2433,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2475,6 +2498,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2496,7 +2521,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2690,8 +2715,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2719,12 +2745,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2733,18 +2759,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2760,11 +2786,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2793,15 +2819,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -2828,14 +2855,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -2862,14 +2890,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -2920,8 +2949,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -2975,7 +3004,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -3071,7 +3101,7 @@ test "$program_prefix" != NONE && test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. -# By default was `s,x,x', remove it if useless. +# By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` @@ -3114,8 +3144,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3137,7 +3167,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -3159,8 +3190,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3182,7 +3213,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -3218,8 +3250,8 @@ if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS @@ -3233,7 +3265,7 @@ do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ + *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; @@ -3242,18 +3274,17 @@ do done done IFS=$as_save_IFS - + ;; +esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 @@ -3268,8 +3299,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3291,7 +3322,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -3313,8 +3345,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -3326,7 +3358,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3364,8 +3397,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3375,7 +3408,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -3410,7 +3444,7 @@ fi # Define the identity of the package. PACKAGE='libsodium' - VERSION='1.0.18' + VERSION='1.0.20' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3562,8 +3596,9 @@ printf %s "checking how to create a ustar tar archive... " >&6; } if test ${am_cv_prog_tar_ustar+y} then : printf %s "(cached) " >&6 -else $as_nop - am_cv_prog_tar_ustar=$_am_tool +else case e in #( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 @@ -3573,6 +3608,20 @@ printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3633,8 +3682,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3644,7 +3693,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -3664,8 +3714,9 @@ printf %s "checking whether to enable maintainer-specific portions of Makefiles. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=no +else case e in #( + e) USE_MAINTAINER_MODE=no ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 @@ -3704,10 +3755,10 @@ fi -SODIUM_LIBRARY_VERSION_MAJOR=10 -SODIUM_LIBRARY_VERSION_MINOR=3 -DLL_VERSION=24 -SODIUM_LIBRARY_VERSION=26:0:3 +SODIUM_LIBRARY_VERSION_MAJOR=26 +SODIUM_LIBRARY_VERSION_MINOR=2 +DLL_VERSION=26 +SODIUM_LIBRARY_VERSION=28:0:2 # | | | # +------+ | +---+ # | | | @@ -3735,6 +3786,9 @@ then : fi +sodium_CFLAGS=${CFLAGS+set} +: ${CFLAGS=""} + @@ -3757,8 +3811,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3780,7 +3834,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3802,8 +3857,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3825,7 +3880,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3860,8 +3916,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3883,7 +3939,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3905,8 +3962,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3945,7 +4002,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3969,8 +4027,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3992,7 +4050,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4018,8 +4077,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4041,7 +4100,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4079,8 +4139,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4102,7 +4162,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4124,8 +4185,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4147,7 +4208,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4176,10 +4238,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4251,8 +4313,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -4272,7 +4334,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -4283,8 +4345,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -4293,13 +4356,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -4323,10 +4387,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -4336,11 +4400,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4356,6 +4421,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -4395,26 +4462,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4446,16 +4514,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -4466,8 +4536,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4484,12 +4554,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -4507,8 +4579,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -4526,8 +4598,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4542,8 +4614,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4560,12 +4632,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -4592,8 +4667,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4610,25 +4685,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4638,8 +4716,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4656,25 +4734,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4684,8 +4765,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4702,25 +4783,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4741,8 +4825,8 @@ printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4772,7 +4856,8 @@ _ACEOF fi done rm -f core conftest* - unset am_i + unset am_i ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } @@ -4842,8 +4927,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -4947,7 +5032,8 @@ else $as_nop else am_cv_CC_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } @@ -4978,8 +5064,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CCAS_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -5081,7 +5167,8 @@ else $as_nop else am_cv_CCAS_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } @@ -5139,8 +5226,8 @@ printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -5156,10 +5243,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } @@ -5169,8 +5258,8 @@ printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no +else case e in #( + e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5189,8 +5278,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 @@ -5208,10 +5297,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } @@ -5236,6 +5327,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h @@ -5255,8 +5348,9 @@ then : printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h -else $as_nop - MINIX= +else case e in #( + e) MINIX= ;; +esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : @@ -5271,62 +5365,94 @@ fi -# Check whether --enable-ssp was given. -if test ${enable_ssp+y} +if test "$sodium_CFLAGS" != "set" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -O3" >&5 +printf %s "checking whether C compiler accepts -O3... " >&6; } +if test ${ax_cv_check_cflags___O3+y} then : - enableval=$enable_ssp; - if test "x$enableval" = "xno" -then : - - enable_ssp="no" - -else $as_nop - - enable_ssp="yes" + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -O3" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___O3=yes +else case e in #( + e) ax_cv_check_cflags___O3=no ;; +esac fi - -else $as_nop - - enable_ssp="yes" - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac fi - - -# Check whether --enable-asm was given. -if test ${enable_asm+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___O3" >&5 +printf "%s\n" "$ax_cv_check_cflags___O3" >&6; } +if test "x$ax_cv_check_cflags___O3" = xyes then : - enableval=$enable_asm; - if test "x$enableval" = "xno" + CFLAGS="$CFLAGS -O3" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -O2" >&5 +printf %s "checking whether C compiler accepts -O2... " >&6; } +if test ${ax_cv_check_cflags___O2+y} then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -O2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x - enable_asm="no" - -else $as_nop - - enable_asm="yes" - + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___O2=yes +else case e in #( + e) ax_cv_check_cflags___O2=no ;; +esac fi - -else $as_nop - - enable_asm="yes" - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac fi - - -if test "x$EMSCRIPTEN" != "x" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___O2" >&5 +printf "%s\n" "$ax_cv_check_cflags___O2" >&6; } +if test "x$ax_cv_check_cflags___O2" = xyes then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -s ASSERTIONS=0" >&5 -printf %s "checking whether C compiler accepts -s ASSERTIONS=0... " >&6; } -if test ${ax_cv_check_cflags___s_ASSERTIONS_0+y} + CFLAGS="$CFLAGS -O2" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -O1" >&5 +printf %s "checking whether C compiler accepts -O1... " >&6; } +if test ${ax_cv_check_cflags___O1+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -s ASSERTIONS=0" + CFLAGS="$CFLAGS -O1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5341,41 +5467,190 @@ time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x _ACEOF if ac_fn_c_try_link "$LINENO" then : - ax_cv_check_cflags___s_ASSERTIONS_0=yes -else $as_nop - ax_cv_check_cflags___s_ASSERTIONS_0=no + ax_cv_check_cflags___O1=yes +else case e in #( + e) ax_cv_check_cflags___O1=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___s_ASSERTIONS_0" >&5 -printf "%s\n" "$ax_cv_check_cflags___s_ASSERTIONS_0" >&6; } -if test "x$ax_cv_check_cflags___s_ASSERTIONS_0" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___O1" >&5 +printf "%s\n" "$ax_cv_check_cflags___O1" >&6; } +if test "x$ax_cv_check_cflags___O1" = xyes then : + CFLAGS="$CFLAGS -O1" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -O" >&5 +printf %s "checking whether C compiler accepts -O... " >&6; } +if test ${ax_cv_check_cflags___O+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -O" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x - enable_asm="no" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiling to JavaScript - asm implementations disabled" >&5 -printf "%s\n" "$as_me: WARNING: compiling to JavaScript - asm implementations disabled" >&2;} - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&5 -printf "%s\n" "$as_me: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&2;} - CFLAGS="$CFLAGS -U__EMSCRIPTEN__" - unset EMSCRIPTEN - -fi - - -fi - -# Check whether --enable-pie was given. -if test ${enable_pie+y} + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - enableval=$enable_pie; enable_pie=$enableval -else $as_nop - enable_pie="maybe" + ax_cv_check_cflags___O=yes +else case e in #( + e) ax_cv_check_cflags___O=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___O" >&5 +printf "%s\n" "$ax_cv_check_cflags___O" >&6; } +if test "x$ax_cv_check_cflags___O" = xyes +then : + CFLAGS="$CFLAGS -O" +else case e in #( + e) : ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + ;; +esac +fi + +fi + + +# Check whether --enable-ssp was given. +if test ${enable_ssp+y} +then : + enableval=$enable_ssp; + if test "x$enableval" = "xno" +then : + + enable_ssp="no" + +else case e in #( + e) + enable_ssp="yes" + ;; +esac +fi + +else case e in #( + e) + enable_ssp="yes" + ;; +esac +fi + + +# Check whether --enable-asm was given. +if test ${enable_asm+y} +then : + enableval=$enable_asm; + if test "x$enableval" = "xno" +then : + + enable_asm="no" + +else case e in #( + e) + enable_asm="yes" + ;; +esac +fi + +else case e in #( + e) + enable_asm="yes" + ;; +esac +fi + + +if test "x$EMSCRIPTEN" != "x" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -s ASSERTIONS=0" >&5 +printf %s "checking whether C compiler accepts -s ASSERTIONS=0... " >&6; } +if test ${ax_cv_check_cflags___s_ASSERTIONS_0+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -s ASSERTIONS=0" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___s_ASSERTIONS_0=yes +else case e in #( + e) ax_cv_check_cflags___s_ASSERTIONS_0=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___s_ASSERTIONS_0" >&5 +printf "%s\n" "$ax_cv_check_cflags___s_ASSERTIONS_0" >&6; } +if test "x$ax_cv_check_cflags___s_ASSERTIONS_0" = xyes +then : + + enable_asm="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiling to JavaScript - asm implementations disabled" >&5 +printf "%s\n" "$as_me: WARNING: compiling to JavaScript - asm implementations disabled" >&2;} + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn\'t appear to be used - Assuming compilation to native code" >&5 +printf "%s\n" "$as_me: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn\'t appear to be used - Assuming compilation to native code" >&2;} + CFLAGS="$CFLAGS -U__EMSCRIPTEN__" + unset EMSCRIPTEN + ;; +esac +fi + + +fi + +# Check whether --enable-pie was given. +if test ${enable_pie+y} +then : + enableval=$enable_pie; enable_pie=$enableval +else case e in #( + e) enable_pie="maybe" ;; +esac fi @@ -5415,16 +5690,18 @@ then : printf "%s\n" "#define MINIMAL 1" >>confdefs.h -else $as_nop - +else case e in #( + e) enable_minimal="no" - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_minimal="no" - + ;; +esac fi if test x$enable_minimal = xyes; then @@ -5442,8 +5719,9 @@ fi if test ${with_pthreads+y} then : withval=$with_pthreads; -else $as_nop - withval="yes" +else case e in #( + e) withval="yes" ;; +esac fi @@ -5452,8 +5730,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -5478,9 +5756,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5515,7 +5794,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -5537,8 +5817,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -5556,9 +5836,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -5572,15 +5853,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -5589,7 +5871,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -5612,9 +5895,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -5628,24 +5912,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -5655,14 +5941,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin @@ -5676,13 +5962,14 @@ do for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5691,14 +5978,14 @@ case `"$ac_path_GREP" --version 2>&1` in cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break @@ -5706,35 +5993,24 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 + $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : fi else - ac_cv_path_GREP=$GREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} + if test "$ac_cv_path_EGREP_TRADITIONAL" then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin @@ -5748,13 +6024,14 @@ do for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5763,14 +6040,14 @@ case `"$ac_path_EGREP" --version 2>&1` in cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break @@ -5778,24 +6055,25 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else - ac_cv_path_EGREP=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi - - fi + ;; +esac +fi ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL if test "x$withval" = "xyes" then : @@ -5840,8 +6118,14 @@ printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_join (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (void); int main (void) { @@ -5901,7 +6185,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread -- # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case $target_os in +case $host_os in freebsd*) @@ -5935,7 +6219,7 @@ case $target_os in _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} @@ -5965,8 +6249,8 @@ printf %s "checking whether $CC is Clang... " >&6; } if test ${ax_cv_PTHREAD_CLANG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG=no +else case e in #( + e) ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5978,14 +6262,15 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : ax_cv_PTHREAD_CLANG=yes fi rm -rf conftest* fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } @@ -6019,7 +6304,7 @@ fi # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled -case $target_os in +case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; @@ -6035,8 +6320,9 @@ esac if test "x$ax_pthread_check_macro" = "x--" then : ax_pthread_check_cond=0 -else $as_nop - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +else case e in #( + e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;; +esac fi @@ -6070,8 +6356,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ax_pthread_config+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ax_pthread_config"; then +else case e in #( + e) if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6094,7 +6380,8 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi +fi ;; +esac fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then @@ -6227,8 +6514,8 @@ printf %s "checking whether Clang needs flag to prevent \"argument unused\" warn if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown +else case e in #( + e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second @@ -6274,7 +6561,8 @@ then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } @@ -6301,8 +6589,8 @@ printf %s "checking for joinable pthread attribute... " >&6; } if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_JOINABLE_ATTR=unknown +else case e in #( + e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6322,7 +6610,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } @@ -6342,14 +6631,15 @@ printf %s "checking whether more special flags are required for pthreads... " >& if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $target_os in +else case e in #( + e) ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } @@ -6365,8 +6655,8 @@ printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6381,12 +6671,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_PRIO_INHERIT=yes -else $as_nop - ax_cv_PTHREAD_PRIO_INHERIT=no +else case e in #( + e) ax_cv_PTHREAD_PRIO_INHERIT=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } @@ -6405,7 +6697,7 @@ fi # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then - case $target_os in + case $host_os in aix*) case "x/$CC" in #( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : @@ -6436,8 +6728,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CC"; then +else case e in #( + e) if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6459,7 +6751,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then @@ -6486,8 +6779,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CXX"; then +else case e in #( + e) if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6509,7 +6802,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then @@ -6599,8 +6893,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -else $as_nop - with_threads="no" +else case e in #( + e) with_threads="no" ;; +esac fi @@ -6633,16 +6928,22 @@ printf %s "checking for ct_poison in -lctgrind... " >&6; } if test ${ac_cv_lib_ctgrind_ct_poison+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lctgrind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char ct_poison (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ct_poison (void); int main (void) { @@ -6654,12 +6955,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ctgrind_ct_poison=yes -else $as_nop - ac_cv_lib_ctgrind_ct_poison=no +else case e in #( + e) ac_cv_lib_ctgrind_ct_poison=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ctgrind_ct_poison" >&5 printf "%s\n" "$ac_cv_lib_ctgrind_ct_poison" >&6; } @@ -6688,8 +6991,8 @@ printf %s "checking whether C compiler accepts -mindirect-branch=thunk-inline... if test ${ax_cv_check_cflags___mindirect_branch_thunk_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mindirect-branch=thunk-inline" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6707,26 +7010,28 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mindirect_branch_thunk_inline=yes -else $as_nop - ax_cv_check_cflags___mindirect_branch_thunk_inline=no +else case e in #( + e) ax_cv_check_cflags___mindirect_branch_thunk_inline=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_thunk_inline" >&5 printf "%s\n" "$ax_cv_check_cflags___mindirect_branch_thunk_inline" >&6; } if test "x$ax_cv_check_cflags___mindirect_branch_thunk_inline" = xyes then : CFLAGS="$CFLAGS -mindirect-branch=thunk-inline" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mretpoline" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mretpoline" >&5 printf %s "checking whether C compiler accepts -mretpoline... " >&6; } if test ${ax_cv_check_cflags___mretpoline+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mretpoline" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6744,23 +7049,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mretpoline=yes -else $as_nop - ax_cv_check_cflags___mretpoline=no +else case e in #( + e) ax_cv_check_cflags___mretpoline=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mretpoline" >&5 printf "%s\n" "$ax_cv_check_cflags___mretpoline" >&6; } if test "x$ax_cv_check_cflags___mretpoline" = xyes then : CFLAGS="$CFLAGS -mretpoline" -else $as_nop - : +else case e in #( + e) : ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch-register" >&5 @@ -6768,8 +7077,8 @@ printf %s "checking whether C compiler accepts -mindirect-branch-register... " > if test ${ax_cv_check_cflags___mindirect_branch_register+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mindirect-branch-register" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6787,20 +7096,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mindirect_branch_register=yes -else $as_nop - ax_cv_check_cflags___mindirect_branch_register=no +else case e in #( + e) ax_cv_check_cflags___mindirect_branch_register=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_register" >&5 printf "%s\n" "$ax_cv_check_cflags___mindirect_branch_register" >&6; } if test "x$ax_cv_check_cflags___mindirect_branch_register" = xyes then : : -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -6851,15 +7163,15 @@ then : if test "x$enableval" = "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Ofast" >&5 -printf %s "checking whether C compiler accepts -Ofast... " >&6; } -if test ${ax_cv_check_cflags___Ofast+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-vectorize" >&5 +printf %s "checking whether C compiler accepts -ftree-vectorize... " >&6; } +if test ${ax_cv_check_cflags___ftree_vectorize+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -Ofast" + CFLAGS="$CFLAGS -ftree-vectorize" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6874,61 +7186,24 @@ time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x _ACEOF if ac_fn_c_try_link "$LINENO" then : - ax_cv_check_cflags___Ofast=yes -else $as_nop - ax_cv_check_cflags___Ofast=no + ax_cv_check_cflags___ftree_vectorize=yes +else case e in #( + e) ax_cv_check_cflags___ftree_vectorize=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Ofast" >&5 -printf "%s\n" "$ax_cv_check_cflags___Ofast" >&6; } -if test "x$ax_cv_check_cflags___Ofast" = xyes -then : - CFLAGS="$CFLAGS -Ofast" -else $as_nop - : -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-vectorize" >&5 -printf %s "checking whether C compiler accepts -ftree-vectorize... " >&6; } -if test ${ax_cv_check_cflags___ftree_vectorize+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -ftree-vectorize" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_cv_check_cflags___ftree_vectorize=yes -else $as_nop - ax_cv_check_cflags___ftree_vectorize=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_vectorize" >&5 -printf "%s\n" "$ax_cv_check_cflags___ftree_vectorize" >&6; } -if test "x$ax_cv_check_cflags___ftree_vectorize" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_vectorize" >&5 +printf "%s\n" "$ax_cv_check_cflags___ftree_vectorize" >&6; } +if test "x$ax_cv_check_cflags___ftree_vectorize" = xyes then : CFLAGS="$CFLAGS -ftree-vectorize" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-slp-vectorize" >&5 @@ -6936,8 +7211,8 @@ printf %s "checking whether C compiler accepts -ftree-slp-vectorize... " >&6; } if test ${ax_cv_check_cflags___ftree_slp_vectorize+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ftree-slp-vectorize" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6955,20 +7230,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___ftree_slp_vectorize=yes -else $as_nop - ax_cv_check_cflags___ftree_slp_vectorize=no +else case e in #( + e) ax_cv_check_cflags___ftree_slp_vectorize=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_slp_vectorize" >&5 printf "%s\n" "$ax_cv_check_cflags___ftree_slp_vectorize" >&6; } if test "x$ax_cv_check_cflags___ftree_slp_vectorize" = xyes then : CFLAGS="$CFLAGS -ftree-slp-vectorize" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fomit-frame-pointer" >&5 @@ -6976,8 +7254,8 @@ printf %s "checking whether C compiler accepts -fomit-frame-pointer... " >&6; } if test ${ax_cv_check_cflags___fomit_frame_pointer+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fomit-frame-pointer" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6995,20 +7273,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fomit_frame_pointer=yes -else $as_nop - ax_cv_check_cflags___fomit_frame_pointer=no +else case e in #( + e) ax_cv_check_cflags___fomit_frame_pointer=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fomit_frame_pointer" >&5 printf "%s\n" "$ax_cv_check_cflags___fomit_frame_pointer" >&6; } if test "x$ax_cv_check_cflags___fomit_frame_pointer" = xyes then : CFLAGS="$CFLAGS -fomit-frame-pointer" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -march=native" >&5 @@ -7016,8 +7297,8 @@ printf %s "checking whether C compiler accepts -march=native... " >&6; } if test ${ax_cv_check_cflags___march_native+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -march=native" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7035,20 +7316,66 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___march_native=yes -else $as_nop - ax_cv_check_cflags___march_native=no +else case e in #( + e) ax_cv_check_cflags___march_native=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___march_native" >&5 printf "%s\n" "$ax_cv_check_cflags___march_native" >&6; } if test "x$ax_cv_check_cflags___march_native" = xyes then : CFLAGS="$CFLAGS -march=native" -else $as_nop - : +else case e in #( + e) : ;; +esac +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mtune=native" >&5 +printf %s "checking whether C compiler accepts -mtune=native... " >&6; } +if test ${ax_cv_check_cflags___mtune_native+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -mtune=native" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___mtune_native=yes +else case e in #( + e) ax_cv_check_cflags___mtune_native=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mtune_native" >&5 +printf "%s\n" "$ax_cv_check_cflags___mtune_native" >&6; } +if test "x$ax_cv_check_cflags___mtune_native" = xyes +then : + CFLAGS="$CFLAGS -mtune=native" +else case e in #( + e) : ;; +esac fi @@ -7065,8 +7392,9 @@ fi if test ${enable_valgrind+y} then : enableval=$enable_valgrind; enable_valgrind=$enableval -else $as_nop - enable_valgrind=no +else case e in #( + e) enable_valgrind=no ;; +esac fi @@ -7081,8 +7409,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_VALGRIND+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$VALGRIND"; then +else case e in #( + e) if test -n "$VALGRIND"; then ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7104,7 +7432,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi VALGRIND=$ac_cv_prog_VALGRIND if test -n "$VALGRIND"; then @@ -7124,16 +7453,18 @@ then : as_fn_error $? "Could not find valgrind; either install it or reconfigure with --disable-valgrind" "$LINENO" 5 -else $as_nop - +else case e in #( + e) enable_valgrind=no - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_valgrind=yes - + ;; +esac fi fi @@ -7156,8 +7487,9 @@ fi if test ${enable_valgrind_memcheck+y} then : enableval=$enable_valgrind_memcheck; enable_valgrind_memcheck=$enableval -else $as_nop - enable_valgrind_memcheck= +else case e in #( + e) enable_valgrind_memcheck= ;; +esac fi if test "$enable_valgrind" = "no" @@ -7172,8 +7504,8 @@ printf %s "checking for Valgrind tool memcheck... " >&6; } if test ${ax_cv_valgrind_tool_memcheck+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_cv_valgrind_tool_memcheck=no if `$VALGRIND --tool=memcheck --help >/dev/null 2>&1` @@ -7182,7 +7514,8 @@ then : ax_cv_valgrind_tool_memcheck=yes fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_memcheck" >&5 printf "%s\n" "$ax_cv_valgrind_tool_memcheck" >&6; } @@ -7194,16 +7527,18 @@ then : as_fn_error $? "Valgrind does not support memcheck; reconfigure with --disable-valgrind-memcheck" "$LINENO" 5 -else $as_nop - +else case e in #( + e) enable_valgrind_memcheck=no - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_valgrind_memcheck=yes - + ;; +esac fi fi @@ -7220,8 +7555,9 @@ fi if test ${enable_valgrind_helgrind+y} then : enableval=$enable_valgrind_helgrind; enable_valgrind_helgrind=$enableval -else $as_nop - enable_valgrind_helgrind= +else case e in #( + e) enable_valgrind_helgrind= ;; +esac fi if test "$enable_valgrind" = "no" @@ -7236,8 +7572,8 @@ printf %s "checking for Valgrind tool helgrind... " >&6; } if test ${ax_cv_valgrind_tool_helgrind+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_cv_valgrind_tool_helgrind=no if `$VALGRIND --tool=helgrind --help >/dev/null 2>&1` @@ -7246,7 +7582,8 @@ then : ax_cv_valgrind_tool_helgrind=yes fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_helgrind" >&5 printf "%s\n" "$ax_cv_valgrind_tool_helgrind" >&6; } @@ -7258,16 +7595,18 @@ then : as_fn_error $? "Valgrind does not support helgrind; reconfigure with --disable-valgrind-helgrind" "$LINENO" 5 -else $as_nop - +else case e in #( + e) enable_valgrind_helgrind=no - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_valgrind_helgrind=yes - + ;; +esac fi fi @@ -7284,8 +7623,9 @@ fi if test ${enable_valgrind_drd+y} then : enableval=$enable_valgrind_drd; enable_valgrind_drd=$enableval -else $as_nop - enable_valgrind_drd= +else case e in #( + e) enable_valgrind_drd= ;; +esac fi if test "$enable_valgrind" = "no" @@ -7300,8 +7640,8 @@ printf %s "checking for Valgrind tool drd... " >&6; } if test ${ax_cv_valgrind_tool_drd+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_cv_valgrind_tool_drd=no if `$VALGRIND --tool=drd --help >/dev/null 2>&1` @@ -7310,7 +7650,8 @@ then : ax_cv_valgrind_tool_drd=yes fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_drd" >&5 printf "%s\n" "$ax_cv_valgrind_tool_drd" >&6; } @@ -7322,16 +7663,18 @@ then : as_fn_error $? "Valgrind does not support drd; reconfigure with --disable-valgrind-drd" "$LINENO" 5 -else $as_nop - +else case e in #( + e) enable_valgrind_drd=no - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_valgrind_drd=yes - + ;; +esac fi fi @@ -7348,8 +7691,9 @@ fi if test ${enable_valgrind_sgcheck+y} then : enableval=$enable_valgrind_sgcheck; enable_valgrind_sgcheck=$enableval -else $as_nop - enable_valgrind_sgcheck= +else case e in #( + e) enable_valgrind_sgcheck= ;; +esac fi if test "$enable_valgrind" = "no" @@ -7364,8 +7708,8 @@ printf %s "checking for Valgrind tool sgcheck... " >&6; } if test ${ax_cv_valgrind_tool_sgcheck+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_cv_valgrind_tool_sgcheck=no if `$VALGRIND --tool=exp-sgcheck --help >/dev/null 2>&1` @@ -7374,7 +7718,8 @@ then : ax_cv_valgrind_tool_sgcheck=yes fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_sgcheck" >&5 printf "%s\n" "$ax_cv_valgrind_tool_sgcheck" >&6; } @@ -7386,16 +7731,18 @@ then : as_fn_error $? "Valgrind does not support sgcheck; reconfigure with --disable-valgrind-sgcheck" "$LINENO" 5 -else $as_nop - +else case e in #( + e) enable_valgrind_sgcheck=no - + ;; +esac fi -else $as_nop - +else case e in #( + e) enable_valgrind_sgcheck=yes - + ;; +esac fi fi @@ -7520,20 +7867,19 @@ printf %s "checking for variable-length arrays... " >&6; } if test ${ac_cv_c_vararrays+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC_NO_VLA__ - defined + #ifndef __STDC_NO_VLA__ + #error __STDC_NO_VLA__ not defined #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "defined" >/dev/null 2>&1 +if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test for VLA support. This test is partly inspired from examples in the C standard. Use at least two VLA @@ -7576,13 +7922,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_vararrays=yes -else $as_nop - ac_cv_c_vararrays=no +else case e in #( + e) ac_cv_c_vararrays=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -rf conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 printf "%s\n" "$ac_cv_c_vararrays" >&6; } @@ -7603,8 +7951,8 @@ printf %s "checking for __wasi__ defined... " >&6; } if test ${ac_cv_defined___wasi__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7613,6 +7961,7 @@ main (void) #ifdef __wasi__ int ok; + (void)ok; #else choke me #endif @@ -7624,10 +7973,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_defined___wasi__=yes -else $as_nop - ac_cv_defined___wasi__=no +else case e in #( + e) ac_cv_defined___wasi__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined___wasi__" >&5 printf "%s\n" "$ac_cv_defined___wasi__" >&6; } @@ -7639,6 +7990,121 @@ fi case $host_os in #( linux-gnu) : + ac_save_cflags=$CFLAGS + ac_cwerror_flag=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror" >&5 +printf %s "checking whether C compiler accepts -Werror... " >&6; } +if test ${ax_cv_check_cflags___Werror+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___Werror=yes +else case e in #( + e) ax_cv_check_cflags___Werror=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror" >&5 +printf "%s\n" "$ax_cv_check_cflags___Werror" >&6; } +if test "x$ax_cv_check_cflags___Werror" = xyes +then : + CFLAGS="$CFLAGS -Werror" +else case e in #( + e) : ;; +esac +fi + + ax_add_fortify_3_failed= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add -D_FORTIFY_SOURCE=3 to CPPFLAGS" >&5 +printf %s "checking whether to add -D_FORTIFY_SOURCE=3 to CPPFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + #ifndef _FORTIFY_SOURCE + return 0; + #else + _FORTIFY_SOURCE_already_defined; + #endif + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #define _FORTIFY_SOURCE 3 + #include + int main() { + char *s = " "; + strcpy(s, "x"); + return strlen(s)-1; + } + + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS=$ac_save_cflags + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3" + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS=$ac_save_cflags + ax_add_fortify_3_failed=1 + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS=$ac_save_cflags + ax_add_fortify_3_failed=1 + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -n "$ax_add_fortify_3_failed" + then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS" >&5 printf %s "checking whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7652,7 +8118,7 @@ main (void) #ifndef _FORTIFY_SOURCE return 0; #else - this_is_an_error; + _FORTIFY_SOURCE_already_defined; #endif @@ -7668,8 +8134,8 @@ then : #define _FORTIFY_SOURCE 2 #include - int main() { - const char *s = " "; + int main(void) { + char *s = " "; strcpy(s, "x"); return strlen(s)-1; } @@ -7681,24 +8147,30 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } + CFLAGS=$ac_save_cflags CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + CFLAGS=$ac_save_cflags + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + CFLAGS=$ac_save_cflags + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext + fi ;; #( *) : ;; @@ -7709,8 +8181,8 @@ printf %s "checking whether C compiler accepts -fvisibility=hidden... " >&6; } if test ${ax_cv_check_cflags___fvisibility_hidden+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7728,20 +8200,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fvisibility_hidden=yes -else $as_nop - ax_cv_check_cflags___fvisibility_hidden=no +else case e in #( + e) ax_cv_check_cflags___fvisibility_hidden=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fvisibility_hidden" >&5 printf "%s\n" "$ax_cv_check_cflags___fvisibility_hidden" >&6; } if test "x$ax_cv_check_cflags___fvisibility_hidden" = xyes then : CFLAGS="$CFLAGS -fvisibility=hidden" -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -7755,8 +8230,8 @@ printf %s "checking whether C compiler accepts -fPIC... " >&6; } if test ${ax_cv_check_cflags___fPIC+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fPIC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7774,20 +8249,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fPIC=yes -else $as_nop - ax_cv_check_cflags___fPIC=no +else case e in #( + e) ax_cv_check_cflags___fPIC=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIC" >&5 printf "%s\n" "$ax_cv_check_cflags___fPIC" >&6; } if test "x$ax_cv_check_cflags___fPIC" = xyes then : CFLAGS="$CFLAGS -fPIC" -else $as_nop - : +else case e in #( + e) : ;; +esac fi ;; @@ -7801,8 +8279,8 @@ printf %s "checking whether C compiler accepts -fPIE... " >&6; } if test ${ax_cv_check_cflags___fPIE+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fPIE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7820,12 +8298,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fPIE=yes -else $as_nop - ax_cv_check_cflags___fPIE=no +else case e in #( + e) ax_cv_check_cflags___fPIE=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIE" >&5 printf "%s\n" "$ax_cv_check_cflags___fPIE" >&6; } @@ -7837,8 +8317,8 @@ printf %s "checking whether the linker accepts -pie... " >&6; } if test ${ax_cv_check_ldflags___pie+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -pie" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7855,12 +8335,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___pie=yes -else $as_nop - ax_cv_check_ldflags___pie=no +else case e in #( + e) ax_cv_check_ldflags___pie=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___pie" >&5 printf "%s\n" "$ax_cv_check_ldflags___pie" >&6; } @@ -7870,13 +8352,15 @@ then : CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -7887,8 +8371,8 @@ printf %s "checking whether C compiler accepts -fno-strict-aliasing... " >&6; } if test ${ax_cv_check_cflags___fno_strict_aliasing+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-strict-aliasing" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7906,20 +8390,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fno_strict_aliasing=yes -else $as_nop - ax_cv_check_cflags___fno_strict_aliasing=no +else case e in #( + e) ax_cv_check_cflags___fno_strict_aliasing=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_aliasing" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_strict_aliasing" >&6; } if test "x$ax_cv_check_cflags___fno_strict_aliasing" = xyes then : CFLAGS="$CFLAGS -fno-strict-aliasing" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-strict-overflow" >&5 @@ -7927,8 +8414,8 @@ printf %s "checking whether C compiler accepts -fno-strict-overflow... " >&6; } if test ${ax_cv_check_cflags___fno_strict_overflow+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-strict-overflow" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7946,27 +8433,29 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fno_strict_overflow=yes -else $as_nop - ax_cv_check_cflags___fno_strict_overflow=no +else case e in #( + e) ax_cv_check_cflags___fno_strict_overflow=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_overflow" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_strict_overflow" >&6; } if test "x$ax_cv_check_cflags___fno_strict_overflow" = xyes then : CFLAGS="$CFLAGS -fno-strict-overflow" -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fwrapv" >&5 printf %s "checking whether C compiler accepts -fwrapv... " >&6; } if test ${ax_cv_check_cflags___fwrapv+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fwrapv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7984,23 +8473,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fwrapv=yes -else $as_nop - ax_cv_check_cflags___fwrapv=no +else case e in #( + e) ax_cv_check_cflags___fwrapv=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fwrapv" >&5 printf "%s\n" "$ax_cv_check_cflags___fwrapv" >&6; } if test "x$ax_cv_check_cflags___fwrapv" = xyes then : CFLAGS="$CFLAGS -fwrapv" -else $as_nop - : +else case e in #( + e) : ;; +esac fi - + ;; +esac fi @@ -8022,15 +8515,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flax-vector-conversions" >&5 printf %s "checking whether C compiler accepts -flax-vector-conversions... " >&6; } if test ${ax_cv_check_cflags___flax_vector_conversions+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -flax-vector-conversions" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8048,23 +8541,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___flax_vector_conversions=yes -else $as_nop - ax_cv_check_cflags___flax_vector_conversions=no +else case e in #( + e) ax_cv_check_cflags___flax_vector_conversions=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___flax_vector_conversions" >&5 printf "%s\n" "$ax_cv_check_cflags___flax_vector_conversions" >&6; } if test "x$ax_cv_check_cflags___flax_vector_conversions" = xyes then : CFLAGS="$CFLAGS -flax-vector-conversions" -else $as_nop - : +else case e in #( + e) : ;; +esac fi - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -8100,8 +8597,8 @@ printf %s "checking whether the linker accepts -Wl,--dynamicbase... " >&6; } if test ${ax_cv_check_ldflags___Wl___dynamicbase+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--dynamicbase" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8118,20 +8615,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl___dynamicbase=yes -else $as_nop - ax_cv_check_ldflags___Wl___dynamicbase=no +else case e in #( + e) ax_cv_check_ldflags___Wl___dynamicbase=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___dynamicbase" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl___dynamicbase" >&6; } if test "x$ax_cv_check_ldflags___Wl___dynamicbase" = xyes then : LDFLAGS="$LDFLAGS -Wl,--dynamicbase" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--high-entropy-va" >&5 @@ -8139,8 +8639,8 @@ printf %s "checking whether the linker accepts -Wl,--high-entropy-va... " >&6; } if test ${ax_cv_check_ldflags___Wl___high_entropy_va+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--high-entropy-va" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8157,20 +8657,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl___high_entropy_va=yes -else $as_nop - ax_cv_check_ldflags___Wl___high_entropy_va=no +else case e in #( + e) ax_cv_check_ldflags___Wl___high_entropy_va=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___high_entropy_va" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl___high_entropy_va" >&6; } if test "x$ax_cv_check_ldflags___Wl___high_entropy_va" = xyes then : LDFLAGS="$LDFLAGS -Wl,--high-entropy-va" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--nxcompat" >&5 @@ -8178,8 +8681,8 @@ printf %s "checking whether the linker accepts -Wl,--nxcompat... " >&6; } if test ${ax_cv_check_ldflags___Wl___nxcompat+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--nxcompat" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8196,20 +8699,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl___nxcompat=yes -else $as_nop - ax_cv_check_ldflags___Wl___nxcompat=no +else case e in #( + e) ax_cv_check_ldflags___Wl___nxcompat=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___nxcompat" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl___nxcompat" >&6; } if test "x$ax_cv_check_ldflags___Wl___nxcompat" = xyes then : LDFLAGS="$LDFLAGS -Wl,--nxcompat" -else $as_nop - : +else case e in #( + e) : ;; +esac fi ;; #( @@ -8225,8 +8731,8 @@ printf %s "checking whether C compiler accepts -fno-asynchronous-unwind-tables.. if test ${ax_cv_check_cflags___fno_asynchronous_unwind_tables+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8244,12 +8750,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fno_asynchronous_unwind_tables=yes -else $as_nop - ax_cv_check_cflags___fno_asynchronous_unwind_tables=no +else case e in #( + e) ax_cv_check_cflags___fno_asynchronous_unwind_tables=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&5 printf "%s\n" "$ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&6; } @@ -8258,8 +8766,9 @@ then : CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables" -else $as_nop - : +else case e in #( + e) : ;; +esac fi ;; #( @@ -8267,82 +8776,6 @@ fi ;; esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a broken Xcode version" >&5 -printf %s "checking for a broken Xcode version... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - -#if !defined(__APPLE_CC__) || __APPLE_CC__ != 6000 -#error Not Apple -#endif -#if !defined(__clang_major__) || __clang_major__ != 11 -#error Not Xcode 11 -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using unsupported Xcode version" >&5 -printf "%s\n" "$as_me: WARNING: Using unsupported Xcode version" >&2;} - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -fno-stack-check" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -fno-stack-check" >&5 -printf %s "checking whether C compiler accepts $CFLAGS -fno-stack-check... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $CFLAGS -fno-stack-check" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - CFLAGS="$CFLAGS -fno-stack-check" -else $as_nop - : -fi - - -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if test "x$enable_ssp" != "xno" then : @@ -8357,8 +8790,8 @@ printf %s "checking whether C compiler accepts -fstack-protector... " >&6; } if test ${ax_cv_check_cflags___fstack_protector+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fstack-protector" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8376,12 +8809,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___fstack_protector=yes -else $as_nop - ax_cv_check_cflags___fstack_protector=no +else case e in #( + e) ax_cv_check_cflags___fstack_protector=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector" >&5 printf "%s\n" "$ax_cv_check_cflags___fstack_protector" >&6; } @@ -8393,8 +8828,8 @@ printf %s "checking whether the linker accepts -fstack-protector... " >&6; } if test ${ax_cv_check_ldflags___fstack_protector+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -fstack-protector" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8411,12 +8846,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___fstack_protector=yes -else $as_nop - ax_cv_check_ldflags___fstack_protector=no +else case e in #( + e) ax_cv_check_ldflags___fstack_protector=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector" >&5 printf "%s\n" "$ax_cv_check_ldflags___fstack_protector" >&6; } @@ -8424,13 +8861,15 @@ if test "x$ax_cv_check_ldflags___fstack_protector" = xyes then : CFLAGS="$CFLAGS -fstack-protector" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - : +else case e in #( + e) : ;; +esac fi ;; #( @@ -8440,16 +8879,14 @@ esac fi - - -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wall" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wall" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wall" >&5 printf %s "checking whether C compiler accepts $CFLAGS -Wall... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS -Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8467,12 +8904,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8480,20 +8919,66 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CFLAGS -Wall" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wextra" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wextra" >&5 -printf %s "checking whether C compiler accepts $CFLAGS -Wextra... " >&6; } +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wno-deprecated-declarations" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wno-deprecated-declarations" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -Wno-deprecated-declarations... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $CFLAGS -Wno-deprecated-declarations" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + CFLAGS="$CFLAGS -Wno-deprecated-declarations" +else case e in #( + e) : ;; +esac +fi +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wno-unknown-pragmas" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wno-unknown-pragmas" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -Wno-unknown-pragmas... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $CFLAGS -Wextra" + CFLAGS="$CFLAGS $CFLAGS -Wno-unknown-pragmas" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8509,24 +8994,29 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : - CWFLAGS="$CFLAGS -Wextra" -else $as_nop - : + CFLAGS="$CFLAGS -Wno-unknown-pragmas" +else case e in #( + e) : ;; +esac fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 printf %s "checking for clang... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8537,7 +9027,7 @@ main (void) { #ifndef __clang__ -#error Not clang +#error Not clang nor zig cc #endif ; @@ -8548,14 +9038,14 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-warning-option" | $as_tr_sh` + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-warning-option" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-unknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8573,12 +9063,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8586,26 +9078,118 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wno-unknown-warning-option" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wbad-function-cast" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wextra" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wextra" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wextra... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $CWFLAGS -Wextra" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + CWFLAGS="$WCFLAGS -Wextra" +else case e in #( + e) : ;; +esac +fi + +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Warray-bounds" | sed "$as_sed_sh"` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Warray-bounds" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Warray-bounds... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $CWFLAGS -Warray-bounds" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + CWFLAGS="$CWFLAGS -Warray-bounds" +else case e in #( + e) : ;; +esac +fi + +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wbad-function-cast" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wbad-function-cast" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wbad-function-cast... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wbad-function-cast" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8623,12 +9207,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8636,18 +9222,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wbad-function-cast" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wcast-qual" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wcast-qual" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wcast-qual" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wcast-qual... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wcast-qual" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8665,12 +9252,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8678,18 +9267,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wcast-qual" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wdiv-by-zero" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wdiv-by-zero" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wdiv-by-zero" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8707,12 +9297,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8720,18 +9312,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wdiv-by-zero" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-branches" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-branches" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-branches" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wduplicated-branches... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wduplicated-branches" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8749,12 +9342,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8762,18 +9357,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wduplicated-branches" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-cond" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-cond" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-cond" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wduplicated-cond... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wduplicated-cond" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8791,12 +9387,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8804,18 +9402,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wduplicated-cond" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wfloat-equal" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wfloat-equal" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wfloat-equal" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wfloat-equal... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wfloat-equal" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8833,12 +9432,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8846,18 +9447,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wfloat-equal" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wformat=2" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wformat=2" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wformat=2" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wformat=2... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wformat=2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8875,12 +9477,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8888,18 +9492,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wformat=2" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wlogical-op" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wlogical-op" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wlogical-op" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wlogical-op... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wlogical-op" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8917,12 +9522,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8930,18 +9537,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wlogical-op" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmaybe-uninitialized" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmaybe-uninitialized" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmaybe-uninitialized" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8959,12 +9567,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -8972,18 +9582,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wmaybe-uninitialized" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmisleading-indentation" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmisleading-indentation" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmisleading-indentation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9001,12 +9612,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9014,18 +9627,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wmisleading-indentation" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-declarations" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-declarations" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-declarations" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wmissing-declarations... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmissing-declarations" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9043,12 +9657,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9056,18 +9672,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wmissing-declarations" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-prototypes" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-prototypes" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmissing-prototypes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9085,12 +9702,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9098,18 +9717,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wmissing-prototypes" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnested-externs" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnested-externs" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnested-externs" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wnested-externs... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnested-externs" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9127,12 +9747,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9140,18 +9762,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wnested-externs" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-type-limits" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-type-limits" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-type-limits" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wno-type-limits... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-type-limits" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9169,12 +9792,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9182,18 +9807,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wno-type-limits" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-pragmas" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-pragmas" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-unknown-pragmas" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9211,12 +9837,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9224,18 +9852,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wno-unknown-pragmas" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnormalized=id" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnormalized=id" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnormalized=id" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wnormalized=id... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnormalized=id" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9253,12 +9882,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9266,18 +9897,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wnormalized=id" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnull-dereference" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnull-dereference" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnull-dereference" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wnull-dereference... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnull-dereference" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9295,12 +9927,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9308,18 +9942,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wnull-dereference" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wold-style-declaration" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wold-style-declaration" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wold-style-declaration" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wold-style-declaration... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wold-style-declaration" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9337,12 +9972,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9350,18 +9987,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wold-style-declaration" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wpointer-arith" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wpointer-arith" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wpointer-arith" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wpointer-arith... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wpointer-arith" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9379,12 +10017,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9392,18 +10032,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wpointer-arith" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wredundant-decls" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wredundant-decls" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wredundant-decls" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wredundant-decls... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wredundant-decls" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9421,12 +10062,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9434,18 +10077,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wredundant-decls" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wrestrict" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wrestrict" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wrestrict" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wrestrict... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wrestrict" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9463,12 +10107,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9476,18 +10122,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wrestrict" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wshorten-64-to-32" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wshorten-64-to-32" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wshorten-64-to-32" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9505,12 +10152,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9518,18 +10167,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wshorten-64-to-32" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wsometimes-uninitialized" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wsometimes-uninitialized" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wsometimes-uninitialized" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9547,12 +10197,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9560,18 +10212,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wsometimes-uninitialized" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wstrict-prototypes" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wstrict-prototypes" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wstrict-prototypes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9589,12 +10242,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9602,18 +10257,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wstrict-prototypes" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wswitch-enum" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wswitch-enum" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wswitch-enum" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wswitch-enum... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wswitch-enum" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9631,12 +10287,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9644,18 +10302,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wswitch-enum" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wvariable-decl" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wvariable-decl" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wvariable-decl" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wvariable-decl... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wvariable-decl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9673,12 +10332,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9686,18 +10347,19 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wvariable-decl" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wwrite-strings" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wwrite-strings" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wwrite-strings" >&5 printf %s "checking whether C compiler accepts $CWFLAGS -Wwrite-strings... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wwrite-strings" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9715,12 +10377,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -9728,8 +10392,9 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CWFLAGS="$CWFLAGS -Wwrite-strings" -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -9741,8 +10406,8 @@ printf %s "checking whether the linker accepts -Wl,-z,relro... " >&6; } if test ${ax_cv_check_ldflags___Wl__z_relro+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,relro" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9759,20 +10424,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl__z_relro=yes -else $as_nop - ax_cv_check_ldflags___Wl__z_relro=no +else case e in #( + e) ax_cv_check_ldflags___Wl__z_relro=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_relro" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl__z_relro" >&6; } if test "x$ax_cv_check_ldflags___Wl__z_relro" = xyes then : LDFLAGS="$LDFLAGS -Wl,-z,relro" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,now" >&5 @@ -9780,8 +10448,8 @@ printf %s "checking whether the linker accepts -Wl,-z,now... " >&6; } if test ${ax_cv_check_ldflags___Wl__z_now+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,now" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9798,20 +10466,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl__z_now=yes -else $as_nop - ax_cv_check_ldflags___Wl__z_now=no +else case e in #( + e) ax_cv_check_ldflags___Wl__z_now=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_now" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl__z_now" >&6; } if test "x$ax_cv_check_ldflags___Wl__z_now" = xyes then : LDFLAGS="$LDFLAGS -Wl,-z,now" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,noexecstack" >&5 @@ -9819,8 +10490,8 @@ printf %s "checking whether the linker accepts -Wl,-z,noexecstack... " >&6; } if test ${ax_cv_check_ldflags___Wl__z_noexecstack+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9837,20 +10508,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_ldflags___Wl__z_noexecstack=yes -else $as_nop - ax_cv_check_ldflags___Wl__z_noexecstack=no +else case e in #( + e) ax_cv_check_ldflags___Wl__z_noexecstack=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + LDFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_noexecstack" >&5 printf "%s\n" "$ax_cv_check_ldflags___Wl__z_noexecstack" >&6; } if test "x$ax_cv_check_ldflags___Wl__z_noexecstack" = xyes then : LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -9862,14 +10536,14 @@ printf %s "checking whether segmentation violations can be caught... " >&6; } if test ${ax_cv_check_cCATCHABLE_SEGV+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ax_cv_check_cCATCHABLE_SEGV=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9884,9 +10558,14 @@ main (void) volatile unsigned char * volatile x = (volatile unsigned char *) malloc(8); size_t i; +#ifdef SIGPROT +signal(SIGPROT, sig); +#endif signal(SIGSEGV, sig); signal(SIGBUS, sig); #if !defined(__SANITIZE_ADDRESS__) && !defined(__EMSCRIPTEN__) +*((volatile unsigned char *) -1) = 0xd0; +*((volatile unsigned char *) 1) = 0xd0; for (i = 0; i < 10000000; i += 1024) { x[-i] = x[i] = (unsigned char) i; } #endif free((void *) x); @@ -9899,14 +10578,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_check_cCATCHABLE_SEGV=yes -else $as_nop - ax_cv_check_cCATCHABLE_SEGV=no +else case e in #( + e) ax_cv_check_cCATCHABLE_SEGV=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_SEGV" >&5 printf "%s\n" "$ax_cv_check_cCATCHABLE_SEGV" >&6; } @@ -9915,10 +10597,11 @@ then : printf "%s\n" "#define HAVE_CATCHABLE_SEGV 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&5 printf "%s\n" "$as_me: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&2;} - + ;; +esac fi @@ -9927,14 +10610,14 @@ printf %s "checking whether SIGABRT can be caught... " >&6; } if test ${ax_cv_check_cCATCHABLE_ABRT+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : ax_cv_check_cCATCHABLE_ABRT=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9979,14 +10662,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ax_cv_check_cCATCHABLE_ABRT=yes -else $as_nop - ax_cv_check_cCATCHABLE_ABRT=no +else case e in #( + e) ax_cv_check_cCATCHABLE_ABRT=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_ABRT" >&5 printf "%s\n" "$ax_cv_check_cCATCHABLE_ABRT" >&6; } @@ -9995,10 +10681,11 @@ then : printf "%s\n" "#define HAVE_CATCHABLE_ABRT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&5 printf "%s\n" "$as_me: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&2;} - + ;; +esac fi @@ -10011,8 +10698,8 @@ printf %s "checking for thread local storage (TLS) class... " >&6; } if test ${ac_cv_tls+y} then : printf %s "(cached) " >&6 -else $as_nop - for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do +else case e in #( + e) for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do case $ax_tls_keyword in #( none) : ac_cv_tls=none ; break ;; #( @@ -10032,15 +10719,17 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_tls=$ax_tls_keyword ; break -else $as_nop - ac_cv_tls=none - +else case e in #( + e) ac_cv_tls=none + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5 @@ -10058,8 +10747,8 @@ printf %s "checking whether C compiler accepts -ftls-model=local-dynamic... " >& if test ${ax_cv_check_cflags___ftls_model_local_dynamic+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ftls-model=local-dynamic" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10077,25 +10766,29 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___ftls_model_local_dynamic=yes -else $as_nop - ax_cv_check_cflags___ftls_model_local_dynamic=no +else case e in #( + e) ax_cv_check_cflags___ftls_model_local_dynamic=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftls_model_local_dynamic" >&5 printf "%s\n" "$ax_cv_check_cflags___ftls_model_local_dynamic" >&6; } if test "x$ax_cv_check_cflags___ftls_model_local_dynamic" = xyes then : CFLAGS="$CFLAGS -ftls-model=local-dynamic" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: thread local storage is not supported" >&5 -printf "%s\n" "thread local storage is not supported" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: thread local storage is not supported" >&5 +printf "%s\n" "thread local storage is not supported" >&6; } ;; +esac fi fi @@ -10108,8 +10801,8 @@ esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -10200,8 +10893,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -10226,9 +10919,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -10263,7 +10957,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -10283,13 +10978,161 @@ Xsed="$SED -e 1s/^X//" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else case e in #( + e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -10311,9 +11154,10 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in +case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -10349,7 +11193,8 @@ else ac_cv_path_FGREP=$FGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -10380,8 +11225,9 @@ test -z "$GREP" && GREP=grep if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no +else case e in #( + e) with_gnu_ld=no ;; +esac fi ac_prog=ld @@ -10426,8 +11272,8 @@ fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then +else case e in #( + e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs @@ -10450,7 +11296,8 @@ else $as_nop IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. -fi +fi ;; +esac fi LD=$lt_cv_path_LD @@ -10467,8 +11314,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 @@ -10495,8 +11343,8 @@ printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then +else case e in #( + e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else @@ -10520,13 +11368,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -10543,7 +11391,8 @@ else IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } @@ -10564,8 +11413,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DUMPBIN"; then +else case e in #( + e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10587,7 +11436,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then @@ -10613,8 +11463,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DUMPBIN"; then +else case e in #( + e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10636,7 +11486,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then @@ -10664,7 +11515,7 @@ esac fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -10690,8 +11541,8 @@ printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_nm_interface="BSD nm" +else case e in #( + e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) @@ -10704,7 +11555,8 @@ else $as_nop if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } @@ -10726,8 +11578,8 @@ printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 -else $as_nop - i=0 +else case e in #( + e) i=0 teststring=ABCD case $build_os in @@ -10768,7 +11620,7 @@ else $as_nop lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -10811,7 +11663,7 @@ else $as_nop sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -10849,7 +11701,8 @@ else $as_nop fi ;; esac - + ;; +esac fi if test -n "$lt_cv_sys_max_cmd_len"; then @@ -10906,8 +11759,8 @@ printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - case $host in +else case e in #( + e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys @@ -10938,7 +11791,8 @@ else $as_nop lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac - + ;; +esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd @@ -10954,8 +11808,8 @@ printf %s "checking how to convert $build file names to toolchain format... " >& if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - #assume ordinary cross tools, or native build. +else case e in #( + e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) @@ -10966,7 +11820,8 @@ case $host in esac ;; esac - + ;; +esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd @@ -10982,33 +11837,144 @@ printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac +else case e in #( + e) lt_cv_ld_reload_flag='-r' ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi ;; +esac +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi @@ -11024,8 +11990,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11047,7 +12013,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -11069,8 +12036,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11092,7 +12059,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -11133,8 +12101,8 @@ printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' +else case e in #( + e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -11159,7 +12127,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -11193,14 +12161,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -11214,7 +12182,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -11261,7 +12229,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -11327,7 +12295,8 @@ os2*) lt_cv_deplibs_check_method=pass_all ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } @@ -11379,8 +12348,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11402,7 +12371,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -11424,8 +12394,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11447,7 +12417,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -11489,8 +12460,8 @@ printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' +else case e in #( + e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) @@ -11510,7 +12481,8 @@ cygwin* | mingw* | pw32* | cegcc*) lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } @@ -11533,8 +12505,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11556,7 +12528,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -11582,8 +12555,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11605,7 +12578,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -11634,13 +12608,29 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -11651,8 +12641,8 @@ printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no +else case e in #( + e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11689,7 +12679,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } @@ -11714,8 +12705,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11737,7 +12728,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -11759,8 +12751,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11782,7 +12774,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -11823,8 +12816,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11846,7 +12839,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -11868,8 +12862,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -11891,7 +12885,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -12002,8 +12997,8 @@ printf %s "checking command to parse $NM output from $compiler object... " >&6; if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -12057,7 +13052,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -12075,20 +13070,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -12112,7 +13107,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -12130,9 +13125,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -12258,7 +13253,8 @@ _LT_EOF lt_cv_sys_global_symbol_pipe= fi done - + ;; +esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then @@ -12322,8 +13318,9 @@ printf %s "checking for sysroot... " >&6; } if test ${with_sysroot+y} then : withval=$with_sysroot; -else $as_nop - with_sysroot=no +else case e in #( + e) with_sysroot=no ;; +esac fi @@ -12335,7 +13332,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -12358,8 +13355,8 @@ printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then @@ -12395,7 +13392,8 @@ else ac_cv_path_lt_DD=$lt_DD fi -rm -f conftest.i conftest2.i conftest.out +rm -f conftest.i conftest2.i conftest.out ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } @@ -12406,8 +13404,8 @@ printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then @@ -12415,7 +13413,8 @@ if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; the && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -12460,7 +13459,7 @@ ia64-*-hpux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -12481,7 +13480,7 @@ ia64-*-hpux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -12493,7 +13492,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -12519,7 +13518,7 @@ mips64*-*linux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -12527,7 +13526,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -12535,7 +13534,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -12559,14 +13558,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -12625,8 +13624,8 @@ printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -12646,8 +13645,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no +else case e in #( + e) lt_cv_cc_needs_belf=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -12656,7 +13656,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } @@ -12674,7 +13675,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -12714,8 +13715,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12737,7 +13738,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then @@ -12759,8 +13761,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12782,7 +13784,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then @@ -12814,15 +13817,16 @@ printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_path_mainfest_tool=no +else case e in #( + e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } @@ -12845,8 +13849,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DSYMUTIL"; then +else case e in #( + e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12868,7 +13872,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then @@ -12890,8 +13895,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DSYMUTIL"; then +else case e in #( + e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12913,7 +13918,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then @@ -12947,8 +13953,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NMEDIT"; then +else case e in #( + e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12970,7 +13976,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then @@ -12992,8 +13999,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_NMEDIT"; then +else case e in #( + e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13015,7 +14022,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then @@ -13049,8 +14057,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LIPO"; then +else case e in #( + e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13072,7 +14080,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then @@ -13094,8 +14103,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LIPO"; then +else case e in #( + e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13117,7 +14126,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then @@ -13151,8 +14161,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then +else case e in #( + e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13174,7 +14184,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then @@ -13196,8 +14207,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13219,7 +14230,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then @@ -13253,8 +14265,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL64"; then +else case e in #( + e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13276,7 +14288,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then @@ -13298,8 +14311,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL64"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13321,7 +14334,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then @@ -13378,8 +14392,8 @@ printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no +else case e in #( + e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE @@ -13405,7 +14419,8 @@ else $as_nop fi rm -rf libconftest.dylib* rm -f conftest.* - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } @@ -13415,8 +14430,8 @@ printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" @@ -13434,13 +14449,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } @@ -13450,15 +14467,15 @@ printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_force_load=no +else case e in #( + e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -13476,7 +14493,8 @@ _LT_EOF fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } @@ -13486,11 +14504,11 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) - case ${MACOSX_DEPLOYMENT_TARGET},$host in - 10.[012],*|,*powerpc*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -13587,8 +14605,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_shared=yes +else case e in #( + e) enable_shared=yes ;; +esac fi @@ -13619,8 +14638,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_static=yes +else case e in #( + e) enable_static=yes ;; +esac fi @@ -13651,8 +14671,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - pic_mode=default +else case e in #( + e) pic_mode=default ;; +esac fi @@ -13682,8 +14703,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_fast_install=yes +else case e in #( + e) enable_fast_install=yes ;; +esac fi @@ -13710,15 +14732,17 @@ then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} +else case e in #( + e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix +else case e in #( + e) lt_cv_with_aix_soname=aix ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname + with_aix_soname=$lt_cv_with_aix_soname ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 @@ -13809,8 +14833,8 @@ printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 -else $as_nop - rm -f .libs 2>/dev/null +else case e in #( + e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs @@ -13818,7 +14842,8 @@ else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi -rmdir .libs 2>/dev/null +rmdir .libs 2>/dev/null ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } @@ -13849,8 +14874,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -13879,8 +14904,8 @@ printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -13923,6 +14948,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -13946,8 +14972,8 @@ printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -13990,6 +15016,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -14089,8 +15116,8 @@ printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no +else case e in #( + e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment @@ -14118,7 +15145,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } @@ -14362,7 +15390,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -14483,8 +15511,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +else case e in #( + e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } @@ -14499,8 +15528,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no +else case e in #( + e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment @@ -14528,7 +15557,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } @@ -14564,8 +15594,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works=no +else case e in #( + e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -14586,7 +15616,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } @@ -14608,8 +15639,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -14649,7 +15680,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -14664,8 +15696,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -14705,7 +15737,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -14785,15 +15818,15 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -14845,7 +15878,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -14957,6 +15990,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -14971,7 +16005,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -15014,7 +16048,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -15026,7 +16060,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -15042,7 +16076,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -15174,7 +16208,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -15299,8 +16333,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15332,7 +16366,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -15354,8 +16389,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15387,7 +16422,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -15445,12 +16481,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -15491,7 +16527,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -15532,8 +16568,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -15567,7 +16603,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -15638,8 +16674,8 @@ printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler__b=no +else case e in #( + e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -15660,7 +16696,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } @@ -15708,8 +16745,8 @@ printf %s "checking whether the $host_os linker accepts -exported_symbol... " >& if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 -else $as_nop - save_LDFLAGS=$LDFLAGS +else case e in #( + e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15718,12 +16755,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes -else $as_nop - lt_cv_irix_exported_symbol=no +else case e in #( + e) lt_cv_irix_exported_symbol=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS=$save_LDFLAGS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } @@ -15818,6 +16857,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -16048,8 +17088,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 -else $as_nop - $RM conftest* +else case e in #( + e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -16085,7 +17125,8 @@ else $as_nop cat conftest.err 1>&5 fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } @@ -16510,7 +17551,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -16520,14 +17561,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -16546,7 +17587,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -16583,7 +17624,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -16616,7 +17657,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -16812,8 +17853,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no +else case e in #( + e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ @@ -16840,7 +17881,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir - + ;; +esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath @@ -17265,16 +18307,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -17286,24 +18334,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - +else case e in #( + e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes - + ;; +esac fi ;; @@ -17321,22 +18372,28 @@ fi if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (void); int main (void) { @@ -17348,39 +18405,47 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no +else case e in #( + e) ac_cv_lib_dld_shl_load=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -17392,34 +18457,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -17431,34 +18504,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no +else case e in #( + e) ac_cv_lib_svld_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dld_link (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (void); int main (void) { @@ -17470,12 +18551,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no +else case e in #( + e) ac_cv_lib_dld_dld_link=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } @@ -17484,19 +18567,24 @@ then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi ;; @@ -17524,8 +18612,8 @@ printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -17619,7 +18707,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } @@ -17631,8 +18720,8 @@ printf %s "checking whether a statically linked program can dlopen itself... " > if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -17726,7 +18815,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } @@ -17769,30 +18859,41 @@ striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -17892,8 +18993,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17915,7 +19016,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -17937,8 +19039,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17960,7 +19062,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -17988,18 +19091,215 @@ fi +target_cpu_aarch64=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ARM64 target" >&5 +printf %s "checking for ARM64 target... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef __aarch64__ +#error Not aarch64 +#endif +#include + +int +main (void) +{ +(void) 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + target_cpu_aarch64=yes +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + target_cpu_aarch64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "x$EMSCRIPTEN" = "x" then : + if test "x$target_cpu_aarch64" = "xyes" +then : + + have_armcrypto=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ARM crypto instructions set" >&5 +printf %s "checking for ARM crypto instructions set... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifndef __ARM_FEATURE_CRYPTO + # define __ARM_FEATURE_CRYPTO 1 + #endif + #ifndef __ARM_FEATURE_AES + # define __ARM_FEATURE_AES 1 + #endif + + #include + + #ifdef __clang__ + # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) + #elif defined(__GNUC__) + # pragma GCC target("+simd+crypto") + #endif + +int +main (void) +{ + + int64x2_t x = { 0, 0 }; + vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0)); + vmull_high_p64(vreinterpretq_p64_s64(x), vreinterpretq_p64_s64(x)); + + #ifdef __clang__ + # pragma clang attribute pop + #endif + (void) 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_armcrypto=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + oldcflags="$CFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -march=armv8-a+crypto+aes" >&5 +printf %s "checking whether C compiler accepts -march=armv8-a+crypto+aes... " >&6; } +if test ${ax_cv_check_cflags___march_armv8_apcryptopaes+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -march=armv8-a+crypto+aes" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_cflags___march_armv8_apcryptopaes=yes +else case e in #( + e) ax_cv_check_cflags___march_armv8_apcryptopaes=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___march_armv8_apcryptopaes" >&5 +printf "%s\n" "$ax_cv_check_cflags___march_armv8_apcryptopaes" >&6; } +if test "x$ax_cv_check_cflags___march_armv8_apcryptopaes" = xyes +then : + + CFLAGS="$CFLAGS -march=armv8-a+crypto+aes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ARM crypto instructions set with -march=armv8-a+crypto+aes" >&5 +printf %s "checking for ARM crypto instructions set with -march=armv8-a+crypto+aes... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef __clang__ + # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) + #elif defined(__GNUC__) + # pragma GCC target("+simd+crypto") + #endif + #ifndef __ARM_FEATURE_CRYPTO + # define __ARM_FEATURE_CRYPTO 1 + #endif + #ifndef __ARM_FEATURE_AES + # define __ARM_FEATURE_AES 1 + #endif + + #include + +int +main (void) +{ + + int64x2_t x = { 0, 0 }; + vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0)); + vmull_high_p64(vreinterpretq_p64_s64(x), vreinterpretq_p64_s64(x)); + + #ifdef __clang__ + # pragma clang attribute pop + #endif + (void) 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - with addition of -march=armv8-a+crypto+aes" >&5 +printf "%s\n" "yes - with addition of -march=armv8-a+crypto+aes" >&6; } + have_armcrypto=yes + CFLAGS_ARMCRYPTO="-march=armv8-a+crypto+aes" + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$oldcflags" + +else case e in #( + e) : ;; +esac +fi + + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$have_armcrypto" = "yes" +then : + +printf "%s\n" "#define HAVE_ARMCRYPTO 1" >>confdefs.h + +fi + +fi + oldcflags="$CFLAGS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mmmx" >&5 printf %s "checking whether C compiler accepts -mmmx... " >&6; } if test ${ax_cv_check_cflags___mmmx+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mmmx" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18017,20 +19317,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mmmx=yes -else $as_nop - ax_cv_check_cflags___mmmx=no +else case e in #( + e) ax_cv_check_cflags___mmmx=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 printf "%s\n" "$ax_cv_check_cflags___mmmx" >&6; } if test "x$ax_cv_check_cflags___mmmx" = xyes then : CFLAGS="$CFLAGS -mmmx" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MMX instructions set" >&5 @@ -18049,7 +19352,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18061,8 +19364,8 @@ printf %s "checking whether C compiler accepts -mmmx... " >&6; } if test ${ax_cv_check_cflags___mmmx+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mmmx" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18080,27 +19383,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mmmx=yes -else $as_nop - ax_cv_check_cflags___mmmx=no +else case e in #( + e) ax_cv_check_cflags___mmmx=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 printf "%s\n" "$ax_cv_check_cflags___mmmx" >&6; } if test "x$ax_cv_check_cflags___mmmx" = xyes then : CFLAGS_MMX="-mmmx" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18109,8 +19417,8 @@ printf %s "checking whether C compiler accepts -msse2... " >&6; } if test ${ax_cv_check_cflags___msse2+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18128,20 +19436,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse2=yes -else $as_nop - ax_cv_check_cflags___msse2=no +else case e in #( + e) ax_cv_check_cflags___msse2=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 printf "%s\n" "$ax_cv_check_cflags___msse2" >&6; } if test "x$ax_cv_check_cflags___msse2" = xyes then : CFLAGS="$CFLAGS -msse2" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE2 instructions set" >&5 @@ -18164,7 +19475,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18176,8 +19487,8 @@ printf %s "checking whether C compiler accepts -msse2... " >&6; } if test ${ax_cv_check_cflags___msse2+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18195,27 +19506,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse2=yes -else $as_nop - ax_cv_check_cflags___msse2=no +else case e in #( + e) ax_cv_check_cflags___msse2=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 printf "%s\n" "$ax_cv_check_cflags___msse2" >&6; } if test "x$ax_cv_check_cflags___msse2" = xyes then : CFLAGS_SSE2="-msse2" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18224,8 +19540,8 @@ printf %s "checking whether C compiler accepts -msse3... " >&6; } if test ${ax_cv_check_cflags___msse3+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse3" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18243,20 +19559,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse3=yes -else $as_nop - ax_cv_check_cflags___msse3=no +else case e in #( + e) ax_cv_check_cflags___msse3=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 printf "%s\n" "$ax_cv_check_cflags___msse3" >&6; } if test "x$ax_cv_check_cflags___msse3" = xyes then : CFLAGS="$CFLAGS -msse3" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE3 instructions set" >&5 @@ -18276,7 +19595,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18288,8 +19607,8 @@ printf %s "checking whether C compiler accepts -msse3... " >&6; } if test ${ax_cv_check_cflags___msse3+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse3" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18307,27 +19626,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse3=yes -else $as_nop - ax_cv_check_cflags___msse3=no +else case e in #( + e) ax_cv_check_cflags___msse3=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 printf "%s\n" "$ax_cv_check_cflags___msse3" >&6; } if test "x$ax_cv_check_cflags___msse3" = xyes then : CFLAGS_SSE3="-msse3" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18336,8 +19660,8 @@ printf %s "checking whether C compiler accepts -mssse3... " >&6; } if test ${ax_cv_check_cflags___mssse3+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mssse3" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18355,20 +19679,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mssse3=yes -else $as_nop - ax_cv_check_cflags___mssse3=no +else case e in #( + e) ax_cv_check_cflags___mssse3=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 printf "%s\n" "$ax_cv_check_cflags___mssse3" >&6; } if test "x$ax_cv_check_cflags___mssse3" = xyes then : CFLAGS="$CFLAGS -mssse3" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSSE3 instructions set" >&5 @@ -18387,7 +19714,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18399,8 +19726,8 @@ printf %s "checking whether C compiler accepts -mssse3... " >&6; } if test ${ax_cv_check_cflags___mssse3+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mssse3" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18418,27 +19745,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mssse3=yes -else $as_nop - ax_cv_check_cflags___mssse3=no +else case e in #( + e) ax_cv_check_cflags___mssse3=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 printf "%s\n" "$ax_cv_check_cflags___mssse3" >&6; } if test "x$ax_cv_check_cflags___mssse3" = xyes then : CFLAGS_SSSE3="-mssse3" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18447,8 +19779,8 @@ printf %s "checking whether C compiler accepts -msse4.1... " >&6; } if test ${ax_cv_check_cflags___msse4_1+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse4.1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18466,20 +19798,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse4_1=yes -else $as_nop - ax_cv_check_cflags___msse4_1=no +else case e in #( + e) ax_cv_check_cflags___msse4_1=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 printf "%s\n" "$ax_cv_check_cflags___msse4_1" >&6; } if test "x$ax_cv_check_cflags___msse4_1" = xyes then : CFLAGS="$CFLAGS -msse4.1" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE4.1 instructions set" >&5 @@ -18498,7 +19833,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18510,8 +19845,8 @@ printf %s "checking whether C compiler accepts -msse4.1... " >&6; } if test ${ax_cv_check_cflags___msse4_1+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse4.1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18529,27 +19864,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___msse4_1=yes -else $as_nop - ax_cv_check_cflags___msse4_1=no +else case e in #( + e) ax_cv_check_cflags___msse4_1=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 printf "%s\n" "$ax_cv_check_cflags___msse4_1" >&6; } if test "x$ax_cv_check_cflags___msse4_1" = xyes then : CFLAGS_SSE41="-msse4.1" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18558,8 +19898,8 @@ printf %s "checking whether C compiler accepts -mavx... " >&6; } if test ${ax_cv_check_cflags___mavx+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18577,20 +19917,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx=yes -else $as_nop - ax_cv_check_cflags___mavx=no +else case e in #( + e) ax_cv_check_cflags___mavx=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx" >&6; } if test "x$ax_cv_check_cflags___mavx" = xyes then : CFLAGS="$CFLAGS -mavx" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX instructions set" >&5 @@ -18609,7 +19952,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18621,8 +19964,8 @@ printf %s "checking whether C compiler accepts -mavx... " >&6; } if test ${ax_cv_check_cflags___mavx+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18640,27 +19983,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx=yes -else $as_nop - ax_cv_check_cflags___mavx=no +else case e in #( + e) ax_cv_check_cflags___mavx=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx" >&6; } if test "x$ax_cv_check_cflags___mavx" = xyes then : CFLAGS_AVX="-mavx" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18669,8 +20017,8 @@ printf %s "checking whether C compiler accepts -mavx2... " >&6; } if test ${ax_cv_check_cflags___mavx2+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18688,20 +20036,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx2=yes -else $as_nop - ax_cv_check_cflags___mavx2=no +else case e in #( + e) ax_cv_check_cflags___mavx2=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx2" >&6; } if test "x$ax_cv_check_cflags___mavx2" = xyes then : CFLAGS="$CFLAGS -mavx2" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX2 instructions set" >&5 @@ -18724,7 +20075,7 @@ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ)); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18736,8 +20087,8 @@ printf %s "checking whether C compiler accepts -mavx2... " >&6; } if test ${ax_cv_check_cflags___mavx2+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18755,20 +20106,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx2=yes -else $as_nop - ax_cv_check_cflags___mavx2=no +else case e in #( + e) ax_cv_check_cflags___mavx2=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx2" >&6; } if test "x$ax_cv_check_cflags___mavx2" = xyes then : CFLAGS_AVX2="-mavx2" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _mm256_broadcastsi128_si256 is correctly defined" >&5 @@ -18787,24 +20141,28 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "#define _mm256_broadcastsi128_si256 _mm_broadcastsi128_si256" >>confdefs.h - + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18813,8 +20171,8 @@ printf %s "checking whether C compiler accepts -mavx512f... " >&6; } if test ${ax_cv_check_cflags___mavx512f+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx512f" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18832,20 +20190,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx512f=yes -else $as_nop - ax_cv_check_cflags___mavx512f=no +else case e in #( + e) ax_cv_check_cflags___mavx512f=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx512f" >&6; } if test "x$ax_cv_check_cflags___mavx512f" = xyes then : CFLAGS="$CFLAGS -mavx512f" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX512F instructions set" >&5 @@ -18880,7 +20241,7 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7), return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -18892,8 +20253,8 @@ printf %s "checking whether C compiler accepts -mavx512f... " >&6; } if test ${ax_cv_check_cflags___mavx512f+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx512f" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18911,33 +20272,36 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mavx512f=yes -else $as_nop - ax_cv_check_cflags___mavx512f=no +else case e in #( + e) ax_cv_check_cflags___mavx512f=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 printf "%s\n" "$ax_cv_check_cflags___mavx512f" >&6; } if test "x$ax_cv_check_cflags___mavx512f" = xyes then : CFLAGS_AVX512F="-mavx512f" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -mno-avx512f" | $as_tr_sh` + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -mno-avx512f" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -mno-avx512f" >&5 printf %s "checking whether C compiler accepts $CFLAGS -mno-avx512f... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS -mno-avx512f" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18955,12 +20319,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -18968,13 +20334,16 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : CFLAGS="$CFLAGS -mno-avx512f" -else $as_nop - : +else case e in #( + e) : ;; +esac fi - + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -18983,8 +20352,8 @@ printf %s "checking whether C compiler accepts -maes... " >&6; } if test ${ax_cv_check_cflags___maes+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -maes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19002,20 +20371,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___maes=yes -else $as_nop - ax_cv_check_cflags___maes=no +else case e in #( + e) ax_cv_check_cflags___maes=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 printf "%s\n" "$ax_cv_check_cflags___maes" >&6; } if test "x$ax_cv_check_cflags___maes" = xyes then : CFLAGS="$CFLAGS -maes" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 @@ -19023,8 +20395,8 @@ printf %s "checking whether C compiler accepts -mpclmul... " >&6; } if test ${ax_cv_check_cflags___mpclmul+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mpclmul" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19042,20 +20414,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mpclmul=yes -else $as_nop - ax_cv_check_cflags___mpclmul=no +else case e in #( + e) ax_cv_check_cflags___mpclmul=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 printf "%s\n" "$ax_cv_check_cflags___mpclmul" >&6; } if test "x$ax_cv_check_cflags___mpclmul" = xyes then : CFLAGS="$CFLAGS -mpclmul" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AESNI instructions set and PCLMULQDQ" >&5 @@ -19076,7 +20451,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -19088,8 +20463,8 @@ printf %s "checking whether C compiler accepts -maes... " >&6; } if test ${ax_cv_check_cflags___maes+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -maes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19107,20 +20482,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___maes=yes -else $as_nop - ax_cv_check_cflags___maes=no +else case e in #( + e) ax_cv_check_cflags___maes=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 printf "%s\n" "$ax_cv_check_cflags___maes" >&6; } if test "x$ax_cv_check_cflags___maes" = xyes then : CFLAGS_AESNI="-maes" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 @@ -19128,8 +20506,8 @@ printf %s "checking whether C compiler accepts -mpclmul... " >&6; } if test ${ax_cv_check_cflags___mpclmul+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mpclmul" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19147,28 +20525,33 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mpclmul=yes -else $as_nop - ax_cv_check_cflags___mpclmul=no +else case e in #( + e) ax_cv_check_cflags___mpclmul=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 printf "%s\n" "$ax_cv_check_cflags___mpclmul" >&6; } if test "x$ax_cv_check_cflags___mpclmul" = xyes then : CFLAGS_PCLMUL="-mpclmul" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" @@ -19177,8 +20560,8 @@ printf %s "checking whether C compiler accepts -mrdrnd... " >&6; } if test ${ax_cv_check_cflags___mrdrnd+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mrdrnd" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19196,20 +20579,23 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mrdrnd=yes -else $as_nop - ax_cv_check_cflags___mrdrnd=no +else case e in #( + e) ax_cv_check_cflags___mrdrnd=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 printf "%s\n" "$ax_cv_check_cflags___mrdrnd" >&6; } if test "x$ax_cv_check_cflags___mrdrnd" = xyes then : CFLAGS="$CFLAGS -mrdrnd" -else $as_nop - : +else case e in #( + e) : ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RDRAND" >&5 @@ -19228,7 +20614,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -19240,8 +20626,8 @@ printf %s "checking whether C compiler accepts -mrdrnd... " >&6; } if test ${ax_cv_check_cflags___mrdrnd+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mrdrnd" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19259,28 +20645,33 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_check_cflags___mrdrnd=yes -else $as_nop - ax_cv_check_cflags___mrdrnd=no +else case e in #( + e) ax_cv_check_cflags___mrdrnd=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 printf "%s\n" "$ax_cv_check_cflags___mrdrnd" >&6; } if test "x$ax_cv_check_cflags___mrdrnd" = xyes then : CFLAGS_RDRAND="-mrdrnd" -else $as_nop - : +else case e in #( + e) : ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" @@ -19298,11 +20689,18 @@ fi + ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mman_h" = xyes then : printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + fi ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" if test "x$ac_cv_header_sys_random_h" = xyes @@ -19316,6 +20714,26 @@ then : printf "%s\n" "#define HAVE_INTRIN_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/auxv.h" "ac_cv_header_sys_auxv_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_auxv_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_AUXV_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "CommonCrypto/CommonRandom.h" "ac_cv_header_CommonCrypto_CommonRandom_h" "$ac_includes_default" +if test "x$ac_cv_header_CommonCrypto_CommonRandom_h" = xyes +then : + printf "%s\n" "#define HAVE_COMMONCRYPTO_COMMONRANDOM_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "cet.h" "ac_cv_header_cet_h" "$ac_includes_default" +if test "x$ac_cv_header_cet_h" = xyes +then : + printf "%s\n" "#define HAVE_CET_H 1" >>confdefs.h + +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _xgetbv() is available" >&5 @@ -19338,9 +20756,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE__XGETBV 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19351,8 +20770,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19370,7 +20789,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -19402,8 +20822,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19449,8 +20869,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -19481,8 +20901,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -19526,8 +20947,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -19554,22 +20976,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -19578,9 +21001,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -19603,14 +21027,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -19651,17 +21078,19 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CPPFLAGS="$CPPFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" - + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use inline asm code" >&5 printf %s "checking whether we can use inline asm code... " >&6; } @@ -19737,9 +21166,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_AMD64_ASM 1" >>confdefs.h HAVE_AMD64_ASM_V=1 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19791,9 +21221,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_AVX_ASM 1" >>confdefs.h HAVE_AVX_ASM_V=1 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19858,9 +21289,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_TI_MODE 1" >>confdefs.h HAVE_TI_MODE_V=1 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $HAVE_TI_MODE_V = 1; then @@ -19904,9 +21336,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h HAVE_CPUID_V=1 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19945,9 +21378,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } asm_hide_symbol=".private_extern" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19981,15 +21415,17 @@ printf "%s\n" "yes" >&6; } if test "$asm_hide_symbol" = "unsupported" then : asm_hide_symbol=".hidden" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unable to reliably tag symbols as private" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unable to reliably tag symbols as private" >&5 printf "%s\n" "$as_me: unable to reliably tag symbols as private" >&6;} - asm_hide_symbol="unsupported" + asm_hide_symbol="unsupported" ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -20032,58 +21468,82 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if data alignment is required" >&5 -printf %s "checking if data alignment is required... " >&6; } -aligned_access_required=yes -case $host_cpu in #( - i?86|amd64|x86_64|powerpc*|s390*) : - aligned_access_required=no ;; #( - arm*) : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if atomic operations are supported" >&5 +printf %s "checking if atomic operations are supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __ARM_FEATURE_UNALIGNED -# error data alignment is required -#endif - int main (void) { +static volatile int _sodium_lock; +__sync_lock_test_and_set(&_sodium_lock, 1); +__sync_lock_release(&_sodium_lock); + + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - aligned_access_required=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ;; #( - *) : - ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_ATOMIC_OPS 1" >>confdefs.h + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac -if test "x$aligned_access_required" = "xyes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if C11 memory fences are supported" >&5 +printf %s "checking if C11 memory fences are supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main (void) +{ + +atomic_thread_fence(memory_order_acquire); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "#define CPU_UNALIGNED_ACCESS 1" >>confdefs.h +printf "%s\n" "#define HAVE_C11_MEMORY_FENCES 1" >>confdefs.h +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if atomic operations are supported" >&5 -printf %s "checking if atomic operations are supported... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gcc memory fences are supported" >&5 +printf %s "checking if gcc memory fences are supported... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20091,9 +21551,7 @@ int main (void) { -static volatile int _sodium_lock; -__sync_lock_test_and_set(&_sodium_lock, 1); -__sync_lock_release(&_sodium_lock); +__atomic_thread_fence(__ATOMIC_ACQUIRE); ; @@ -20105,11 +21563,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_ATOMIC_OPS 1" >>confdefs.h +printf "%s\n" "#define HAVE_GCC_MEMORY_FENCES 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -20119,10 +21578,11 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works @@ -20132,8 +21592,8 @@ printf %s "checking for working alloca.h... " >&6; } if test ${ac_cv_working_alloca_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -20148,11 +21608,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_working_alloca_h=yes -else $as_nop - ac_cv_working_alloca_h=no +else case e in #( + e) ac_cv_working_alloca_h=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 printf "%s\n" "$ac_cv_working_alloca_h" >&6; } @@ -20167,10 +21629,10 @@ printf %s "checking for alloca... " >&6; } if test ${ac_cv_func_alloca_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test $ac_cv_working_alloca_h = yes; then - ac_cv_func_alloca_works=yes -else +else case e in #( + e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h +if test "$ac_cv_func_alloca_works" != yes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20201,15 +21663,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_func_alloca_works=yes -else $as_nop - ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 printf "%s\n" "$ac_cv_func_alloca_works" >&6; } -fi if test $ac_cv_func_alloca_works = yes; then @@ -20231,12 +21692,12 @@ printf %s "checking stack direction for C alloca... " >&6; } if test ${ac_cv_c_stack_direction+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_c_stack_direction=0 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -20259,13 +21720,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_stack_direction=1 -else $as_nop - ac_cv_c_stack_direction=-1 +else case e in #( + e) ac_cv_c_stack_direction=-1 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 printf "%s\n" "$ac_cv_c_stack_direction" >&6; } @@ -20318,9 +21782,22 @@ then : fi + ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" +if test "x$ac_cv_func_raise" = xyes +then : + printf "%s\n" "#define HAVE_RAISE 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" +if test "x$ac_cv_func_sysconf" = xyes +then : + printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h fi + +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getrandom with a standard API" >&5 printf %s "checking for getrandom with a standard API... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20333,16 +21810,15 @@ printf %s "checking for getrandom with a standard API... " >&6; } #ifdef HAVE_SYS_RANDOM_H # include #endif -#ifdef __SANITIZE_ADDRESS__ -# error A recent libasan version on an old system may intercept nonexistent functions -#endif int main (void) { unsigned char buf; -(void) getrandom((void *) &buf, 1U, 0U); +if (&getrandom != NULL) { + (void) getrandom((void *) &buf, 1U, 0U); +} ; return 0; @@ -20359,10 +21835,11 @@ then : fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -20379,16 +21856,12 @@ printf %s "checking for getentropy with a standard API... " >&6; } #ifdef HAVE_SYS_RANDOM_H # include #endif -#ifdef __SANITIZE_ADDRESS__ -# error A recent libasan version on an old system may intercept nonexistent functions -#endif int main (void) { unsigned char buf; - if (&getentropy != NULL) { (void) getentropy((void *) &buf, 1U); } @@ -20408,10 +21881,11 @@ then : fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -20428,10 +21902,10 @@ then : fi - ac_fn_c_check_func "$LINENO" "getauxva" "ac_cv_func_getauxva" -if test "x$ac_cv_func_getauxva" = xyes + ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval" +if test "x$ac_cv_func_getauxval" = xyes then : - printf "%s\n" "#define HAVE_GETAUXVA 1" >>confdefs.h + printf "%s\n" "#define HAVE_GETAUXVAL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "elf_aux_info" "ac_cv_func_elf_aux_info" @@ -20456,6 +21930,12 @@ then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi if test "x$WASI" = "x" @@ -20472,6 +21952,12 @@ if test "x$ac_cv_func_explicit_bzero" = xyes then : printf "%s\n" "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "memset_explicit" "ac_cv_func_memset_explicit" +if test "x$ac_cv_func_memset_explicit" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET_EXPLICIT 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset" if test "x$ac_cv_func_explicit_memset" = xyes @@ -20490,7 +21976,7 @@ if test "x$EMSCRIPTEN" != "x" then : EXEEXT=.js - TEST_LDFLAGS='--memory-init-file 0 --pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' + TEST_LDFLAGS='--pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' fi @@ -20523,8 +22009,8 @@ printf %s "checking if gcc/ld supports -Wl,--output-def... " >&6; } if test ${gl_cv_ld_output_def+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$enable_shared" = no; then +else case e in #( + e) if test "$enable_shared" = no; then gl_cv_ld_output_def="not needed, shared libraries are disabled" else gl_ldflags_save=$LDFLAGS @@ -20543,14 +22029,16 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : gl_cv_ld_output_def=yes -else $as_nop - gl_cv_ld_output_def=no +else case e in #( + e) gl_cv_ld_output_def=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext rm -f conftest.def LDFLAGS="$gl_ldflags_save" - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_ld_output_def" >&5 printf "%s\n" "$gl_cv_ld_output_def" >&6; } @@ -20574,7 +22062,7 @@ then : fi -ac_config_files="$ac_config_files Makefile builds/Makefile contrib/Makefile dist-build/Makefile libsodium.pc libsodium-uninstalled.pc msvc-scripts/Makefile src/Makefile src/libsodium/Makefile src/libsodium/include/Makefile src/libsodium/include/sodium/version.h test/default/Makefile test/Makefile" +ac_config_files="$ac_config_files Makefile builds/Makefile contrib/Makefile dist-build/Makefile libsodium.pc libsodium-uninstalled.pc src/Makefile src/libsodium/Makefile src/libsodium/include/Makefile src/libsodium/include/sodium/version.h test/default/Makefile test/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20586,8 +22074,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -20617,14 +22105,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -20688,9 +22176,7 @@ s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g +s/[][ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\$/$$/g H :any @@ -20814,7 +22300,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -20823,12 +22308,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -20900,7 +22386,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -20929,7 +22415,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -20969,11 +22454,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -20987,11 +22473,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -21074,9 +22561,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -21157,10 +22644,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -21175,8 +22664,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libsodium $as_me 1.0.18, which was -generated by GNU Autoconf 2.71. Invocation command line was +This file was extended by libsodium $as_me 1.0.20, which was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21204,7 +22693,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -21235,11 +22724,11 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libsodium config.status 1.0.18 -configured by $0, generated by GNU Autoconf 2.71, +libsodium config.status 1.0.20 +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -21299,8 +22788,8 @@ do ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -21387,6 +22876,7 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -21395,6 +22885,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -21515,6 +23006,7 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -21523,7 +23015,6 @@ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -21644,7 +23135,6 @@ do "dist-build/Makefile") CONFIG_FILES="$CONFIG_FILES dist-build/Makefile" ;; "libsodium.pc") CONFIG_FILES="$CONFIG_FILES libsodium.pc" ;; "libsodium-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES libsodium-uninstalled.pc" ;; - "msvc-scripts/Makefile") CONFIG_FILES="$CONFIG_FILES msvc-scripts/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libsodium/Makefile") CONFIG_FILES="$CONFIG_FILES src/libsodium/Makefile" ;; "src/libsodium/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/libsodium/include/Makefile" ;; @@ -21652,7 +23142,7 @@ do "test/default/Makefile") CONFIG_FILES="$CONFIG_FILES test/default/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -21671,7 +23161,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -21695,7 +23185,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -21861,7 +23351,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -21883,19 +23373,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -22028,7 +23518,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -22059,9 +23549,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -22159,15 +23649,15 @@ printf "%s\n" X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} @@ -22311,6 +23801,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -22335,8 +23828,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -22712,7 +24208,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || diff --git a/src/libsodium/configure.ac b/src/libsodium/configure.ac index b20e5112c..0b27e0659 100644 --- a/src/libsodium/configure.ac +++ b/src/libsodium/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([libsodium],[1.0.18],[https://github.com/jedisct1/libsodium/issues],[libsodium],[https://libsodium.org]) +AC_INIT([libsodium],[1.0.20],[https://github.com/jedisct1/libsodium/issues],[libsodium],[https://libsodium.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/libsodium/sodium/version.c]) @@ -12,10 +12,10 @@ AM_DEP_TRACK AC_SUBST(VERSION) -SODIUM_LIBRARY_VERSION_MAJOR=10 -SODIUM_LIBRARY_VERSION_MINOR=3 -DLL_VERSION=24 -SODIUM_LIBRARY_VERSION=26:0:3 +SODIUM_LIBRARY_VERSION_MAJOR=26 +SODIUM_LIBRARY_VERSION_MINOR=2 +DLL_VERSION=26 +SODIUM_LIBRARY_VERSION=28:0:2 # | | | # +------+ | +---+ # | | | @@ -42,10 +42,22 @@ AS_IF([pwd | fgrep ' ' > /dev/null 2>&1], [AC_MSG_ERROR([The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions])] ) +sodium_CFLAGS=${CFLAGS+set} +: ${CFLAGS=""} + AC_PROG_CC AM_PROG_AS AC_USE_SYSTEM_EXTENSIONS +dnl Default optimization flags + +if test "$sodium_CFLAGS" != "set" ; then + AX_CHECK_COMPILE_FLAG([-O3], [CFLAGS="$CFLAGS -O3"], + [AX_CHECK_COMPILE_FLAG([-O2], [CFLAGS="$CFLAGS -O2"], + [AX_CHECK_COMPILE_FLAG([-O1], [CFLAGS="$CFLAGS -O1"], + [AX_CHECK_COMPILE_FLAG([-O], [CFLAGS="$CFLAGS -O"])])])]) +fi + dnl Switches AC_ARG_ENABLE(ssp, @@ -79,7 +91,7 @@ AS_IF([test "x$EMSCRIPTEN" != "x"], [ enable_asm="no" AC_MSG_WARN([compiling to JavaScript - asm implementations disabled]) ], [ - AC_MSG_WARN([EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code]) + AC_MSG_WARN([EMSCRIPTEN environment variable defined, but emcc doesn\'t appear to be used - Assuming compilation to native code]) CFLAGS="$CFLAGS -U__EMSCRIPTEN__" unset EMSCRIPTEN ]) @@ -118,7 +130,7 @@ AM_CONDITIONAL([MINIMAL], [test x$enable_minimal = xyes]) AC_SUBST(SODIUM_LIBRARY_MINIMAL_DEF) AC_ARG_WITH(pthreads, AS_HELP_STRING([--with-pthreads], - [use pthreads library, or --without-pthreads to disable threading support.]), + [use pthreads library, or --without-pthreads to disable threading support]), [ ], [withval="yes"]) AS_IF([test "x$withval" = "xyes"], [ @@ -197,11 +209,11 @@ AC_ARG_ENABLE(opt, [AS_HELP_STRING(--enable-opt,Optimize for the native CPU - The resulting library will be faster but not portable)], [ 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"]) + AX_CHECK_COMPILE_FLAG([-mtune=native], [CFLAGS="$CFLAGS -mtune=native"]) ]) ]) @@ -280,23 +292,6 @@ AS_CASE([$host_os], ]) ]) -AC_MSG_CHECKING(for a broken Xcode version) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ -#if !defined(__APPLE_CC__) || __APPLE_CC__ != 6000 -#error Not Apple -#endif -#if !defined(__clang_major__) || __clang_major__ != 11 -#error Not Xcode 11 -#endif -]])], - [AC_MSG_RESULT(yes) - AC_MSG_WARN([Using unsupported Xcode version]) - AX_CHECK_COMPILE_FLAG([$CFLAGS -fno-stack-check], - [CFLAGS="$CFLAGS -fno-stack-check"]) - ], - [AC_MSG_RESULT(no) -]) - AS_IF([test "x$enable_ssp" != "xno"],[ AS_CASE([$host_os], @@ -310,15 +305,16 @@ AS_CASE([$host_os], ]) ]) -AC_ARG_VAR([CWFLAGS], [define to compilation flags for generating extra warnings]) - AX_CHECK_COMPILE_FLAG([$CFLAGS -Wall], [CWFLAGS="$CFLAGS -Wall"]) -AX_CHECK_COMPILE_FLAG([$CFLAGS -Wextra], [CWFLAGS="$CFLAGS -Wextra"]) +AX_CHECK_COMPILE_FLAG([$CFLAGS -Wno-deprecated-declarations], [CFLAGS="$CFLAGS -Wno-deprecated-declarations"]) +AX_CHECK_COMPILE_FLAG([$CFLAGS -Wno-unknown-pragmas], [CFLAGS="$CFLAGS -Wno-unknown-pragmas"]) + +AC_ARG_VAR([CWFLAGS], [compilation flags for generating extra warnings]) AC_MSG_CHECKING(for clang) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ #ifndef __clang__ -#error Not clang +#error Not clang nor zig cc #endif ]])], [AC_MSG_RESULT(yes) @@ -328,6 +324,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_MSG_RESULT(no) ]) +AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wextra], [CWFLAGS="$WCFLAGS -Wextra"]) +AX_CHECK_COMPILE_FLAG([$CWFLAGS -Warray-bounds], [CWFLAGS="$CWFLAGS -Warray-bounds"]) AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wbad-function-cast], [CWFLAGS="$CWFLAGS -Wbad-function-cast"]) AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wcast-qual], [CWFLAGS="$CWFLAGS -Wcast-qual"]) AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wdiv-by-zero], [CWFLAGS="$CWFLAGS -Wdiv-by-zero"]) @@ -377,14 +375,102 @@ AC_SUBST(LIBTOOL_DEPS) AC_ARG_VAR([AR], [path to the ar utility]) AC_CHECK_TOOL([AR], [ar], [ar]) -dnl Checks for headers +dnl Checks for headers and codegen feature flags + +target_cpu_aarch64=no +AC_MSG_CHECKING(for ARM64 target) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ +#ifndef __aarch64__ +#error Not aarch64 +#endif +#include + ], [(void) 0])], + [AC_MSG_RESULT(yes) + target_cpu_aarch64=yes], + [AC_MSG_RESULT(no) + target_cpu_aarch64=no]) AS_IF([test "x$EMSCRIPTEN" = "x"], [ + AS_IF([test "x$target_cpu_aarch64" = "xyes"], [ + have_armcrypto=no + AC_MSG_CHECKING(for ARM crypto instructions set) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #ifndef __ARM_FEATURE_CRYPTO + # define __ARM_FEATURE_CRYPTO 1 + #endif + #ifndef __ARM_FEATURE_AES + # define __ARM_FEATURE_AES 1 + #endif + + #include + + #ifdef __clang__ + # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) + #elif defined(__GNUC__) + # pragma GCC target("+simd+crypto") + #endif + ]], [[ + int64x2_t x = { 0, 0 }; + vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0)); + vmull_high_p64(vreinterpretq_p64_s64(x), vreinterpretq_p64_s64(x)); + + #ifdef __clang__ + # pragma clang attribute pop + #endif + (void) 0 + ]])], + [ + AC_MSG_RESULT(yes) + have_armcrypto=yes + ], + [ + AC_MSG_RESULT(no) + oldcflags="$CFLAGS" + AX_CHECK_COMPILE_FLAG([-march=armv8-a+crypto+aes], [ + CFLAGS="$CFLAGS -march=armv8-a+crypto+aes" + AC_MSG_CHECKING(for ARM crypto instructions set with -march=armv8-a+crypto+aes) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #ifdef __clang__ + # pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) + #elif defined(__GNUC__) + # pragma GCC target("+simd+crypto") + #endif + #ifndef __ARM_FEATURE_CRYPTO + # define __ARM_FEATURE_CRYPTO 1 + #endif + #ifndef __ARM_FEATURE_AES + # define __ARM_FEATURE_AES 1 + #endif + + #include + ]], [[ + int64x2_t x = { 0, 0 }; + vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0)); + vmull_high_p64(vreinterpretq_p64_s64(x), vreinterpretq_p64_s64(x)); + + #ifdef __clang__ + # pragma clang attribute pop + #endif + (void) 0 + ]])], + [ + AC_MSG_RESULT(yes - with addition of -march=armv8-a+crypto+aes) + have_armcrypto=yes + CFLAGS_ARMCRYPTO="-march=armv8-a+crypto+aes" + ], + [AC_MSG_RESULT(no)]) + CFLAGS="$oldcflags" + ]) + ]) + AS_IF([test "$have_armcrypto" = "yes"],[AC_DEFINE([HAVE_ARMCRYPTO], [1], [ARM crypto extensions are available])]) + ]) + oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mmmx], [CFLAGS="$CFLAGS -mmmx"]) AC_MSG_CHECKING(for MMX instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("mmx") #include ]], [[ __m64 x = _mm_setzero_si64(); ]])], @@ -397,7 +483,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-msse2], [CFLAGS="$CFLAGS -msse2"]) AC_MSG_CHECKING(for SSE2 instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("sse2") #ifndef __SSE2__ # define __SSE2__ @@ -414,7 +500,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-msse3], [CFLAGS="$CFLAGS -msse3"]) AC_MSG_CHECKING(for SSE3 instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("sse3") #include ]], [[ __m128 x = _mm_addsub_ps(_mm_cvtpd_ps(_mm_setzero_pd()), @@ -428,7 +514,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mssse3], [CFLAGS="$CFLAGS -mssse3"]) AC_MSG_CHECKING(for SSSE3 instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("ssse3") #include ]], [[ __m64 x = _mm_abs_pi32(_m_from_int(0)); ]])], @@ -441,7 +527,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-msse4.1], [CFLAGS="$CFLAGS -msse4.1"]) AC_MSG_CHECKING(for SSE4.1 instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("sse4.1") #include ]], [[ __m128i x = _mm_minpos_epu16(_mm_setzero_si128()); ]])], @@ -454,7 +540,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mavx], [CFLAGS="$CFLAGS -mavx"]) AC_MSG_CHECKING(for AVX instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("avx") #include ]], [[ _mm256_zeroall(); ]])], @@ -467,7 +553,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [ oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS="$CFLAGS -mavx2"]) AC_MSG_CHECKING(for AVX2 instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("avx2") #include ]], [[ @@ -479,7 +565,7 @@ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ)); AC_DEFINE([HAVE_AVX2INTRIN_H], [1], [AVX2 is available]) AX_CHECK_COMPILE_FLAG([-mavx2], [CFLAGS_AVX2="-mavx2"]) AC_MSG_CHECKING(if _mm256_broadcastsi128_si256 is correctly defined) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("avx2") #include ]], [[ __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128()); ]])], @@ -494,7 +580,7 @@ return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ)); oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mavx512f], [CFLAGS="$CFLAGS -mavx512f"]) AC_MSG_CHECKING(for AVX512F instructions set) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("avx512f") #include ]], [[ @@ -527,7 +613,7 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7), AX_CHECK_COMPILE_FLAG([-maes], [CFLAGS="$CFLAGS -maes"]) AX_CHECK_COMPILE_FLAG([-mpclmul], [CFLAGS="$CFLAGS -mpclmul"]) AC_MSG_CHECKING(for AESNI instructions set and PCLMULQDQ) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("aes") #pragma GCC target("pclmul") #include @@ -544,7 +630,7 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7), oldcflags="$CFLAGS" AX_CHECK_COMPILE_FLAG([-mrdrnd], [CFLAGS="$CFLAGS -mrdrnd"]) AC_MSG_CHECKING(for RDRAND) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("rdrnd") #include ]], [[ unsigned long long x; _rdrand64_step(&x); ]])], @@ -557,6 +643,7 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7), ]) +AC_SUBST(CFLAGS_ARMCRYPTO) AC_SUBST(CFLAGS_MMX) AC_SUBST(CFLAGS_SSE2) AC_SUBST(CFLAGS_SSE3) @@ -569,7 +656,9 @@ AC_SUBST(CFLAGS_AESNI) AC_SUBST(CFLAGS_PCLMUL) AC_SUBST(CFLAGS_RDRAND) -AC_CHECK_HEADERS([sys/mman.h sys/random.h intrin.h]) +AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/random.h intrin.h sys/auxv.h]) +AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h]) +AC_CHECK_HEADERS([cet.h]) AC_MSG_CHECKING([if _xgetbv() is available]) AC_LINK_IFELSE( @@ -593,7 +682,7 @@ AC_C_BIGENDIAN( ) AC_MSG_CHECKING(whether __STDC_LIMIT_MACROS is required) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ @@ -777,23 +866,6 @@ void f(void *x) { __dummy(x); } AC_DEFINE([HAVE_WEAK_SYMBOLS], [1], [weak symbols are supported])], [AC_MSG_RESULT(no)]) -AC_MSG_CHECKING(if data alignment is required) -aligned_access_required=yes -AS_CASE([$host_cpu], - [i?86|amd64|x86_64|powerpc*|s390*], - [aligned_access_required=no], - [arm*], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#ifndef __ARM_FEATURE_UNALIGNED -# error data alignment is required -#endif - ]], [[]])], [aligned_access_required=no], [])] -) -AS_IF([test "x$aligned_access_required" = "xyes"], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - AC_DEFINE([CPU_UNALIGNED_ACCESS], [1], [unaligned memory access is supported])]) - AC_MSG_CHECKING(if atomic operations are supported) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ static volatile int _sodium_lock; @@ -805,6 +877,26 @@ __sync_lock_release(&_sodium_lock); AC_DEFINE([HAVE_ATOMIC_OPS], [1], [atomic operations are supported])], [AC_MSG_RESULT(no)]) +AC_MSG_CHECKING(if C11 memory fences are supported) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include + ]], [[ +atomic_thread_fence(memory_order_acquire); +]] +)], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_C11_MEMORY_FENCES], [1], [C11 memory fences are supported])], +[AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING(if gcc memory fences are supported) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ +__atomic_thread_fence(__ATOMIC_ACQUIRE); +]] +)], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_GCC_MEMORY_FENCES], [1], [GCC memory fences are supported])], +[AC_MSG_RESULT(no)]) + dnl Checks for functions and headers AC_FUNC_ALLOCA @@ -812,8 +904,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_CHECK_FUNCS([arc4random arc4random_buf]) AS_IF([test "x$WASI" = "x"],[ AC_CHECK_FUNCS([mmap mlock madvise mprotect]) + AC_CHECK_FUNCS([raise]) + AC_CHECK_FUNCS([sysconf]) ]) - AC_MSG_CHECKING(for getrandom with a standard API) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include @@ -823,12 +916,11 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ #ifdef HAVE_SYS_RANDOM_H # include #endif -#ifdef __SANITIZE_ADDRESS__ -# error A recent libasan version on an old system may intercept nonexistent functions -#endif ]], [[ unsigned char buf; -(void) getrandom((void *) &buf, 1U, 0U); +if (&getrandom != NULL) { + (void) getrandom((void *) &buf, 1U, 0U); +} ]])], [AC_MSG_RESULT(yes) AC_CHECK_FUNCS([getrandom])], @@ -844,12 +936,8 @@ unsigned char buf; #ifdef HAVE_SYS_RANDOM_H # include #endif -#ifdef __SANITIZE_ADDRESS__ -# error A recent libasan version on an old system may intercept nonexistent functions -#endif ]], [[ unsigned char buf; - if (&getentropy != NULL) { (void) getentropy((void *) &buf, 1U); } @@ -862,13 +950,13 @@ if (&getentropy != NULL) { AS_IF([test "x$WASI" = "x"],[ AC_CHECK_FUNCS([getpid]) - AC_CHECK_FUNCS([getauxva elf_aux_info]) + AC_CHECK_FUNCS([getauxval elf_aux_info]) ]) -AC_CHECK_FUNCS([posix_memalign nanosleep]) +AC_CHECK_FUNCS([posix_memalign nanosleep clock_gettime]) AS_IF([test "x$WASI" = "x"],[ - AC_CHECK_FUNCS([memset_s explicit_bzero explicit_memset]) + AC_CHECK_FUNCS([memset_s explicit_bzero memset_explicit explicit_memset]) ]) AC_SUBST([LIBTOOL_EXTRA_FLAGS]) @@ -876,7 +964,7 @@ AC_SUBST([LIBTOOL_EXTRA_FLAGS]) TEST_LDFLAGS='' AS_IF([test "x$EMSCRIPTEN" != "x"],[ EXEEXT=.js - TEST_LDFLAGS='--memory-init-file 0 --pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' + TEST_LDFLAGS='--pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' ]) AC_SUBST(TEST_LDFLAGS) AM_CONDITIONAL([EMSCRIPTEN], [test "x$EMSCRIPTEN" != "x"]) @@ -906,7 +994,6 @@ AC_CONFIG_FILES([Makefile dist-build/Makefile libsodium.pc libsodium-uninstalled.pc - msvc-scripts/Makefile src/Makefile src/libsodium/Makefile src/libsodium/include/Makefile diff --git a/src/libsodium/contrib/Findsodium.cmake b/src/libsodium/contrib/Findsodium.cmake index 076ff3700..316c5e94a 100644 --- a/src/libsodium/contrib/Findsodium.cmake +++ b/src/libsodium/contrib/Findsodium.cmake @@ -231,6 +231,10 @@ find_package_handle_standard_args(sodium VERSION_VAR sodium_VERSION_STRING) +if (NOT sodium_FOUND) + return() +endif() + # mark file paths as advanced mark_as_advanced(sodium_INCLUDE_DIR) mark_as_advanced(sodium_LIBRARY_DEBUG) diff --git a/src/libsodium/contrib/Makefile.in b/src/libsodium/contrib/Makefile.in index 5e34e97fb..fa2ebdfab 100644 --- a/src/libsodium/contrib/Makefile.in +++ b/src/libsodium/contrib/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -146,6 +146,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -158,6 +159,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -174,8 +177,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -341,7 +346,6 @@ ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/depcomp b/src/libsodium/depcomp deleted file mode 100755 index 4ebd5b3a2..000000000 --- a/src/libsodium/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/libsodium/dist-build/Makefile.am b/src/libsodium/dist-build/Makefile.am index fe7961d32..7bea4fbb9 100644 --- a/src/libsodium/dist-build/Makefile.am +++ b/src/libsodium/dist-build/Makefile.am @@ -1,17 +1,14 @@ EXTRA_DIST = \ android-build.sh \ - android-arm.sh \ + android-aar.sh \ android-armv7-a.sh \ android-armv8-a.sh \ - android-mips32.sh \ - android-mips64.sh \ android-x86.sh \ android-x86_64.sh \ emscripten.sh \ - ios.sh \ apple-xcframework.sh \ + macos.sh \ msys2-win32.sh \ msys2-win64.sh \ - watchos.sh \ wasm32-wasi.sh diff --git a/src/libsodium/dist-build/Makefile.in b/src/libsodium/dist-build/Makefile.in index c0b1fe095..3e8e695f7 100644 --- a/src/libsodium/dist-build/Makefile.in +++ b/src/libsodium/dist-build/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -146,6 +146,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -158,6 +159,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -174,8 +177,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -296,19 +301,16 @@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ EXTRA_DIST = \ android-build.sh \ - android-arm.sh \ + android-aar.sh \ android-armv7-a.sh \ android-armv8-a.sh \ - android-mips32.sh \ - android-mips64.sh \ android-x86.sh \ android-x86_64.sh \ emscripten.sh \ - ios.sh \ apple-xcframework.sh \ + macos.sh \ msys2-win32.sh \ msys2-win64.sh \ - watchos.sh \ wasm32-wasi.sh all: all-am @@ -355,7 +357,6 @@ ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/dist-build/android-aar.sh b/src/libsodium/dist-build/android-aar.sh new file mode 100755 index 000000000..49f145989 --- /dev/null +++ b/src/libsodium/dist-build/android-aar.sh @@ -0,0 +1,144 @@ +#! /bin/sh + +# Create an AAR with libsodium in all combinations of static | shared | minimal | full. +# +# The x86 static library will not work due to text relocation rules, so static x86 versions are limited to shared libraries. +# To simplify linking, library variants have distinct names: sodium, sodium-static, sodium-minimal and sodium-minimal-static. + +SODIUM_VERSION="1.0.20.0" +NDK_VERSION=$(grep "Pkg.Revision = " <"${ANDROID_NDK_HOME}/source.properties" | cut -f 2 -d '=' | cut -f 2 -d' ' | cut -f 1 -d'.') +DEST_PATH=$(mktemp -d) + +cd "$(dirname "$0")/../" || exit + +make_abi_json() { + echo "{\"abi\":\"${NDK_ARCH}\",\"api\":${SDK_VERSION},\"ndk\":${NDK_VERSION},\"stl\":\"none\"}" >"$1/abi.json" +} + +make_prefab_json() { + echo "{\"name\":\"sodium\",\"schema_version\":1,\"dependencies\":[],\"version\":\"$SODIUM_VERSION\"}" >"$1/prefab.json" +} + +make_manifest() { + echo " + +" >"${1}/AndroidManifest.xml" +} + +make_prefab_structure() { + mkdir "$DEST_PATH" + + for variant_dirs in "prefab" "prefab/modules" "META-INF"; do + mkdir "${DEST_PATH}/${variant_dirs}" + done + + make_prefab_json "${DEST_PATH}/prefab" + make_manifest "${DEST_PATH}" + cp "LICENSE" "${DEST_PATH}/META-INF" + + for variant in \ + "prefab/modules/sodium" "prefab/modules/sodium-static" \ + "prefab/modules/sodium-minimal" "prefab/modules/sodium-minimal-static"; do + mkdir "${DEST_PATH}/${variant}" + + if [ "$variant" = "prefab/modules/sodium-minimal" ]; then + echo "{\"library_name\":\"libsodium\"}" >"${DEST_PATH}/${variant}/module.json" + else + echo "{}" >"${DEST_PATH}/${variant}/module.json" + fi + + mkdir "${DEST_PATH}/${variant}/libs" + + for arch in "arm64-v8a" "armeabi-v7a" "x86" "x86_64"; do + mkdir "$DEST_PATH/${variant}/libs/android.${arch}" + mkdir "$DEST_PATH/${variant}/libs/android.${arch}/include" + NDK_ARCH="$arch" + if [ $arch = "arm64-v8a" ] || [ $arch = "x86_64" ]; then + SDK_VERSION="21" + else + SDK_VERSION="19" + fi + + make_abi_json "$DEST_PATH/${variant}/libs/android.${arch}" + done + done +} + +copy_libs() { + SRC_DIR="libsodium-android-${1}" + + SHARED_DEST_DIR="${DEST_PATH}/prefab/modules/sodium${3}/libs/android.${2}" + STATIC_DEST_DIR="${DEST_PATH}/prefab/modules/sodium${3}-static/libs/android.${2}" + + cp -r "${SRC_DIR}/include" "$SHARED_DEST_DIR" + cp -r "${SRC_DIR}/include" "$STATIC_DEST_DIR" + cp "${SRC_DIR}/lib/libsodium.so" "${SHARED_DEST_DIR}/libsodium.so" + cp "${SRC_DIR}/lib/libsodium.a" "${STATIC_DEST_DIR}/libsodium${3}-static.a" + + rm -r "$SRC_DIR" +} + +build_all() { + dist-build/android-armv7-a.sh + dist-build/android-armv8-a.sh + dist-build/android-x86_64.sh + dist-build/android-x86.sh +} + +make_prefab_structure + +build_all + +copy_libs "armv7-a" "armeabi-v7a" "-minimal" +copy_libs "armv8-a+crypto" "arm64-v8a" "-minimal" +copy_libs "i686" "x86" "-minimal" +copy_libs "westmere" "x86_64" "-minimal" + +LIBSODIUM_FULL_BUILD="Y" +export LIBSODIUM_FULL_BUILD + +build_all + +copy_libs "armv7-a" "armeabi-v7a" +copy_libs "armv8-a+crypto" "arm64-v8a" +copy_libs "i686" "x86" +copy_libs "westmere" "x86_64" + +AAR_PATH="$(pwd)/libsodium-${SODIUM_VERSION}.aar" +cd "$DEST_PATH" || exit +rm "$AAR_PATH" +zip -9 -r "$AAR_PATH" META-INF prefab AndroidManifest.xml +cd .. || exit +rm -r "$DEST_PATH" + +echo +echo "Congrats you have built an AAR containing libsodium! To use it with +gradle or cmake (as set by default for Android Studio projects): + +- Edit the app/build.gradle file to add: + + android { + buildFeatures { + prefab true + } + } + + and + + dependencies { + implementation fileTree(dir:'path/to/aar/',include:['libsodium-$SODIUM_VERSION.aar']) + } + + Optionally, store multiple AAR files in the same folder and include '*.aar' + +- Edit your module's CMakeLists.txt file to add: + + find_package(sodium REQUIRED CONFIG) + +- Then, specify 'sodium::x' as an item in the relevant 'target_link_libraries' statement. + The first part is the AAR name and should be 'sodium'. + The second part ('x', to be replaced) should be set to: + - 'sodium' for the full shared library, + - 'sodium-static' for the full static library + - 'sodium-minimal' for the minimal shared library, or + - 'sodium-minimal-static' for the minimal static library." diff --git a/src/libsodium/dist-build/android-arm.sh b/src/libsodium/dist-build/android-arm.sh deleted file mode 100755 index eb97828c6..000000000 --- a/src/libsodium/dist-build/android-arm.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -export TARGET_ARCH=armv6 -export CFLAGS="-Os -mthumb -marm -march=${TARGET_ARCH}" -ARCH=arm HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh" diff --git a/src/libsodium/dist-build/android-armv7-a.sh b/src/libsodium/dist-build/android-armv7-a.sh index a87250820..6cfa80ae9 100755 --- a/src/libsodium/dist-build/android-armv7-a.sh +++ b/src/libsodium/dist-build/android-armv7-a.sh @@ -1,4 +1,4 @@ #!/bin/sh export TARGET_ARCH=armv7-a export CFLAGS="-Os -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -march=${TARGET_ARCH}" -ARCH=arm HOST_COMPILER=arm-linux-androideabi "$(dirname "$0")/android-build.sh" +ARCH=arm HOST_COMPILER=armv7a-linux-androideabi "$(dirname "$0")/android-build.sh" diff --git a/src/libsodium/dist-build/android-armv8-a.sh b/src/libsodium/dist-build/android-armv8-a.sh index 1bf13ae87..16299828d 100755 --- a/src/libsodium/dist-build/android-armv8-a.sh +++ b/src/libsodium/dist-build/android-armv8-a.sh @@ -1,4 +1,4 @@ #!/bin/sh -export TARGET_ARCH=armv8-a +export TARGET_ARCH=armv8-a+crypto export CFLAGS="-Os -march=${TARGET_ARCH}" NDK_PLATFORM=android-21 ARCH=arm64 HOST_COMPILER=aarch64-linux-android "$(dirname "$0")/android-build.sh" diff --git a/src/libsodium/dist-build/android-build.sh b/src/libsodium/dist-build/android-build.sh index ece1d01d2..2937370f0 100755 --- a/src/libsodium/dist-build/android-build.sh +++ b/src/libsodium/dist-build/android-build.sh @@ -1,11 +1,11 @@ #! /bin/sh if [ -z "$NDK_PLATFORM" ]; then - export NDK_PLATFORM="android-16" + export NDK_PLATFORM="android-19" fi export NDK_PLATFORM_COMPAT="${NDK_PLATFORM_COMPAT:-${NDK_PLATFORM}}" -export NDK_API_VERSION=$(echo "$NDK_PLATFORM" | sed 's/^android-//') -export NDK_API_VERSION_COMPAT=$(echo "$NDK_PLATFORM_COMPAT" | sed 's/^android-//') +export NDK_API_VERSION="$(echo "$NDK_PLATFORM" | sed 's/^android-//')" +export NDK_API_VERSION_COMPAT="$(echo "$NDK_PLATFORM_COMPAT" | sed 's/^android-//')" if [ -z "$ANDROID_NDK_HOME" ]; then echo "You should probably set ANDROID_NDK_HOME to the directory containing" @@ -18,20 +18,19 @@ if [ ! -f ./configure ]; then exit 1 fi -if [ "x$TARGET_ARCH" = 'x' ] || [ "x$ARCH" = 'x' ] || [ "x$HOST_COMPILER" = 'x' ]; then +if [ -z "$TARGET_ARCH" ] || [ -z "$ARCH" ] || [ -z "$HOST_COMPILER" ]; then echo "You shouldn't use android-build.sh directly, use android-[arch].sh instead" >&2 exit 1 fi -export MAKE_TOOLCHAIN="${ANDROID_NDK_HOME}/build/tools/make_standalone_toolchain.py" - export PREFIX="$(pwd)/libsodium-android-${TARGET_ARCH}" -export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}" -export PATH="${PATH}:${TOOLCHAIN_DIR}/bin" +export TOOLCHAIN_OS_DIR="$(uname | tr '[:upper:]' '[:lower:]')-x86_64/" +export TOOLCHAIN_DIR="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/${TOOLCHAIN_OS_DIR}" +echo "$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/${TOOLCHAIN_OS_DIR}/${HOST_COMPILER}" -export CC=${CC:-"${HOST_COMPILER}-clang"} - -rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}" +export PATH="${PATH}:${TOOLCHAIN_DIR}/bin" +SDK_VERSION_NUM=$(echo $NDK_PLATFORM | cut -d'-' -f2) +export CC=${CC:-"${HOST_COMPILER}${SDK_VERSION_NUM}-clang"} echo echo "Warnings related to headers being present but not usable are due to functions" @@ -47,9 +46,6 @@ else fi echo -env - PATH="$PATH" \ - "$MAKE_TOOLCHAIN" --force --api="$NDK_API_VERSION_COMPAT" \ - --arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1 if [ -z "$LIBSODIUM_FULL_BUILD" ]; then export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" @@ -58,29 +54,28 @@ else fi ./configure \ - --disable-soname-versions \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --host="${HOST_COMPILER}" \ - --prefix="${PREFIX}" \ - --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1 + --disable-soname-versions \ + --disable-pie \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ + --host="${HOST_COMPILER}" \ + --prefix="${PREFIX}" \ + --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1 if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then - egrep '^#define ' config.log | sort -u > config-def-compat.log + grep -E '^#define ' config.log | sort -u >config-def-compat.log echo echo "Configuring again for platform [${NDK_PLATFORM}]" echo - env - PATH="$PATH" \ - "$MAKE_TOOLCHAIN" --force --api="$NDK_API_VERSION" \ - --arch="$ARCH" --install-dir="$TOOLCHAIN_DIR" || exit 1 ./configure \ - --disable-soname-versions \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --host="${HOST_COMPILER}" \ - --prefix="${PREFIX}" \ - --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1 + --disable-soname-versions \ + --disable-pie \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ + --host="${HOST_COMPILER}" \ + --prefix="${PREFIX}" \ + --with-sysroot="${TOOLCHAIN_DIR}/sysroot" || exit 1 - egrep '^#define ' config.log | sort -u > config-def.log + grep -E '^#define ' config.log | sort -u >config-def.log if ! cmp config-def.log config-def-compat.log; then echo "Platform [${NDK_PLATFORM}] is not backwards-compatible with [${NDK_PLATFORM_COMPAT}]" >&2 diff -u config-def.log config-def-compat.log >&2 @@ -89,10 +84,9 @@ if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then rm -f config-def.log config-def-compat.log fi - NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) PROCESSORS=${NPROCESSORS:-3} -make clean && \ -make -j${PROCESSORS} install && \ -echo "libsodium has been installed into ${PREFIX}" +make clean && + make -j${PROCESSORS} install && + echo "libsodium has been installed into ${PREFIX}" diff --git a/src/libsodium/dist-build/android-mips32.sh b/src/libsodium/dist-build/android-mips32.sh deleted file mode 100755 index ab5f6314e..000000000 --- a/src/libsodium/dist-build/android-mips32.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -export TARGET_ARCH=mips32 -export CFLAGS="-Os" -ARCH=mips HOST_COMPILER=mipsel-linux-android "$(dirname "$0")/android-build.sh" diff --git a/src/libsodium/dist-build/android-mips64.sh b/src/libsodium/dist-build/android-mips64.sh deleted file mode 100755 index 75dd6eaad..000000000 --- a/src/libsodium/dist-build/android-mips64.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -export TARGET_ARCH=mips64r6 -export CFLAGS="-Os -march=${TARGET_ARCH}" -CC="mips64el-linux-android-gcc" NDK_PLATFORM=android-21 ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh" diff --git a/src/libsodium/dist-build/apple-xcframework.sh b/src/libsodium/dist-build/apple-xcframework.sh index cf86e0886..3abc4d0a6 100755 --- a/src/libsodium/dist-build/apple-xcframework.sh +++ b/src/libsodium/dist-build/apple-xcframework.sh @@ -11,30 +11,39 @@ export IOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/ios-simulator-i386" export IOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/ios-simulator-x86_64" export WATCHOS32_PREFIX="${PREFIX}/tmp/watchos32" export WATCHOS64_32_PREFIX="${PREFIX}/tmp/watchos64_32" +export WATCHOS64_PREFIX="${PREFIX}/tmp/watchos64" export WATCHOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/watchos-simulator-arm64" export WATCHOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/watchos-simulator-i386" export WATCHOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/watchos-simulator-x86_64" -export TVOS64_PREFIX="${PREFIX}/tmp/tvos64" +export TVOS_PREFIX="${PREFIX}/tmp/tvos" export TVOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/tvos-simulator-arm64" export TVOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/tvos-simulator-x86_64" +export VISIONOS_PREFIX="${PREFIX}/tmp/visionos" +export VISIONOS_SIMULATOR_PREFIX="${PREFIX}/tmp/visionos-simulator" export CATALYST_ARM64_PREFIX="${PREFIX}/tmp/catalyst-arm64" export CATALYST_X86_64_PREFIX="${PREFIX}/tmp/catalyst-x86_64" export LOG_FILE="${PREFIX}/tmp/build_log" export XCODEDIR="$(xcode-select -p)" export MACOS_VERSION_MIN=${MACOS_VERSION_MIN-"10.10"} -export IOS_SIMULATOR_VERSION_MIN=${IOS_SIMULATOR_VERSION_MIN-"9.0.0"} export IOS_VERSION_MIN=${IOS_VERSION_MIN-"9.0.0"} -export WATCHOS_SIMULATOR_VERSION_MIN=${WATCHOS_SIMULATOR_VERSION_MIN-"4.0.0"} +export IOS_SIMULATOR_VERSION_MIN=${IOS_SIMULATOR_VERSION_MIN-$IOS_VERSION_MIN} export WATCHOS_VERSION_MIN=${WATCHOS_VERSION_MIN-"4.0.0"} -export TVOS_SIMULATOR_VERSION_MIN=${TVOS_SIMULATOR_VERSION_MIN-"9.0.0"} +export WATCHOS_SIMULATOR_VERSION_MIN=${WATCHOS_SIMULATOR_VERSION_MIN-$WATCHOS_VERSION_MIN} export TVOS_VERSION_MIN=${TVOS_VERSION_MIN-"9.0.0"} +export TVOS_SIMULATOR_VERSION_MIN=${TVOS_SIMULATOR_VERSION_MIN-$TVOS_VERSION_MIN} 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 +echo "Define the LIBSODIUM_FULL_BUILD environment variable to build the full" +echo "library (including all deprecated/undocumented/low-level functions)." +echo +echo "Define the LIBSODIUM_SKIP_SIMULATORS environment variable to skip building" +echo "the simulators libraries (iOS, watchOS, tvOS, visionOS simulators)." +echo if [ -z "$LIBSODIUM_FULL_BUILD" ]; then export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" @@ -42,9 +51,14 @@ else export LIBSODIUM_ENABLE_MINIMAL_FLAG="" fi -APPLE_SILICON_SUPPORTED=false -echo 'int main(void){return 0;}' >comptest.c && cc --target=arm64-macos comptest.c 2>/dev/null && APPLE_SILICON_SUPPORTED=true -rm -f comptest.c +IOS32_SUPPORTED=false +[ "$(echo "$IOS_VERSION_MIN" | cut -d'.' -f1)" -lt "11" ] && IOS32_SUPPORTED=true + +I386_SIMULATOR_SUPPORTED=false +[ "$(echo "$IOS_SIMULATOR_VERSION_MIN" | cut -d'.' -f1)" -lt "11" ] && I386_SIMULATOR_SUPPORTED=true + +VISIONOS_SUPPORTED=false +[ -d "${XCODEDIR}/Platforms/XROS.platform" ] && VISIONOS_SUPPORTED=true NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) PROCESSORS=${NPROCESSORS:-3} @@ -61,22 +75,20 @@ build_macos() { export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" ## macOS arm64 - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-O2 -arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" - export LDFLAGS="-arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export LDFLAGS="-arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin20 --prefix="$MACOS_ARM64_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 - fi + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$MACOS_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 ## macOS x86_64 - export CFLAGS="-O2 -arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" export LDFLAGS="-arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=x86_64-apple-darwin10 --prefix="$MACOS_X86_64_PREFIX" \ + ./configure --host=x86_64-apple-darwin23 --prefix="$MACOS_X86_64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 } @@ -86,30 +98,32 @@ build_ios() { export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" export SDK="${BASEDIR}/SDKs/iPhoneOS.sdk" - ## 32-bit iOS - export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + if [ "$IOS32_SUPPORTED" = true ]; then + ## 32-bit iOS + export CFLAGS="-O3 -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$IOS32_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin23 --prefix="$IOS32_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 - ## 32-bit armv7s iOS - export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + ## 32-bit armv7s iOS + export CFLAGS="-O3 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$IOS32s_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin23 --prefix="$IOS32s_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi ## 64-bit iOS - export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$IOS64_PREFIX" \ + ./configure --host=aarch64-apple-darwin23 --prefix="$IOS64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 } @@ -120,31 +134,31 @@ build_ios_simulator() { export SDK="${BASEDIR}/SDKs/iPhoneSimulator.sdk" ## arm64 simulator - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$IOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + if [ "$I386_SIMULATOR_SUPPORTED" = true ]; then + ## i386 simulator + export CFLAGS="-O3 -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin20 --prefix="$IOS_SIMULATOR_ARM64_PREFIX" \ + ./configure --host=i686-apple-darwin23 --prefix="$IOS_SIMULATOR_I386_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 fi - ## i386 simulator - export CFLAGS="-fembed-bitcode -O2 -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - - make distclean >/dev/null 2>&1 - ./configure --host=i686-apple-darwin10 --prefix="$IOS_SIMULATOR_I386_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 - ## x86_64 simulator - export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=x86_64-apple-darwin10 --prefix="$IOS_SIMULATOR_X86_64_PREFIX" \ + ./configure --host=x86_64-apple-darwin23 --prefix="$IOS_SIMULATOR_X86_64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} make -j${PROCESSORS} install || exit 1 } @@ -155,20 +169,29 @@ build_watchos() { export SDK="${BASEDIR}/SDKs/WatchOS.sdk" # 32-bit watchOS - export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export LDFLAGS="-mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$WATCHOS32_PREFIX" \ + ./configure --host=arm-apple-darwin23 --prefix="$WATCHOS32_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 ## 64-bit arm64_32 watchOS - export CFLAGS="-fembed-bitcode -O2 -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export CFLAGS="-O3 -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export LDFLAGS="-mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$WATCHOS64_32_PREFIX" \ + ./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_32_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## 64-bit arm64 watchOS + export CFLAGS="-O3 -mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export LDFLAGS="-mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 } @@ -179,31 +202,29 @@ build_watchos_simulator() { export SDK="${BASEDIR}/SDKs/WatchSimulator.sdk" ## arm64 simulator - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin20 --prefix="$WATCHOS_SIMULATOR_ARM64_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 - fi + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 ## i386 simulator - export CFLAGS="-fembed-bitcode -O2 -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=i686-apple-darwin10 --prefix="$WATCHOS_SIMULATOR_I386_PREFIX" \ + ./configure --host=i686-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_I386_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 ## x86_64 simulator - export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=x86_64-apple-darwin10 --prefix="$WATCHOS_SIMULATOR_X86_64_PREFIX" \ + ./configure --host=x86_64-apple-darwin23 --prefix="$WATCHOS_SIMULATOR_X86_64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 } @@ -214,11 +235,11 @@ build_tvos() { export SDK="${BASEDIR}/SDKs/AppleTVOS.sdk" ## 64-bit tvOS - export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" + export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin10 --prefix="$TVOS64_PREFIX" \ + ./configure --host=aarch64-apple-darwin23 --prefix="$TVOS_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 make -j${PROCESSORS} install || exit 1 } @@ -229,45 +250,69 @@ build_tvos_simulator() { export SDK="${BASEDIR}/SDKs/AppleTVSimulator.sdk" ## arm64 simulator - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-darwin20 --prefix="$TVOS_SIMULATOR_ARM64_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 - fi + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$TVOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 ## x86_64 simulator - export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" - export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export CFLAGS="-O3 -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" make distclean >/dev/null 2>&1 - ./configure --host=x86_64-apple-darwin10 --prefix="$TVOS_SIMULATOR_X86_64_PREFIX" \ + ./configure --host=x86_64-apple-darwin23 --prefix="$TVOS_SIMULATOR_X86_64_PREFIX" \ ${LIBSODIUM_ENABLE_MINIMAL_FLAG} make -j${PROCESSORS} install || exit 1 } +build_visionos() { + export BASEDIR="${XCODEDIR}/Platforms/XROS.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/XROS.sdk" + + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK}" + export LDFLAGS="-arch arm64 -isysroot ${SDK}" + + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOS_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_visionos_simulator() { + export BASEDIR="${XCODEDIR}/Platforms/XRSimulator.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/XRSimulator.sdk" + + export CFLAGS="-O3 -arch arm64 -isysroot ${SDK}" + export LDFLAGS="-arch arm64 -isysroot ${SDK}" + + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-darwin23 --prefix="$VISIONOS_SIMULATOR_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + build_catalyst() { export BASEDIR="${XCODEDIR}/Platforms/MacOSX.platform/Developer" export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" export SDK="${BASEDIR}/SDKs/MacOSX.sdk" ## arm64 catalyst - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - export CFLAGS="-O2 -arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}" - export LDFLAGS="-arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}" + export CFLAGS="-O3 -arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}" + export LDFLAGS="-arch arm64 -target arm64-apple-ios13.1-macabi -isysroot ${SDK}" - make distclean >/dev/null 2>&1 - ./configure --host=arm-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 - make -j${PROCESSORS} install || exit 1 - fi + make distclean >/dev/null 2>&1 + ./configure --host=aarch64-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 ## x86_64 catalyst - export CFLAGS="-O2 -arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}" - export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}" + export CFLAGS="-O3 -arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}" + export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.1-macabi -isysroot ${SDK}" make distclean >/dev/null 2>&1 ./configure --host=x86_64-apple-ios --prefix="$CATALYST_X86_64_PREFIX" \ @@ -276,22 +321,36 @@ build_catalyst() { } mkdir -p "${PREFIX}/tmp" + echo "Building for macOS..." build_macos >"$LOG_FILE" 2>&1 || exit 1 echo "Building for iOS..." build_ios >"$LOG_FILE" 2>&1 || exit 1 -echo "Building for the iOS simulator..." -build_ios_simulator >"$LOG_FILE" 2>&1 || exit 1 echo "Building for watchOS..." build_watchos >"$LOG_FILE" 2>&1 || exit 1 -echo "Building for the watchOS simulator..." -build_watchos_simulator >"$LOG_FILE" 2>&1 || exit 1 echo "Building for tvOS..." build_tvos >"$LOG_FILE" 2>&1 || exit 1 -echo "Building for the tvOS simulator..." -build_tvos_simulator >"$LOG_FILE" 2>&1 || exit 1 echo "Building for Catalyst..." build_catalyst >"$LOG_FILE" 2>&1 || exit 1 +if [ "$VISIONOS_SUPPORTED" = true ]; then + echo "Building for visionOS..." + build_visionos >"$LOG_FILE" 2>&1 || exit 1 +fi + +if [ -z "$LIBSODIUM_SKIP_SIMULATORS" ]; then + echo "Building for the iOS simulator..." + build_ios_simulator >"$LOG_FILE" 2>&1 || exit 1 + echo "Building for the watchOS simulator..." + build_watchos_simulator >"$LOG_FILE" 2>&1 || exit 1 + echo "Building for the tvOS simulator..." + build_tvos_simulator >"$LOG_FILE" 2>&1 || exit 1 + if [ "$VISIONOS_SUPPORTED" = true ]; then + echo "Building for the visionOS simulator..." + build_visionos_simulator >"$LOG_FILE" 2>&1 || exit 1 + fi +else + echo "[Skipping the simulators]" +fi echo "Adding the Clibsodium module map for Swift..." @@ -304,16 +363,10 @@ echo "Bundling macOS targets..." mkdir -p "${PREFIX}/macos/lib" cp -a "${MACOS_X86_64_PREFIX}/include" "${PREFIX}/macos/" for ext in a dylib; do - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - lipo -create \ - "${MACOS_ARM64_PREFIX}/lib/libsodium.${ext}" \ - "${MACOS_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/macos/lib/libsodium.${ext}" - else - lipo -create \ - "${MACOS_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/macos/lib/libsodium.${ext}" - fi + lipo -create \ + "${MACOS_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${MACOS_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/macos/lib/libsodium.${ext}" done echo "Bundling iOS targets..." @@ -321,32 +374,16 @@ echo "Bundling iOS targets..." mkdir -p "${PREFIX}/ios/lib" cp -a "${IOS64_PREFIX}/include" "${PREFIX}/ios/" for ext in a dylib; do + LIBRARY_PATHS="$IOS64_PREFIX/lib/libsodium.${ext}" + if [ "$IOS32_SUPPORTED" = true ]; then + LIBRARY_PATHS="$LIBRARY_PATHS $IOS32_PREFIX/lib/libsodium.${ext}" + LIBRARY_PATHS="$LIBRARY_PATHS $IOS32s_PREFIX/lib/libsodium.${ext}" + fi lipo -create \ - "$IOS32_PREFIX/lib/libsodium.${ext}" \ - "$IOS32s_PREFIX/lib/libsodium.${ext}" \ - "$IOS64_PREFIX/lib/libsodium.${ext}" \ + ${LIBRARY_PATHS} \ -output "$PREFIX/ios/lib/libsodium.${ext}" done -echo "Bundling iOS simulators..." - -mkdir -p "${PREFIX}/ios-simulators/lib" -cp -a "${IOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/ios-simulators/" -for ext in a dylib; do - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - lipo -create \ - "${IOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ - "${IOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ - "${IOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/ios-simulators/lib/libsodium.${ext}" || exit 1 - else - lipo -create \ - "${IOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ - "${IOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/ios-simulators/lib/libsodium.${ext}" || exit 1 - fi -done - echo "Bundling watchOS targets..." mkdir -p "${PREFIX}/watchos/lib" @@ -355,54 +392,31 @@ for ext in a dylib; do lipo -create \ "${WATCHOS32_PREFIX}/lib/libsodium.${ext}" \ "${WATCHOS64_32_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS64_PREFIX}/lib/libsodium.${ext}" \ -output "${PREFIX}/watchos/lib/libsodium.${ext}" done -echo "Bundling watchOS simulators..." - -mkdir -p "${PREFIX}/watchos-simulators/lib" -cp -a "${WATCHOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/watchos-simulators/" -for ext in a dylib; do - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - lipo -create \ - "${WATCHOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ - "${WATCHOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ - "${WATCHOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/watchos-simulators/lib/libsodium.${ext}" - else - lipo -create \ - "${WATCHOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ - "${WATCHOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/watchos-simulators/lib/libsodium.${ext}" - fi -done - echo "Bundling tvOS targets..." mkdir -p "${PREFIX}/tvos/lib" -cp -a "${TVOS64_PREFIX}/include" "${PREFIX}/tvos/" +cp -a "${TVOS_PREFIX}/include" "${PREFIX}/tvos/" for ext in a dylib; do lipo -create \ - "$TVOS64_PREFIX/lib/libsodium.${ext}" \ + "$TVOS_PREFIX/lib/libsodium.${ext}" \ -output "$PREFIX/tvos/lib/libsodium.${ext}" done -echo "Bundling tvOS simulators..." +if [ "$VISIONOS_SUPPORTED" = true ]; then + echo "Bundling visionOS targets..." -mkdir -p "${PREFIX}/tvos-simulators/lib" -cp -a "${TVOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/tvos-simulators/" -for ext in a dylib; do - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then - lipo -create \ - "${TVOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ - "${TVOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/tvos-simulators/lib/libsodium.${ext}" || exit 1 - else + mkdir -p "${PREFIX}/visionos/lib" + cp -a "${VISIONOS_PREFIX}/include" "${PREFIX}/visionos/" + for ext in a dylib; do lipo -create \ - "${TVOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/tvos-simulators/lib/libsodium.${ext}" || exit 1 - fi -done + "$VISIONOS_PREFIX/lib/libsodium.${ext}" \ + -output "$PREFIX/visionos/lib/libsodium.${ext}" + done +fi echo "Bundling Catalyst targets..." @@ -412,27 +426,85 @@ for ext in a dylib; do if [ ! -f "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" ]; then continue fi - if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${CATALYST_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/catalyst/lib/libsodium.${ext}" +done + +if [ -z "$LIBSODIUM_SKIP_SIMULATORS" ]; then + echo "Bundling iOS simulators..." + + mkdir -p "${PREFIX}/ios-simulators/lib" + cp -a "${IOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/ios-simulators/" + for ext in a dylib; do + LIBRARY_PATHS="${IOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" + LIBRARY_PATHS="$LIBRARY_PATHS ${IOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" + if [ "$I386_SIMULATOR_SUPPORTED" = true ]; then + LIBRARY_PATHS="$LIBRARY_PATHS ${IOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" + fi lipo -create \ - "${CATALYST_ARM64_PREFIX}/lib/libsodium.${ext}" \ - "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/catalyst/lib/libsodium.${ext}" - else + ${LIBRARY_PATHS} \ + -output "${PREFIX}/ios-simulators/lib/libsodium.${ext}" || exit 1 + done + + echo "Bundling watchOS simulators..." + + mkdir -p "${PREFIX}/watchos-simulators/lib" + cp -a "${WATCHOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/watchos-simulators/" + for ext in a dylib; do + lipo -create \ + "${WATCHOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/watchos-simulators/lib/libsodium.${ext}" + done + + echo "Bundling tvOS simulators..." + + mkdir -p "${PREFIX}/tvos-simulators/lib" + cp -a "${TVOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/tvos-simulators/" + for ext in a dylib; do lipo -create \ - "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" \ - -output "${PREFIX}/catalyst/lib/libsodium.${ext}" + "${TVOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${TVOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/tvos-simulators/lib/libsodium.${ext}" || exit 1 + done + + if [ "$VISIONOS_SUPPORTED" = true ]; then + echo "Bundling visionOS simulators..." + + mkdir -p "${PREFIX}/visionos-simulators/lib" + cp -a "${VISIONOS_SIMULATOR_PREFIX}/include" "${PREFIX}/visionos-simulators/" + for ext in a dylib; do + lipo -create \ + "${VISIONOS_SIMULATOR_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/visionos-simulators/lib/libsodium.${ext}" || exit 1 + done fi -done +fi echo "Creating Clibsodium.xcframework..." rm -rf "${PREFIX}/Clibsodium.xcframework" XCFRAMEWORK_ARGS="" -for f in macos ios ios-simulators watchos watchos-simulators tvos tvos-simulators catalyst; do - XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -library ${PREFIX}/${f}/lib/libsodium.a" - XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -headers ${PREFIX}/${f}/include" +for f in macos ios watchos tvos visionos catalyst; do + if [ "$VISIONOS_SUPPORTED" = false ] && [ "$f" = "visionos" ]; then + continue + fi + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -library $(readlink -f ${PREFIX}/${f}/lib/libsodium.a)" + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -headers $(readlink -f ${PREFIX}/${f}/include)" done +if [ -z "$LIBSODIUM_SKIP_SIMULATORS" ]; then + for f in ios-simulators watchos-simulators tvos-simulators visionos-simulators; do + if [ "$VISIONOS_SUPPORTED" = false ] && [ "$f" = "visionos-simulators" ]; then + continue + fi + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -library $(readlink -f ${PREFIX}/${f}/lib/libsodium.a)" + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -headers $(readlink -f ${PREFIX}/${f}/include)" + done +fi xcodebuild -create-xcframework \ ${XCFRAMEWORK_ARGS} \ -output "${PREFIX}/Clibsodium.xcframework" >/dev/null diff --git a/src/libsodium/dist-build/emscripten-symbols.def b/src/libsodium/dist-build/emscripten-symbols.def index b1761c5d3..d92a2632f 100644 --- a/src/libsodium/dist-build/emscripten-symbols.def +++ b/src/libsodium/dist-build/emscripten-symbols.def @@ -1,3 +1,23 @@ +_crypto_aead_aegis128l_abytes 1 1 +_crypto_aead_aegis128l_decrypt 1 1 +_crypto_aead_aegis128l_decrypt_detached 1 1 +_crypto_aead_aegis128l_encrypt 1 1 +_crypto_aead_aegis128l_encrypt_detached 1 1 +_crypto_aead_aegis128l_keybytes 1 1 +_crypto_aead_aegis128l_keygen 1 1 +_crypto_aead_aegis128l_messagebytes_max 1 1 +_crypto_aead_aegis128l_npubbytes 1 1 +_crypto_aead_aegis128l_nsecbytes 1 1 +_crypto_aead_aegis256_abytes 1 1 +_crypto_aead_aegis256_decrypt 1 1 +_crypto_aead_aegis256_decrypt_detached 1 1 +_crypto_aead_aegis256_encrypt 1 1 +_crypto_aead_aegis256_encrypt_detached 1 1 +_crypto_aead_aegis256_keybytes 1 1 +_crypto_aead_aegis256_keygen 1 1 +_crypto_aead_aegis256_messagebytes_max 1 1 +_crypto_aead_aegis256_npubbytes 1 1 +_crypto_aead_aegis256_nsecbytes 1 1 _crypto_aead_aes256gcm_abytes 0 0 _crypto_aead_aes256gcm_beforenm 0 0 _crypto_aead_aes256gcm_decrypt 0 0 @@ -145,7 +165,7 @@ _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_hash 0 0 _crypto_core_ed25519_from_uniform 0 1 _crypto_core_ed25519_hashbytes 0 1 _crypto_core_ed25519_is_valid_point 0 1 @@ -154,6 +174,7 @@ _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_is_canonical 0 1 _crypto_core_ed25519_scalar_mul 0 1 _crypto_core_ed25519_scalar_negate 0 1 _crypto_core_ed25519_scalar_random 0 1 @@ -182,6 +203,7 @@ _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_is_canonical 0 1 _crypto_core_ristretto255_scalar_mul 0 1 _crypto_core_ristretto255_scalar_negate 0 1 _crypto_core_ristretto255_scalar_random 0 1 @@ -258,6 +280,26 @@ _crypto_kdf_bytes_max 1 1 _crypto_kdf_bytes_min 1 1 _crypto_kdf_contextbytes 1 1 _crypto_kdf_derive_from_key 1 1 +_crypto_kdf_hkdf_sha256_bytes_max 1 1 +_crypto_kdf_hkdf_sha256_bytes_min 1 1 +_crypto_kdf_hkdf_sha256_expand 1 1 +_crypto_kdf_hkdf_sha256_extract 1 1 +_crypto_kdf_hkdf_sha256_extract_final 1 1 +_crypto_kdf_hkdf_sha256_extract_init 1 1 +_crypto_kdf_hkdf_sha256_statebytes 1 1 +_crypto_kdf_hkdf_sha256_extract_update 1 1 +_crypto_kdf_hkdf_sha256_keybytes 1 1 +_crypto_kdf_hkdf_sha256_keygen 1 1 +_crypto_kdf_hkdf_sha512_bytes_max 1 1 +_crypto_kdf_hkdf_sha512_bytes_min 1 1 +_crypto_kdf_hkdf_sha512_expand 1 1 +_crypto_kdf_hkdf_sha512_extract 1 1 +_crypto_kdf_hkdf_sha512_extract_final 1 1 +_crypto_kdf_hkdf_sha512_extract_init 1 1 +_crypto_kdf_hkdf_sha512_statebytes 1 1 +_crypto_kdf_hkdf_sha512_extract_update 1 1 +_crypto_kdf_hkdf_sha512_keybytes 1 1 +_crypto_kdf_hkdf_sha512_keygen 1 1 _crypto_kdf_keybytes 1 1 _crypto_kdf_keygen 1 1 _crypto_kdf_primitive 0 1 @@ -289,10 +331,10 @@ _crypto_onetimeauth_primitive 0 1 _crypto_onetimeauth_statebytes 0 1 _crypto_onetimeauth_update 0 1 _crypto_onetimeauth_verify 0 1 -_crypto_pwhash 1 1 -_crypto_pwhash_alg_argon2i13 1 1 -_crypto_pwhash_alg_argon2id13 1 1 -_crypto_pwhash_alg_default 1 1 +_crypto_pwhash 0 1 +_crypto_pwhash_alg_argon2i13 0 1 +_crypto_pwhash_alg_argon2id13 0 1 +_crypto_pwhash_alg_default 0 1 _crypto_pwhash_argon2i 0 1 _crypto_pwhash_argon2i_alg_argon2i13 0 1 _crypto_pwhash_argon2i_bytes_max 0 1 @@ -337,22 +379,22 @@ _crypto_pwhash_argon2id_str_needs_rehash 0 1 _crypto_pwhash_argon2id_str_verify 0 1 _crypto_pwhash_argon2id_strbytes 0 1 _crypto_pwhash_argon2id_strprefix 0 1 -_crypto_pwhash_bytes_max 1 1 -_crypto_pwhash_bytes_min 1 1 -_crypto_pwhash_memlimit_interactive 1 1 -_crypto_pwhash_memlimit_max 1 1 -_crypto_pwhash_memlimit_min 1 1 -_crypto_pwhash_memlimit_moderate 1 1 -_crypto_pwhash_memlimit_sensitive 1 1 -_crypto_pwhash_opslimit_interactive 1 1 -_crypto_pwhash_opslimit_max 1 1 -_crypto_pwhash_opslimit_min 1 1 -_crypto_pwhash_opslimit_moderate 1 1 -_crypto_pwhash_opslimit_sensitive 1 1 -_crypto_pwhash_passwd_max 1 1 -_crypto_pwhash_passwd_min 1 1 +_crypto_pwhash_bytes_max 0 1 +_crypto_pwhash_bytes_min 0 1 +_crypto_pwhash_memlimit_interactive 0 1 +_crypto_pwhash_memlimit_max 0 1 +_crypto_pwhash_memlimit_min 0 1 +_crypto_pwhash_memlimit_moderate 0 1 +_crypto_pwhash_memlimit_sensitive 0 1 +_crypto_pwhash_opslimit_interactive 0 1 +_crypto_pwhash_opslimit_max 0 1 +_crypto_pwhash_opslimit_min 0 1 +_crypto_pwhash_opslimit_moderate 0 1 +_crypto_pwhash_opslimit_sensitive 0 1 +_crypto_pwhash_passwd_max 0 1 +_crypto_pwhash_passwd_min 0 1 _crypto_pwhash_primitive 0 1 -_crypto_pwhash_saltbytes 1 1 +_crypto_pwhash_saltbytes 0 1 _crypto_pwhash_scryptsalsa208sha256 0 1 _crypto_pwhash_scryptsalsa208sha256_bytes_max 0 1 _crypto_pwhash_scryptsalsa208sha256_bytes_min 0 1 @@ -373,12 +415,12 @@ _crypto_pwhash_scryptsalsa208sha256_str_needs_rehash 0 1 _crypto_pwhash_scryptsalsa208sha256_str_verify 0 1 _crypto_pwhash_scryptsalsa208sha256_strbytes 0 1 _crypto_pwhash_scryptsalsa208sha256_strprefix 0 1 -_crypto_pwhash_str 1 1 -_crypto_pwhash_str_alg 1 1 -_crypto_pwhash_str_needs_rehash 1 1 -_crypto_pwhash_str_verify 1 1 -_crypto_pwhash_strbytes 1 1 -_crypto_pwhash_strprefix 1 1 +_crypto_pwhash_str 0 1 +_crypto_pwhash_str_alg 0 1 +_crypto_pwhash_str_needs_rehash 0 1 +_crypto_pwhash_str_verify 0 1 +_crypto_pwhash_strbytes 0 1 +_crypto_pwhash_strprefix 0 1 _crypto_scalarmult 1 1 _crypto_scalarmult_base 1 1 _crypto_scalarmult_bytes 1 1 @@ -591,6 +633,7 @@ _sodium_mprotect_readwrite 0 0 _sodium_munlock 0 0 _sodium_pad 1 1 _sodium_runtime_has_aesni 0 0 +_sodium_runtime_has_armcrypto 0 0 _sodium_runtime_has_avx 0 0 _sodium_runtime_has_avx2 0 0 _sodium_runtime_has_avx512f 0 0 diff --git a/src/libsodium/dist-build/emscripten.sh b/src/libsodium/dist-build/emscripten.sh index 3f5d8ded2..8e930754e 100755 --- a/src/libsodium/dist-build/emscripten.sh +++ b/src/libsodium/dist-build/emscripten.sh @@ -1,12 +1,13 @@ #! /bin/sh 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_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_FUNCTIONS_STANDARD='["_malloc","_free","_crypto_aead_aegis128l_abytes","_crypto_aead_aegis128l_decrypt","_crypto_aead_aegis128l_decrypt_detached","_crypto_aead_aegis128l_encrypt","_crypto_aead_aegis128l_encrypt_detached","_crypto_aead_aegis128l_keybytes","_crypto_aead_aegis128l_keygen","_crypto_aead_aegis128l_messagebytes_max","_crypto_aead_aegis128l_npubbytes","_crypto_aead_aegis128l_nsecbytes","_crypto_aead_aegis256_abytes","_crypto_aead_aegis256_decrypt","_crypto_aead_aegis256_decrypt_detached","_crypto_aead_aegis256_encrypt","_crypto_aead_aegis256_encrypt_detached","_crypto_aead_aegis256_keybytes","_crypto_aead_aegis256_keygen","_crypto_aead_aegis256_messagebytes_max","_crypto_aead_aegis256_npubbytes","_crypto_aead_aegis256_nsecbytes","_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_hkdf_sha256_bytes_max","_crypto_kdf_hkdf_sha256_bytes_min","_crypto_kdf_hkdf_sha256_expand","_crypto_kdf_hkdf_sha256_extract","_crypto_kdf_hkdf_sha256_extract_final","_crypto_kdf_hkdf_sha256_extract_init","_crypto_kdf_hkdf_sha256_extract_update","_crypto_kdf_hkdf_sha256_keybytes","_crypto_kdf_hkdf_sha256_keygen","_crypto_kdf_hkdf_sha256_statebytes","_crypto_kdf_hkdf_sha512_bytes_max","_crypto_kdf_hkdf_sha512_bytes_min","_crypto_kdf_hkdf_sha512_expand","_crypto_kdf_hkdf_sha512_extract","_crypto_kdf_hkdf_sha512_extract_final","_crypto_kdf_hkdf_sha512_extract_init","_crypto_kdf_hkdf_sha512_extract_update","_crypto_kdf_hkdf_sha512_keybytes","_crypto_kdf_hkdf_sha512_keygen","_crypto_kdf_hkdf_sha512_statebytes","_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_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_aegis128l_abytes","_crypto_aead_aegis128l_decrypt","_crypto_aead_aegis128l_decrypt_detached","_crypto_aead_aegis128l_encrypt","_crypto_aead_aegis128l_encrypt_detached","_crypto_aead_aegis128l_keybytes","_crypto_aead_aegis128l_keygen","_crypto_aead_aegis128l_messagebytes_max","_crypto_aead_aegis128l_npubbytes","_crypto_aead_aegis128l_nsecbytes","_crypto_aead_aegis256_abytes","_crypto_aead_aegis256_decrypt","_crypto_aead_aegis256_decrypt_detached","_crypto_aead_aegis256_encrypt","_crypto_aead_aegis256_encrypt_detached","_crypto_aead_aegis256_keybytes","_crypto_aead_aegis256_keygen","_crypto_aead_aegis256_messagebytes_max","_crypto_aead_aegis256_npubbytes","_crypto_aead_aegis256_nsecbytes","_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_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_hkdf_sha256_bytes_max","_crypto_kdf_hkdf_sha256_bytes_min","_crypto_kdf_hkdf_sha256_expand","_crypto_kdf_hkdf_sha256_extract","_crypto_kdf_hkdf_sha256_extract_final","_crypto_kdf_hkdf_sha256_extract_init","_crypto_kdf_hkdf_sha256_extract_update","_crypto_kdf_hkdf_sha256_keybytes","_crypto_kdf_hkdf_sha256_keygen","_crypto_kdf_hkdf_sha256_statebytes","_crypto_kdf_hkdf_sha512_bytes_max","_crypto_kdf_hkdf_sha512_bytes_min","_crypto_kdf_hkdf_sha512_expand","_crypto_kdf_hkdf_sha512_extract","_crypto_kdf_hkdf_sha512_extract_final","_crypto_kdf_hkdf_sha512_extract_init","_crypto_kdf_hkdf_sha512_extract_update","_crypto_kdf_hkdf_sha512_keybytes","_crypto_kdf_hkdf_sha512_keygen","_crypto_kdf_hkdf_sha512_statebytes","_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 JS_RESERVED_MEMORY_STANDARD=16MB +export JS_RESERVED_MEMORY_SUMO=48MB +export JS_RESERVED_MEMORY_TESTS=16MB +export WASM_INITIAL_MEMORY=4MB export LDFLAGS="-s RESERVED_FUNCTION_POINTERS=8" export LDFLAGS="${LDFLAGS} -s ALLOW_MEMORY_GROWTH=1" export LDFLAGS="${LDFLAGS} -s SINGLE_FILE=1" @@ -16,38 +17,41 @@ export LDFLAGS="${LDFLAGS} -s DISABLE_EXCEPTION_CATCHING=1" export LDFLAGS="${LDFLAGS} -s ELIMINATE_DUPLICATE_FUNCTIONS=1" export LDFLAGS="${LDFLAGS} -s NODEJS_CATCH_EXIT=0" export LDFLAGS="${LDFLAGS} -s NODEJS_CATCH_REJECTION=0" -export CFLAGS="-Os" echo -if [ "x$1" = "x--standard" ]; then +if [ "$1" = "--standard" ]; then export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_STANDARD" - export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${MAX_MEMORY}" + export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST}" + export LDFLAGS_JS="-s TOTAL_MEMORY=${JS_RESERVED_MEMORY_STANDARD}" export PREFIX="$(pwd)/libsodium-js" export DONE_FILE="$(pwd)/js.done" export CONFIG_EXTRA="--enable-minimal" export DIST='yes' echo "Building a standard distribution in [${PREFIX}]" -elif [ "x$1" = "x--sumo" ]; then +elif [ "$1" = "--sumo" ]; then export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" - export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST} -s TOTAL_MEMORY=${MAX_MEMORY_SUMO}" + export LDFLAGS="${LDFLAGS} ${LDFLAGS_DIST}" + export LDFLAGS_JS="-s TOTAL_MEMORY=${JS_RESERVED_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 +elif [ "$1" = "--browser-tests" ]; then export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" export CPPFLAGS="${CPPFLAGS} -s FORCE_FILESYSTEM=1" - export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}" + export LDFLAGS="${LDFLAGS}" + export LDFLAGS_JS="-s TOTAL_MEMORY=${JS_RESERVED_MEMORY_TESTS}" export PREFIX="$(pwd)/libsodium-js-tests" export DONE_FILE="$(pwd)/js-tests-browser.done" export BROWSER_TESTS='yes' export DIST='no' echo "Building tests for web browsers in [${PREFIX}]" -elif [ "x$1" = "x--tests" ]; then +elif [ "$1" = "--tests" ]; then echo "Building for testing" export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" export CPPFLAGS="${CPPFLAGS} -s FORCE_FILESYSTEM=1 -DBENCHMARKS -DITERATIONS=10" - export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}" + export LDFLAGS="${LDFLAGS}" + export LDFLAGS_JS="-s TOTAL_MEMORY=${JS_RESERVED_MEMORY_TESTS}" export PREFIX="$(pwd)/libsodium-js-tests" export DONE_FILE="$(pwd)/js-tests.done" export DIST='no' @@ -58,31 +62,30 @@ else echo exit 1 fi -export JS_EXPORTS_FLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS} -s EXTRA_EXPORTED_RUNTIME_METHODS=${EXPORTED_RUNTIME_METHODS}" +export JS_EXPORTS_FLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS} -s EXPORTED_RUNTIME_METHODS=${EXPORTED_RUNTIME_METHODS}" rm -f "$DONE_FILE" echo emconfigure ./configure $CONFIG_EXTRA --disable-shared --prefix="$PREFIX" \ - --without-pthreads \ - --disable-ssp --disable-asm --disable-pie \ - CFLAGS="$CFLAGS" && \ -emmake make clean + --without-pthreads \ + --disable-ssp --disable-asm --disable-pie && + emmake make clean [ $? = 0 ] || exit 1 if [ "$DIST" = yes ]; then - emccLibsodium () { + emccLibsodium() { outFile="${1}" shift - emcc "$CFLAGS" --llvm-lto 1 $CPPFLAGS $LDFLAGS $JS_EXPORTS_FLAGS ${@} \ + emcc "$CFLAGS" --llvm-lto 1 $CPPFLAGS $LDFLAGS $JS_EXPORTS_FLAGS "${@}" \ "${PREFIX}/lib/libsodium.a" -o "${outFile}" || exit 1 } emmake make $MAKE_FLAGS install || exit 1 - emccLibsodium "${PREFIX}/lib/libsodium.asm.tmp.js" -Oz -s WASM=0 - emccLibsodium "${PREFIX}/lib/libsodium.wasm.tmp.js" -O3 -s WASM=1 + emccLibsodium "${PREFIX}/lib/libsodium.asm.tmp.js" -Oz -s WASM=0 $LDFLAGS_JS + emccLibsodium "${PREFIX}/lib/libsodium.wasm.tmp.js" -O3 -s WASM=1 -s EVAL_CTORS=1 -s INITIAL_MEMORY=${WASM_INITIAL_MEMORY} - cat > "${PREFIX}/lib/libsodium.js" <<- EOM + cat >"${PREFIX}/lib/libsodium.js" <<-EOM var Module; if (typeof Module === 'undefined') { Module = {}; @@ -95,9 +98,6 @@ if [ "$DIST" = yes ]; then root = window; } } - if (typeof root['sodium'] === 'object' && typeof root['sodium']['totalMemory'] === 'number') { - Module['TOTAL_MEMORY'] = root['sodium']['totalMemory']; - } var _Module = Module; Module.ready = new Promise(function(resolve, reject) { var Module = _Module; @@ -134,7 +134,7 @@ if [ "$DIST" = yes ]; then resolve(); }; - $(cat "${PREFIX}/lib/libsodium.asm.tmp.js" | sed 's|use asm||g') + $(sed "s|use asm||g" "${PREFIX}/lib/libsodium.asm.tmp.js") }); }; $(cat "${PREFIX}/lib/libsodium.wasm.tmp.js") @@ -149,54 +149,55 @@ EOM exit 0 fi -if test "x$NODE" = x; then - for candidate in /usr/local/bin/node /usr/local/bin/nodejs /usr/bin/node /usr/bin/nodejs node nodejs; do +if test "$NODE" = ""; then + for candidate in bun nodejs node /usr/local/bin/bun /usr/local/bin/nodejs /usr/local/bin/node; do case $($candidate --version 2>&1) in #( - v*) - NODE=$candidate - break ;; + v*) + NODE=$candidate + break + ;; esac done fi if [ "x$BROWSER_TESTS" != "x" ]; then - echo 'Compiling the test suite for web browsers...' && \ - emmake make $MAKE_FLAGS CPPFLAGS="$CPPFLAGS -DBROWSER_TESTS=1" check > /dev/null 2>&1 + echo 'Compiling the test suite for web browsers...' && + emmake make $MAKE_FLAGS CPPFLAGS="$CPPFLAGS -DBROWSER_TESTS=1" check >/dev/null 2>&1 else - if test "x$NODE" = x; then + if test "$NODE" = ""; then echo 'node.js not found - test suite skipped' >&2 exit 1 fi echo "Using [${NODE}] as a Javascript runtime" - echo 'Compiling the test suite...' && \ - emmake make $MAKE_FLAGS check > /dev/null 2>&1 + echo 'Compiling the test suite...' && + emmake make $MAKE_FLAGS check >/dev/null 2>&1 fi if [ "x$BROWSER_TESTS" != "x" ]; then echo 'Creating the test suite for web browsers' ( - cd test/default && \ - mkdir -p browser && \ - rm -f browser/tests.txt && \ - for file in *.js; do - fgrep -v "#! /usr/bin/env ${NODE}" "$file" > "browser/${file}" - tname=$(echo "$file" | sed 's/.js$//') - cp -f "${tname}.exp" "browser/${tname}.exp" - sed "s/{{tname}}/${tname}/" index.html.tpl > "browser/${tname}.html" - echo "${tname}.html" >> "browser/tests.txt" - done + cd test/default && + mkdir -p browser && + rm -f browser/tests.txt && + for file in *.js; do + grep -Fv "#! /usr/bin/env ${NODE}" "$file" >"browser/${file}" + tname=$(echo "$file" | sed 's/.js$//') + cp -f "${tname}.exp" "browser/${tname}.exp" + sed "s/{{tname}}/${tname}/" index.html.tpl >"browser/${tname}.html" + echo "${tname}.html" >>"browser/tests.txt" + done touch "$DONE_FILE" ) else echo 'Running the test suite' ( - cd test/default && \ - for file in *.js; do - echo "#! /usr/bin/env ${NODE}" > "${file}.tmp" - fgrep -v "#! /usr/bin/env ${NODE}" "$file" >> "${file}.tmp" - chmod +x "${file}.tmp" - mv -f "${file}.tmp" "$file" - done + cd test/default && + for file in *.js; do + echo "#! /usr/bin/env ${NODE}" >"${file}.tmp" + grep -Fv "#! /usr/bin/env ${NODE}" "$file" >>"${file}.tmp" + chmod +x "${file}.tmp" + mv -f "${file}.tmp" "$file" + done ) make $MAKE_FLAGS check || exit 1 touch "$DONE_FILE" diff --git a/src/libsodium/dist-build/generate-emscripten-symbols.sh b/src/libsodium/dist-build/generate-emscripten-symbols.sh index 873307d21..721262e6e 100755 --- a/src/libsodium/dist-build/generate-emscripten-symbols.sh +++ b/src/libsodium/dist-build/generate-emscripten-symbols.sh @@ -2,6 +2,8 @@ set -e +LIBSODIUM=${LIBSODIUM:-/tmp/sodium/lib/libsodium.26.dylib} + symbols() { { SUMO="$1" @@ -15,11 +17,11 @@ symbols() { else eval "defined_${symbol}=no" fi - done < emscripten-symbols.def + done emscripten.sh.tmp && \ +sed s/EXPORTED_FUNCTIONS_STANDARD=\'.*\'/EXPORTED_FUNCTIONS_STANDARD=\'${out}\'/ emscripten.sh.tmp && mv -f emscripten.sh.tmp emscripten.sh out=$(symbols sumo) -sed s/EXPORTED_FUNCTIONS_SUMO=\'.*\'/EXPORTED_FUNCTIONS_SUMO=\'${out}\'/ < emscripten.sh > emscripten.sh.tmp && \ +sed s/EXPORTED_FUNCTIONS_SUMO=\'.*\'/EXPORTED_FUNCTIONS_SUMO=\'${out}\'/ emscripten.sh.tmp && mv -f emscripten.sh.tmp emscripten.sh chmod +x emscripten.sh diff --git a/src/libsodium/dist-build/ios.sh b/src/libsodium/dist-build/ios.sh deleted file mode 100755 index ef1848ff1..000000000 --- a/src/libsodium/dist-build/ios.sh +++ /dev/null @@ -1,135 +0,0 @@ -#! /bin/sh -# -# Step 1. -# Configure for base system so simulator is covered -# -# Step 2. -# Make for iOS and iOS simulator -# -# Step 3. -# Merge libs into final version for xcode import - -export PREFIX="$(pwd)/libsodium-ios" -export IOS32_PREFIX="$PREFIX/tmp/ios32" -export IOS32s_PREFIX="$PREFIX/tmp/ios32s" -export IOS64_PREFIX="$PREFIX/tmp/ios64" -export SIMULATOR32_PREFIX="$PREFIX/tmp/simulator32" -export SIMULATOR64_PREFIX="$PREFIX/tmp/simulator64" -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 -export BASEDIR="${XCODEDIR}/Platforms/iPhoneSimulator.platform/Developer" -export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" -export SDK="${BASEDIR}/SDKs/iPhoneSimulator.sdk" - -## i386 simulator -export CFLAGS="-O2 -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" -export LDFLAGS="-arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - -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 --host=i686-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$SIMULATOR32_PREFIX" || exit 1 - - -NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) -PROCESSORS=${NPROCESSORS:-3} - -make -j${PROCESSORS} install || exit 1 - -## x86_64 simulator -export CFLAGS="-O2 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" -export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=x86_64-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$SIMULATOR64_PREFIX" - -make -j${PROCESSORS} install || exit 1 - -# Build for iOS -export BASEDIR="${XCODEDIR}/Platforms/iPhoneOS.platform/Developer" -export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" -export SDK="${BASEDIR}/SDKs/iPhoneOS.sdk" - -## 32-bit iOS -export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" -export LDFLAGS="-fembed-bitcode -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=arm-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$IOS32_PREFIX" || exit 1 - -make -j${PROCESSORS} install || exit 1 - -## 32-bit armv7s iOS -export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" -export LDFLAGS="-fembed-bitcode -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=arm-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$IOS32s_PREFIX" || exit 1 - -make -j${PROCESSORS} install || exit 1 - -## 64-bit iOS -export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" -export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=arm-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$IOS64_PREFIX" || exit 1 - -make -j${PROCESSORS} install || exit 1 - -# Create universal binary and include folder -rm -fr -- "$PREFIX/include" "$PREFIX/libsodium.a" 2> /dev/null -mkdir -p -- "$PREFIX/lib" -lipo -create \ - "$SIMULATOR32_PREFIX/lib/libsodium.a" \ - "$SIMULATOR64_PREFIX/lib/libsodium.a" \ - "$IOS32_PREFIX/lib/libsodium.a" \ - "$IOS32s_PREFIX/lib/libsodium.a" \ - "$IOS64_PREFIX/lib/libsodium.a" \ - -output "$PREFIX/lib/libsodium.a" -mv -f -- "$IOS32_PREFIX/include" "$PREFIX/" - -echo -echo "libsodium has been installed into $PREFIX" -echo -file -- "$PREFIX/lib/libsodium.a" - -# Cleanup -rm -rf -- "$PREFIX/tmp" -make distclean > /dev/null diff --git a/src/libsodium/dist-build/osx.sh b/src/libsodium/dist-build/macos.sh similarity index 91% rename from src/libsodium/dist-build/osx.sh rename to src/libsodium/dist-build/macos.sh index b7ff1bd5b..2d2e0302a 100755 --- a/src/libsodium/dist-build/osx.sh +++ b/src/libsodium/dist-build/macos.sh @@ -14,7 +14,7 @@ PROCESSORS=${NPROCESSORS:-3} mkdir -p $PREFIX || exit 1 -export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -O2 -g" +export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -O3" export LDFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN}" make distclean >/dev/null diff --git a/src/libsodium/dist-build/msys2-win32.sh b/src/libsodium/dist-build/msys2-win32.sh index dcc9ee06a..6217bcc0a 100755 --- a/src/libsodium/dist-build/msys2-win32.sh +++ b/src/libsodium/dist-build/msys2-win32.sh @@ -1,9 +1,9 @@ #! /bin/sh -export CFLAGS="-Ofast -fomit-frame-pointer -m32 -march=pentium3 -mtune=westmere" +export CFLAGS="-O3 -fomit-frame-pointer -m32 -march=pentium3 -mtune=westmere" export PREFIX="$(pwd)/libsodium-win32" -if (i686-w64-mingw32-gcc --version > /dev/null 2>&1) then +if (i686-w64-mingw32-gcc --version >/dev/null 2>&1); then echo MinGW found else echo Please install mingw-w64-i686-gcc >&2 @@ -11,8 +11,8 @@ else fi ./configure --prefix="$PREFIX" --exec-prefix="$PREFIX" \ - --host=i686-w64-mingw32 && \ -make clean && \ -make && \ -make check && \ -make install + --host=i686-w64-mingw32 && + make clean && + make && + make check && + make install diff --git a/src/libsodium/dist-build/msys2-win64.sh b/src/libsodium/dist-build/msys2-win64.sh index 0b38d6dd2..24b3072aa 100755 --- a/src/libsodium/dist-build/msys2-win64.sh +++ b/src/libsodium/dist-build/msys2-win64.sh @@ -1,9 +1,9 @@ #! /bin/sh -export CFLAGS="-Ofast -fomit-frame-pointer -m64 -mtune=westmere" +export CFLAGS="-O3 -fomit-frame-pointer -m64 -mtune=westmere" export PREFIX="$(pwd)/libsodium-win64" -if (x86_64-w64-mingw32-gcc --version > /dev/null 2>&1) then +if (x86_64-w64-mingw32-gcc --version >/dev/null 2>&1); then echo MinGW found else echo Please install mingw-w64-x86_64-gcc >&2 @@ -11,8 +11,8 @@ else fi ./configure --prefix="$PREFIX" --exec-prefix="$PREFIX" \ - --host=x86_64-w64-mingw32 && \ -make clean && \ -make && \ -make check && \ -make install + --host=x86_64-w64-mingw32 && + make clean && + make && + make check && + make install diff --git a/src/libsodium/dist-build/wasm32-wasi.sh b/src/libsodium/dist-build/wasm32-wasi.sh index cab8f3496..4a17f1342 100755 --- a/src/libsodium/dist-build/wasm32-wasi.sh +++ b/src/libsodium/dist-build/wasm32-wasi.sh @@ -1,14 +1,14 @@ #! /bin/sh -export PATH="/opt/zig/bin:/opt/zig:/usr/local/opt/llvm/bin:$PATH" +export PATH="/opt/zig/bin:/opt/zig:/opt/homebrew/bin:$PATH" export PREFIX="$(pwd)/libsodium-wasm32-wasi" mkdir -p $PREFIX || exit 1 export CC="zig cc" -export CFLAGS="-DED25519_NONDETERMINISTIC=1 --target=wasm32-wasi -O2" -export LDFLAGS="-s -Wl,--stack-first" +export CFLAGS="--target=wasm32-wasi -O3" +export LDFLAGS="-s" export AR="zig ar" export RANLIB="zig ranlib" @@ -16,7 +16,9 @@ make distclean >/dev/null if [ "x$1" = "x--bench" ]; then export BENCHMARKS=1 - export CPPFLAGS="-DBENCHMARKS -DITERATIONS=100" + export CPPFLAGS="-DBENCHMARKS -DITERATIONS=200" +else + export CPPFLAGS="-DED25519_NONDETERMINISTIC=1" fi if [ -n "$LIBSODIUM_MINIMAL_BUILD" ]; then @@ -28,7 +30,7 @@ fi if ! ./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ --prefix="$PREFIX" \ --host=wasm32-wasi \ - --disable-ssp --disable-shared --without-pthreads; then + --disable-pie --disable-ssp --disable-shared --without-pthreads; then cat config.log exit 1 fi diff --git a/src/libsodium/dist-build/watchos.sh b/src/libsodium/dist-build/watchos.sh deleted file mode 100755 index 60ab4b4ea..000000000 --- a/src/libsodium/dist-build/watchos.sh +++ /dev/null @@ -1,114 +0,0 @@ -#! /bin/sh -# -# Step 1. -# Configure for base system so simulator is covered -# -# Step 2. -# Make for watchOS and watchOS simulator -# -# Step 3. -# Merge libs into final version for xcode import - -export PREFIX="$(pwd)/libsodium-watchos" -export WATCHOS32_PREFIX="$PREFIX/tmp/watchos32" -export WATCHOS64_32_PREFIX="$PREFIX/tmp/watchos64_32" -export SIMULATOR32_PREFIX="$PREFIX/tmp/simulator32" -export SIMULATOR64_PREFIX="$PREFIX/tmp/simulator64" -export XCODEDIR=$(xcode-select -p) - -export WATCHOS_SIMULATOR_VERSION_MIN=${WATCHOS_SIMULATOR_VERSION_MIN-"4.0.0"} -export WATCHOS_VERSION_MIN=${WATCHOS_VERSION_MIN-"4.0.0"} - -mkdir -p $SIMULATOR32_PREFIX $SIMULATOR64_PREFIX $WATCHOS32_PREFIX $WATCHOS64_32_PREFIX || exit 1 - -# Build for the simulator -export BASEDIR="${XCODEDIR}/Platforms/WatchSimulator.platform/Developer" -export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" -export SDK="${BASEDIR}/SDKs/WatchSimulator.sdk" - -## i386 simulator -export CFLAGS="-O2 -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" -export LDFLAGS="-arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - -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 --host=i686-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$SIMULATOR32_PREFIX" || exit 1 - - -NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) -PROCESSORS=${NPROCESSORS:-3} - -make -j${PROCESSORS} install || exit 1 - -## x86_64 simulator -export CFLAGS="-O2 -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" -export LDFLAGS="-arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=x86_64-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$SIMULATOR64_PREFIX" - -make -j${PROCESSORS} install || exit 1 - -# Build for watchOS -export BASEDIR="${XCODEDIR}/Platforms/WatchOS.platform/Developer" -export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" -export SDK="${BASEDIR}/SDKs/WatchOS.sdk" - -## 32-bit watchOS -export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" -export LDFLAGS="-fembed-bitcode -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=arm-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$WATCHOS32_PREFIX" || exit 1 - -make -j${PROCESSORS} install || exit 1 - -## 64-bit arm64_32 watchOS -export CFLAGS="-fembed-bitcode -O2 -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" -export LDFLAGS="-fembed-bitcode -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" - -make distclean > /dev/null - -./configure --host=arm-apple-darwin10 \ - --disable-shared \ - ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$WATCHOS64_32_PREFIX" || exit 1 - -make -j${PROCESSORS} install || exit 1 - -# Create universal binary and include folder -rm -fr -- "$PREFIX/include" "$PREFIX/libsodium.a" 2> /dev/null -mkdir -p -- "$PREFIX/lib" -lipo -create \ - "$SIMULATOR32_PREFIX/lib/libsodium.a" \ - "$SIMULATOR64_PREFIX/lib/libsodium.a" \ - "$WATCHOS32_PREFIX/lib/libsodium.a" \ - "$WATCHOS64_32_PREFIX/lib/libsodium.a" \ - -output "$PREFIX/lib/libsodium.a" -mv -f -- "$WATCHOS32_PREFIX/include" "$PREFIX/" - -echo -echo "libsodium has been installed into $PREFIX" -echo -file -- "$PREFIX/lib/libsodium.a" - -# Cleanup -rm -rf -- "$PREFIX/tmp" -make distclean > /dev/null diff --git a/src/libsodium/install-sh b/src/libsodium/install-sh deleted file mode 100755 index 377bb8687..000000000 --- a/src/libsodium/install-sh +++ /dev/null @@ -1,527 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2011-11-20.07; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/libsodium/libsodium.vcxproj b/src/libsodium/libsodium.vcxproj deleted file mode 100644 index ff6afe4be..000000000 --- a/src/libsodium/libsodium.vcxproj +++ /dev/null @@ -1,563 +0,0 @@ - - - - - DebugDLL - Win32 - - - DebugDLL - x64 - - - Debug - Win32 - - - Debug - x64 - - - ReleaseDLL - Win32 - - - ReleaseDLL - x64 - - - Release - Win32 - - - Release - x64 - - - - {A185B162-6CB6-4502-B03F-B56F7699A8D9} - Win32Proj - libsodium - - - - StaticLibrary - true - MultiByte - false - v140 - - - DynamicLibrary - true - MultiByte - false - v140 - - - StaticLibrary - true - MultiByte - false - v140 - - - DynamicLibrary - true - MultiByte - false - v140 - - - StaticLibrary - false - true - MultiByte - v140 - - - DynamicLibrary - false - true - MultiByte - v140 - - - StaticLibrary - false - true - MultiByte - v140 - - - DynamicLibrary - false - true - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - true - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - true - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - true - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - false - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - false - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - false - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - false - $(SolutionDir)Build\$(Configuration)\$(Platform)\ - $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ - - - - - - Level3 - Disabled - SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDebug - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - - - Level3 - Disabled - SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDebugDLL - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - - - Level3 - Disabled - SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDebug - - - Console - true - - - - - - - Level3 - Disabled - SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDebugDLL - - - Console - true - - - - - Level3 - - - Full - true - true - SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreaded - Speed - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - - - Full - true - true - SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDLL - Speed - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreaded - - - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - 4244;%(DisableSpecificWarnings) - MultiThreadedDLL - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libsodium/libsodium.vcxproj.filters b/src/libsodium/libsodium.vcxproj.filters deleted file mode 100644 index a13d68ce5..000000000 --- a/src/libsodium/libsodium.vcxproj.filters +++ /dev/null @@ -1,723 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - diff --git a/src/libsodium/m4/ax_add_fortify_source.m4 b/src/libsodium/m4/ax_add_fortify_source.m4 index b88d496fb..c0b089c0f 100644 --- a/src/libsodium/m4/ax_add_fortify_source.m4 +++ b/src/libsodium/m4/ax_add_fortify_source.m4 @@ -9,9 +9,9 @@ # DESCRIPTION # # Check whether -D_FORTIFY_SOURCE=2 can be added to CPPFLAGS without macro -# redefinition warnings or linker errors. Some distributions (such as -# Gentoo Linux) enable _FORTIFY_SOURCE globally in their compilers, -# leading to unnecessary warnings in the form of +# redefinition warnings, other cpp warnings or linker. Some distributions +# (such as Ubuntu or Gentoo Linux) enable _FORTIFY_SOURCE globally in +# their compilers, leading to unnecessary warnings in the form of # # :0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] # : note: this is the location of the previous definition @@ -21,24 +21,67 @@ # to CPPFLAGS. # # Newer mingw-w64 msys2 package comes with a bug in -# headers-git-7.0.0.5546.d200317d-1. It broke -D_FORTIFY_SOURCE -# support, and would need -lssp or -fstack-protector. See -# https://github.com/msys2/MINGW-packages/issues/5803. Try to -# actually link it. +# headers-git-7.0.0.5546.d200317d-1. It broke -D_FORTIFY_SOURCE support, +# and would need -lssp or -fstack-protector. See +# https://github.com/msys2/MINGW-packages/issues/5803. Try to actually +# link it. # # LICENSE # # Copyright (c) 2017 David Seifert -# Copyright (c) 2019 Reini Urban +# Copyright (c) 2019, 2023 Reini Urban # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 3 +#serial 8 AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ + ac_save_cflags=$CFLAGS + ac_cwerror_flag=yes + AX_CHECK_COMPILE_FLAG([-Werror],[CFLAGS="$CFLAGS -Werror"]) + ax_add_fortify_3_failed= + AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=3 to CPPFLAGS]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([], + [[ + #ifndef _FORTIFY_SOURCE + return 0; + #else + _FORTIFY_SOURCE_already_defined; + #endif + ]] + )], + AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + #define _FORTIFY_SOURCE 3 + #include + int main() { + char *s = " "; + strcpy(s, "x"); + return strlen(s)-1; + } + ]] + )], + [ + AC_MSG_RESULT([yes]) + CFLAGS=$ac_save_cflags + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3" + ], [ + AC_MSG_RESULT([no]) + CFLAGS=$ac_save_cflags + ax_add_fortify_3_failed=1 + ], + ), + [ + AC_MSG_RESULT([no]) + CFLAGS=$ac_save_cflags + ax_add_fortify_3_failed=1 + ]) + if test -n "$ax_add_fortify_3_failed" + then AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([], @@ -46,7 +89,7 @@ AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ #ifndef _FORTIFY_SOURCE return 0; #else - this_is_an_error; + _FORTIFY_SOURCE_already_defined; #endif ]] )], @@ -54,8 +97,8 @@ AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ AC_LANG_SOURCE([[ #define _FORTIFY_SOURCE 2 #include - int main() { - const char *s = " "; + int main(void) { + char *s = " "; strcpy(s, "x"); return strlen(s)-1; } @@ -63,12 +106,16 @@ AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ )], [ AC_MSG_RESULT([yes]) + CFLAGS=$ac_save_cflags CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" ], [ AC_MSG_RESULT([no]) + CFLAGS=$ac_save_cflags ], ), [ - AC_MSG_RESULT([no]) - ]) + AC_MSG_RESULT([no]) + CFLAGS=$ac_save_cflags + ]) + fi ]) diff --git a/src/libsodium/m4/ax_check_catchable_segv.m4 b/src/libsodium/m4/ax_check_catchable_segv.m4 index d8c7b6833..fb0579e03 100644 --- a/src/libsodium/m4/ax_check_catchable_segv.m4 +++ b/src/libsodium/m4/ax_check_catchable_segv.m4 @@ -21,9 +21,14 @@ static void sig(int _) { exit(0); } volatile unsigned char * volatile x = (volatile unsigned char *) malloc(8); size_t i; +#ifdef SIGPROT +signal(SIGPROT, sig); +#endif signal(SIGSEGV, sig); signal(SIGBUS, sig); #if !defined(__SANITIZE_ADDRESS__) && !defined(__EMSCRIPTEN__) +*((volatile unsigned char *) -1) = 0xd0; +*((volatile unsigned char *) 1) = 0xd0; for (i = 0; i < 10000000; i += 1024) { x[-i] = x[i] = (unsigned char) i; } #endif free((void *) x); diff --git a/src/libsodium/m4/ax_check_define.m4 b/src/libsodium/m4/ax_check_define.m4 index 20ba80868..c10d1137a 100644 --- a/src/libsodium/m4/ax_check_define.m4 +++ b/src/libsodium/m4/ax_check_define.m4 @@ -18,33 +18,12 @@ # # Copyright (c) 2008 Guido U. Draheim # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 9 +#serial 11 AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE]) AC_DEFUN([AC_CHECK_DEFINE],[ @@ -53,6 +32,7 @@ AC_CACHE_CHECK([for $1 defined], ac_var, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ #ifdef $1 int ok; + (void)ok; #else choke me #endif @@ -68,6 +48,7 @@ AC_CACHE_CHECK([for $2 defined in $1], ac_var, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[ #ifdef $2 int ok; + (void)ok; #else choke me #endif diff --git a/src/libsodium/m4/ax_check_gnu_make.m4 b/src/libsodium/m4/ax_check_gnu_make.m4 index 4c761ea03..785dc96da 100644 --- a/src/libsodium/m4/ax_check_gnu_make.m4 +++ b/src/libsodium/m4/ax_check_gnu_make.m4 @@ -4,7 +4,7 @@ # # SYNOPSIS # -# AX_CHECK_GNU_MAKE() +# AX_CHECK_GNU_MAKE([run-if-true],[run-if-false]) # # DESCRIPTION # @@ -13,6 +13,10 @@ # * The makefile variable `ifGNUmake' is set to the empty string, otherwise # it is set to "#". This is useful for including a special features in a # Makefile, which cannot be handled by other versions of make. +# * The makefile variable `ifnGNUmake' is set to #, otherwise +# it is set to the empty string. This is useful for including a special +# features in a Makefile, which can be handled +# by other versions of make or to specify else like clause. # * The variable `_cv_gnu_make_command` is set to the command to invoke # GNU make if it exists, the empty string otherwise. # * The variable `ax_cv_gnu_make_command` is set to the command to invoke @@ -20,6 +24,8 @@ # * If GNU Make is found, its version is extracted from the output of # `make --version` as the last field of a record of space-separated # columns and saved into the variable `ax_check_gnu_make_version`. +# * Additionally if GNU Make is found, run shell code run-if-true +# else run shell code run-if-false. # # Here is an example of its use: # @@ -31,6 +37,8 @@ # # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) # @ifGNUmake@ include $(DEPEND) +# @ifGNUmake@ else +# fallback code # @ifGNUmake@ endif # # Then configure.in would normally contain: @@ -61,7 +69,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 9 +#serial 12 AC_DEFUN([AX_CHECK_GNU_MAKE],dnl [AC_PROG_AWK @@ -79,6 +87,9 @@ dnl Search all the common names for GNU make done ;]) dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])]) + AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])], [AS_VAR_SET([ifnGNUmake], ["#"])]) AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])]) + AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1]) AC_SUBST([ifGNUmake]) + AC_SUBST([ifnGNUmake]) ]) diff --git a/src/libsodium/m4/ax_pthread.m4 b/src/libsodium/m4/ax_pthread.m4 index e5858e50c..9f35d1391 100644 --- a/src/libsodium/m4/ax_pthread.m4 +++ b/src/libsodium/m4/ax_pthread.m4 @@ -87,11 +87,11 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 30 +#serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_TARGET]) +AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) @@ -158,7 +158,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread -- # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case $target_os in +case $host_os in freebsd*) @@ -248,7 +248,7 @@ AS_IF([test "x$ax_pthread_clang" = "xyes"], # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled -case $target_os in +case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; @@ -450,7 +450,7 @@ if test "x$ax_pthread_ok" = "xyes"; then AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $target_os in + case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; @@ -480,7 +480,7 @@ if test "x$ax_pthread_ok" = "xyes"; then # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then - case $target_os in + case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], diff --git a/src/libsodium/m4/libtool.m4 b/src/libsodium/m4/libtool.m4 index 92060119f..79a2451ef 100644 --- a/src/libsodium/m4/libtool.m4 +++ b/src/libsodium/m4/libtool.m4 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1068,11 +1070,11 @@ _LT_EOF darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) - case ${MACOSX_DEPLOYMENT_TARGET},$host in - 10.[[012]],*|,*powerpc*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1121,12 +1123,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1240,7 +1242,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1257,7 +1260,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1287,7 +1290,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1304,7 +1307,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1316,7 +1319,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1338,7 +1341,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1346,7 +1349,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1354,7 +1357,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1374,14 +1377,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1449,7 +1452,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1488,9 +1491,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1709,7 +1725,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1752,7 +1768,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2202,26 +2218,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2544,7 +2569,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2554,14 +2579,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2580,7 +2605,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2617,7 +2642,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2650,7 +2675,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3449,7 +3474,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3483,14 +3508,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3504,7 +3529,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3551,7 +3576,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3678,13 +3703,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3710,7 +3735,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3950,7 +3975,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3968,20 +3993,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4005,7 +4030,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4023,9 +4048,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4312,7 +4337,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4395,7 +4420,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4731,7 +4756,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4914,7 +4939,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4922,7 +4947,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4979,15 +5004,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5039,7 +5064,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5151,6 +5176,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5165,7 +5191,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5208,7 +5234,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5220,7 +5246,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5236,7 +5262,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5368,7 +5394,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5551,12 +5577,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5597,7 +5623,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5645,7 +5671,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5856,6 +5882,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6626,8 +6653,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6725,6 +6752,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6755,7 +6783,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6892,7 +6920,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7032,13 +7060,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8184,6 +8212,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff --git a/src/libsodium/m4/ltversion.m4 b/src/libsodium/m4/ltversion.m4 index fa04b52a3..b155d0ace 100644 --- a/src/libsodium/m4/ltversion.m4 +++ b/src/libsodium/m4/ltversion.m4 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/src/libsodium/missing b/src/libsodium/missing deleted file mode 100755 index db98974ff..000000000 --- a/src/libsodium/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/libsodium/msvc-scripts/Makefile.am b/src/libsodium/msvc-scripts/Makefile.am deleted file mode 100644 index 16481929a..000000000 --- a/src/libsodium/msvc-scripts/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -EXTRA_DIST = \ - process.bat \ - rep.vbs \ - sodium.props diff --git a/src/libsodium/msvc-scripts/Makefile.in b/src/libsodium/msvc-scripts/Makefile.in deleted file mode 100644 index 737d3278a..000000000 --- a/src/libsodium/msvc-scripts/Makefile.in +++ /dev/null @@ -1,499 +0,0 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2020 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = msvc-scripts -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ - $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ - $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ - $(top_srcdir)/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/m4/ax_check_define.m4 \ - $(top_srcdir)/m4/ax_check_link_flag.m4 \ - $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/ax_tls.m4 \ - $(top_srcdir)/m4/ax_valgrind_check.m4 \ - $(top_srcdir)/m4/ld-output-def.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CFLAGS_AESNI = @CFLAGS_AESNI@ -CFLAGS_AVX = @CFLAGS_AVX@ -CFLAGS_AVX2 = @CFLAGS_AVX2@ -CFLAGS_AVX512F = @CFLAGS_AVX512F@ -CFLAGS_MMX = @CFLAGS_MMX@ -CFLAGS_PCLMUL = @CFLAGS_PCLMUL@ -CFLAGS_RDRAND = @CFLAGS_RDRAND@ -CFLAGS_SSE2 = @CFLAGS_SSE2@ -CFLAGS_SSE3 = @CFLAGS_SSE3@ -CFLAGS_SSE41 = @CFLAGS_SSE41@ -CFLAGS_SSSE3 = @CFLAGS_SSSE3@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWFLAGS = @CWFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLL_VERSION = @DLL_VERSION@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ -ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ -ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ -ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ -HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ -HAVE_CPUID_V = @HAVE_CPUID_V@ -HAVE_TI_MODE_V = @HAVE_TI_MODE_V@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIBTOOL_EXTRA_FLAGS = @LIBTOOL_EXTRA_FLAGS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ -PTHREAD_CC = @PTHREAD_CC@ -PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ -PTHREAD_CXX = @PTHREAD_CXX@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -SAFECODE_HOME = @SAFECODE_HOME@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SODIUM_LIBRARY_MINIMAL_DEF = @SODIUM_LIBRARY_MINIMAL_DEF@ -SODIUM_LIBRARY_VERSION = @SODIUM_LIBRARY_VERSION@ -SODIUM_LIBRARY_VERSION_MAJOR = @SODIUM_LIBRARY_VERSION_MAJOR@ -SODIUM_LIBRARY_VERSION_MINOR = @SODIUM_LIBRARY_VERSION_MINOR@ -STRIP = @STRIP@ -TEST_LDFLAGS = @TEST_LDFLAGS@ -VALGRIND = @VALGRIND@ -VALGRIND_ENABLED = @VALGRIND_ENABLED@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_pthread_config = @ax_pthread_config@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -valgrind_enabled_tools = @valgrind_enabled_tools@ -valgrind_tools = @valgrind_tools@ -EXTRA_DIST = \ - process.bat \ - rep.vbs \ - sodium.props - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign msvc-scripts/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign msvc-scripts/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/libsodium/msvc-scripts/process.bat b/src/libsodium/msvc-scripts/process.bat deleted file mode 100755 index 291679e4e..000000000 --- a/src/libsodium/msvc-scripts/process.bat +++ /dev/null @@ -1,5 +0,0 @@ -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@/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/src/libsodium/packaging/dotnet-core/libsodium.pkgproj b/src/libsodium/packaging/dotnet-core/libsodium.pkgproj index ccc0a9e5c..5e3d0ad17 100644 --- a/src/libsodium/packaging/dotnet-core/libsodium.pkgproj +++ b/src/libsodium/packaging/dotnet-core/libsodium.pkgproj @@ -9,7 +9,7 @@ libsodium - 1.0.18.1 + 1.0.20.0 Frank Denis Internal implementation package not meant for direct consumption. Please do not reference directly. © $([System.DateTime]::UtcNow.ToString(yyyy)) Frank Denis @@ -27,11 +27,19 @@ + - + + + + + + + + diff --git a/src/libsodium/packaging/nuget/package.config b/src/libsodium/packaging/nuget/package.config index 729035fcc..5bc0aa4c4 100644 --- a/src/libsodium/packaging/nuget/package.config +++ b/src/libsodium/packaging/nuget/package.config @@ -1,4 +1,4 @@ - + diff --git a/src/libsodium/regen-msvc/libsodium.vcxproj.tpl b/src/libsodium/regen-msvc/libsodium.vcxproj.tpl index e8d326c8e..08a5b0961 100644 --- a/src/libsodium/regen-msvc/libsodium.vcxproj.tpl +++ b/src/libsodium/regen-msvc/libsodium.vcxproj.tpl @@ -1,59 +1,13 @@  - + {A185B162-6CB6-4502-B03F-B56F7699A8D9} libsodium {{platform}} - - DebugDLL - Win32 - - - ReleaseDLL - Win32 - - - DebugDLL - x64 - - - ReleaseDLL - x64 - - - DebugLTCG - Win32 - - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG - x64 - - - DebugLIB - Win32 - - - ReleaseLIB - Win32 - - - DebugLIB - x64 - - - ReleaseLIB - x64 - + {{configurations}} StaticLibrary @@ -66,16 +20,6 @@ - - - - - - - - - - {{v1}} diff --git a/src/libsodium/regen-msvc/regen-msvc.py b/src/libsodium/regen-msvc/regen-msvc.py index 8bddbf76d..a8ff8d958 100755 --- a/src/libsodium/regen-msvc/regen-msvc.py +++ b/src/libsodium/regen-msvc/regen-msvc.py @@ -9,24 +9,24 @@ tlv1 = "" for file in glob.iglob("src/libsodium/**/*.c", recursive=True): file = file.replace("/", "\\") - tlv1 = tlv1 + ' \r\n'.format(file) + tlv1 = tlv1 + ' \r\n'.format(file) tlv2 = "" for file in glob.iglob("src/libsodium/**/*.h", recursive=True): file = file.replace("/", "\\") - tlv2 = tlv2 + ' \r\n'.format(file) + tlv2 = tlv2 + ' \r\n'.format(file) tlf1 = "" for file in glob.iglob("src/libsodium/**/*.c", recursive=True): file = file.replace("/", "\\") - tlf1 = tlf1 + ' \r\n'.format(file) + tlf1 = tlf1 + ' \r\n'.format(file) tlf1 = tlf1 + " Source Files\r\n" tlf1 = tlf1 + " \r\n" tlf2 = "" for file in glob.iglob("src/libsodium/**/*.h", recursive=True): file = file.replace("/", "\\") - tlf2 = tlf2 + ' \r\n'.format(file) + tlf2 = tlf2 + ' \r\n'.format(file) tlf2 = tlf2 + " Header Files\r\n" tlf2 = tlf2 + " \r\n" @@ -79,6 +79,40 @@ fd = fd + " \r\n" +def get_project_configurations(vs_version): + projconfig = "" + configs = [ + "DebugDLL", + "ReleaseDLL", + "DebugLIB", + "ReleaseLIB", + "DebugLTCG", + "ReleaseLTCG", + ] + platforms = ["Win32", "x64"] + # add arm64 platform only for v142+ toolchain + if vs_version >= 142: + platforms.append("ARM64") + for config in configs: + for platform in platforms: + projconfig = ( + projconfig + + ' \r\n'.format( + config, platform + ) + ) + projconfig = ( + projconfig + + " {}\r\n".format(config) + ) + projconfig = ( + projconfig + + " {}\r\n".format(platform) + ) + projconfig = projconfig + " \r\n" + return projconfig + + def apply_template(tplfile, outfile, sbox): tpl = "" with open(tplfile, "rb") as fd: @@ -108,12 +142,22 @@ def apply_template(tplfile, outfile, sbox): sd = os.path.dirname(os.path.realpath(__file__)) apply_template( - sd + "/tl_libsodium.vcxproj.filters.tpl", "libsodium.vcxproj.filters", sbox + sd + "/tl_libsodium.vcxproj.filters.tpl", + "ci/appveyor/libsodium.vcxproj.filters", + sbox, ) sbox.update({"platform": "v140"}) -apply_template(sd + "/tl_libsodium.vcxproj.tpl", "libsodium.vcxproj", sbox) +sbox.update({"configurations": get_project_configurations(140)}) +apply_template( + sd + "/tl_libsodium.vcxproj.tpl", "ci/appveyor/libsodium.vcxproj", sbox +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters", + sbox, +) apply_template( sd + "/libsodium.vcxproj.filters.tpl", "builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters", @@ -145,7 +189,16 @@ def apply_template(tplfile, outfile, sbox): sbox, ) +sbox.update({"platform": "v143"}) +sbox.update({"configurations": get_project_configurations(143)}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2022/libsodium/libsodium.vcxproj", + sbox, +) + sbox.update({"platform": "v142"}) +sbox.update({"configurations": get_project_configurations(142)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2019/libsodium/libsodium.vcxproj", @@ -153,6 +206,7 @@ def apply_template(tplfile, outfile, sbox): ) sbox.update({"platform": "v141"}) +sbox.update({"configurations": get_project_configurations(141)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2017/libsodium/libsodium.vcxproj", @@ -160,6 +214,7 @@ def apply_template(tplfile, outfile, sbox): ) sbox.update({"platform": "v140"}) +sbox.update({"configurations": get_project_configurations(140)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2015/libsodium/libsodium.vcxproj", @@ -167,6 +222,7 @@ def apply_template(tplfile, outfile, sbox): ) sbox.update({"platform": "v120"}) +sbox.update({"configurations": get_project_configurations(120)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2013/libsodium/libsodium.vcxproj", @@ -174,6 +230,7 @@ def apply_template(tplfile, outfile, sbox): ) sbox.update({"platform": "v110"}) +sbox.update({"configurations": get_project_configurations(110)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2012/libsodium/libsodium.vcxproj", @@ -181,6 +238,7 @@ def apply_template(tplfile, outfile, sbox): ) sbox.update({"platform": "v100"}) +sbox.update({"configurations": get_project_configurations(100)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2010/libsodium/libsodium.vcxproj", diff --git a/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl b/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl index 72bb16a87..b42408ebb 100644 --- a/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl +++ b/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl @@ -1,5 +1,6 @@  - + DebugDLL @@ -181,7 +182,7 @@ SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 4244;%(DisableSpecificWarnings) MultiThreadedDebug - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) Console @@ -197,7 +198,7 @@ SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 4244;%(DisableSpecificWarnings) MultiThreadedDebugDLL - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) Console @@ -246,7 +247,7 @@ 4244;%(DisableSpecificWarnings) MultiThreaded Speed - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) Console @@ -267,7 +268,7 @@ 4244;%(DisableSpecificWarnings) MultiThreadedDLL Speed - $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + $(SolutionDir);$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include\sodium;$(SolutionDir)..\..\src\libsodium\include;%(AdditionalIncludeDirectories) Console @@ -319,10 +320,10 @@ {{tlv2}} - + - + diff --git a/src/libsodium/src/Makefile.in b/src/libsodium/src/Makefile.in index c204ab90e..517c46d84 100644 --- a/src/libsodium/src/Makefile.in +++ b/src/libsodium/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -160,8 +160,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -206,6 +204,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -218,6 +217,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -234,8 +235,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -494,7 +497,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/src/libsodium/Makefile.am b/src/libsodium/src/libsodium/Makefile.am index 92de4fd3e..b3cd6637a 100644 --- a/src/libsodium/src/libsodium/Makefile.am +++ b/src/libsodium/src/libsodium/Makefile.am @@ -2,8 +2,19 @@ lib_LTLIBRARIES = \ libsodium.la libsodium_la_SOURCES = \ - crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \ - crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c \ + crypto_aead/aegis128l/aead_aegis128l.c \ + crypto_aead/aegis128l/aegis128l_common.h \ + crypto_aead/aegis128l/aegis128l_soft.c \ + crypto_aead/aegis128l/aegis128l_soft.h \ + crypto_aead/aegis128l/implementations.h \ + crypto_aead/aegis256/aead_aegis256.c \ + crypto_aead/aegis256/aegis256_common.h \ + crypto_aead/aegis256/aegis256_soft.c \ + crypto_aead/aegis256/aegis256_soft.h \ + crypto_aead/aegis256/implementations.h \ + crypto_aead/aes256gcm/aead_aes256gcm.c \ + crypto_aead/chacha20poly1305/aead_chacha20poly1305.c \ + crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c \ crypto_auth/crypto_auth.c \ crypto_auth/hmacsha256/auth_hmacsha256.c \ crypto_auth/hmacsha512/auth_hmacsha512.c \ @@ -17,6 +28,7 @@ libsodium_la_SOURCES = \ crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \ crypto_core/hsalsa20/core_hsalsa20.c \ crypto_core/salsa/ref/core_salsa_ref.c \ + crypto_core/softaes/softaes.c \ crypto_generichash/crypto_generichash.c \ crypto_generichash/blake2b/generichash_blake2.c \ crypto_generichash/blake2b/ref/blake2.h \ @@ -33,6 +45,8 @@ libsodium_la_SOURCES = \ crypto_hash/sha512/cp/hash_sha512_cp.c \ crypto_kdf/blake2b/kdf_blake2b.c \ crypto_kdf/crypto_kdf.c \ + crypto_kdf/hkdf/kdf_hkdf_sha256.c \ + crypto_kdf/hkdf/kdf_hkdf_sha512.c \ crypto_kx/crypto_kx.c \ crypto_onetimeauth/crypto_onetimeauth.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \ @@ -81,13 +95,15 @@ libsodium_la_SOURCES = \ crypto_stream/salsa20/stream_salsa20.c \ crypto_stream/salsa20/stream_salsa20.h \ crypto_stream/xsalsa20/stream_xsalsa20.c \ - crypto_verify/sodium/verify.c \ + crypto_verify/verify.c \ + include/sodium/private/asm_cet.h \ include/sodium/private/chacha20_ietf_ext.h \ include/sodium/private/common.h \ include/sodium/private/ed25519_ref10.h \ include/sodium/private/implementations.h \ include/sodium/private/mutex.h \ include/sodium/private/sse2_64_32.h \ + include/sodium/private/softaes.h \ randombytes/randombytes.c \ sodium/codecs.c \ sodium/core.c \ @@ -194,8 +210,8 @@ endif SUBDIRS = \ include -libsodium_la_LIBADD = libaesni.la libsse2.la libssse3.la libsse41.la libavx2.la libavx512f.la -noinst_LTLIBRARIES = libaesni.la libsse2.la libssse3.la libsse41.la libavx2.la libavx512f.la +libsodium_la_LIBADD = libaesni.la libarmcrypto.la libsse2.la libssse3.la libsse41.la libavx2.la libavx512f.la +noinst_LTLIBRARIES = libaesni.la libarmcrypto.la libsse2.la libssse3.la libsse41.la libavx2.la libavx512f.la librdrand_la_LDFLAGS = $(libsodium_la_LDFLAGS) librdrand_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ @@ -211,10 +227,24 @@ libsodium_la_SOURCES += \ randombytes/sysrandom/randombytes_sysrandom.c endif +libarmcrypto_la_LDFLAGS = $(libsodium_la_LDFLAGS) +libarmcrypto_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ + @CFLAGS_ARMCRYPTO@ +libarmcrypto_la_SOURCES = \ + crypto_aead/aegis128l/aegis128l_armcrypto.c \ + crypto_aead/aegis128l/aegis128l_armcrypto.h \ + crypto_aead/aegis256/aegis256_armcrypto.c \ + crypto_aead/aegis256/aegis256_armcrypto.h \ + crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c + libaesni_la_LDFLAGS = $(libsodium_la_LDFLAGS) libaesni_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ - @CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@ + @CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AVX@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@ libaesni_la_SOURCES = \ + crypto_aead/aegis128l/aegis128l_aesni.c \ + crypto_aead/aegis128l/aegis128l_aesni.h \ + crypto_aead/aegis256/aegis256_aesni.c \ + crypto_aead/aegis256/aegis256_aesni.h \ crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c libsse2_la_LDFLAGS = $(libsodium_la_LDFLAGS) diff --git a/src/libsodium/src/libsodium/Makefile.in b/src/libsodium/src/libsodium/Makefile.in index bdab74a78..a88dd0683 100644 --- a/src/libsodium/src/libsodium/Makefile.in +++ b/src/libsodium/src/libsodium/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -219,7 +219,10 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(defexecdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libaesni_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp -am_libaesni_la_OBJECTS = crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo +am_libaesni_la_OBJECTS = \ + crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo \ + crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo \ + crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo libaesni_la_OBJECTS = $(am_libaesni_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -228,6 +231,16 @@ am__v_lt_1 = libaesni_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libaesni_la_LDFLAGS) $(LDFLAGS) -o $@ +libarmcrypto_la_LIBADD = +am_libarmcrypto_la_OBJECTS = \ + crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo \ + crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo \ + crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo +libarmcrypto_la_OBJECTS = $(am_libarmcrypto_la_OBJECTS) +libarmcrypto_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libarmcrypto_la_LDFLAGS) $(LDFLAGS) \ + -o $@ libavx2_la_LIBADD = am_libavx2_la_OBJECTS = crypto_generichash/blake2b/ref/libavx2_la-blake2b-compress-avx2.lo \ crypto_pwhash/argon2/libavx2_la-argon2-fill-block-avx2.lo \ @@ -250,11 +263,23 @@ librdrand_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(librdrand_la_LDFLAGS) $(LDFLAGS) -o $@ @EMSCRIPTEN_FALSE@am_librdrand_la_rpath = -libsodium_la_DEPENDENCIES = libaesni.la libsse2.la libssse3.la \ - libsse41.la libavx2.la libavx512f.la $(am__append_8) +libsodium_la_DEPENDENCIES = libaesni.la libarmcrypto.la libsse2.la \ + libssse3.la libsse41.la libavx2.la libavx512f.la \ + $(am__append_8) am__libsodium_la_SOURCES_DIST = \ - crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \ - crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c \ + crypto_aead/aegis128l/aead_aegis128l.c \ + crypto_aead/aegis128l/aegis128l_common.h \ + crypto_aead/aegis128l/aegis128l_soft.c \ + crypto_aead/aegis128l/aegis128l_soft.h \ + crypto_aead/aegis128l/implementations.h \ + crypto_aead/aegis256/aead_aegis256.c \ + crypto_aead/aegis256/aegis256_common.h \ + crypto_aead/aegis256/aegis256_soft.c \ + crypto_aead/aegis256/aegis256_soft.h \ + crypto_aead/aegis256/implementations.h \ + crypto_aead/aes256gcm/aead_aes256gcm.c \ + crypto_aead/chacha20poly1305/aead_chacha20poly1305.c \ + crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c \ crypto_auth/crypto_auth.c \ crypto_auth/hmacsha256/auth_hmacsha256.c \ crypto_auth/hmacsha512/auth_hmacsha512.c \ @@ -267,6 +292,7 @@ am__libsodium_la_SOURCES_DIST = \ crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \ crypto_core/hsalsa20/core_hsalsa20.c \ crypto_core/salsa/ref/core_salsa_ref.c \ + crypto_core/softaes/softaes.c \ crypto_generichash/crypto_generichash.c \ crypto_generichash/blake2b/generichash_blake2.c \ crypto_generichash/blake2b/ref/blake2.h \ @@ -281,7 +307,9 @@ am__libsodium_la_SOURCES_DIST = \ crypto_hash/sha512/hash_sha512.c \ crypto_hash/sha512/cp/hash_sha512_cp.c \ crypto_kdf/blake2b/kdf_blake2b.c crypto_kdf/crypto_kdf.c \ - crypto_kx/crypto_kx.c crypto_onetimeauth/crypto_onetimeauth.c \ + crypto_kdf/hkdf/kdf_hkdf_sha256.c \ + crypto_kdf/hkdf/kdf_hkdf_sha512.c crypto_kx/crypto_kx.c \ + crypto_onetimeauth/crypto_onetimeauth.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.h \ crypto_onetimeauth/poly1305/donna/poly1305_donna.h \ @@ -326,13 +354,14 @@ am__libsodium_la_SOURCES_DIST = \ crypto_stream/salsa20/stream_salsa20.c \ crypto_stream/salsa20/stream_salsa20.h \ crypto_stream/xsalsa20/stream_xsalsa20.c \ - crypto_verify/sodium/verify.c \ + crypto_verify/verify.c include/sodium/private/asm_cet.h \ include/sodium/private/chacha20_ietf_ext.h \ include/sodium/private/common.h \ include/sodium/private/ed25519_ref10.h \ include/sodium/private/implementations.h \ include/sodium/private/mutex.h \ - include/sodium/private/sse2_64_32.h randombytes/randombytes.c \ + include/sodium/private/sse2_64_32.h \ + include/sodium/private/softaes.h randombytes/randombytes.c \ sodium/codecs.c sodium/core.c sodium/runtime.c sodium/utils.c \ sodium/version.c crypto_core/ed25519/ref10/fe_51/base.h \ crypto_core/ed25519/ref10/fe_51/base2.h \ @@ -412,8 +441,14 @@ am__objects_1 = @MINIMAL_FALSE@ crypto_stream/salsa208/libsodium_la-stream_salsa208.lo \ @MINIMAL_FALSE@ crypto_stream/xchacha20/libsodium_la-stream_xchacha20.lo @EMSCRIPTEN_FALSE@am__objects_6 = randombytes/sysrandom/libsodium_la-randombytes_sysrandom.lo -am_libsodium_la_OBJECTS = crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo \ - crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo \ +am_libsodium_la_OBJECTS = \ + crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo \ + crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo \ + crypto_aead/aegis256/libsodium_la-aead_aegis256.lo \ + crypto_aead/aegis256/libsodium_la-aegis256_soft.lo \ + crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo \ + crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo \ + crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo \ crypto_auth/libsodium_la-crypto_auth.lo \ crypto_auth/hmacsha256/libsodium_la-auth_hmacsha256.lo \ crypto_auth/hmacsha512/libsodium_la-auth_hmacsha512.lo \ @@ -427,6 +462,7 @@ am_libsodium_la_OBJECTS = crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_ crypto_core/hsalsa20/ref2/libsodium_la-core_hsalsa20_ref2.lo \ crypto_core/hsalsa20/libsodium_la-core_hsalsa20.lo \ crypto_core/salsa/ref/libsodium_la-core_salsa_ref.lo \ + crypto_core/softaes/libsodium_la-softaes.lo \ crypto_generichash/libsodium_la-crypto_generichash.lo \ crypto_generichash/blake2b/libsodium_la-generichash_blake2.lo \ crypto_generichash/blake2b/ref/libsodium_la-blake2b-compress-ref.lo \ @@ -439,6 +475,8 @@ am_libsodium_la_OBJECTS = crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_ crypto_hash/sha512/cp/libsodium_la-hash_sha512_cp.lo \ crypto_kdf/blake2b/libsodium_la-kdf_blake2b.lo \ crypto_kdf/libsodium_la-crypto_kdf.lo \ + crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo \ + crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo \ crypto_kx/libsodium_la-crypto_kx.lo \ crypto_onetimeauth/libsodium_la-crypto_onetimeauth.lo \ crypto_onetimeauth/poly1305/libsodium_la-onetimeauth_poly1305.lo \ @@ -471,7 +509,7 @@ am_libsodium_la_OBJECTS = crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_ crypto_stream/libsodium_la-crypto_stream.lo \ crypto_stream/salsa20/libsodium_la-stream_salsa20.lo \ crypto_stream/xsalsa20/libsodium_la-stream_xsalsa20.lo \ - crypto_verify/sodium/libsodium_la-verify.lo \ + crypto_verify/libsodium_la-verify.lo \ randombytes/libsodium_la-randombytes.lo \ sodium/libsodium_la-codecs.lo sodium/libsodium_la-core.lo \ sodium/libsodium_la-runtime.lo sodium/libsodium_la-utils.lo \ @@ -530,9 +568,19 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo \ - crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo \ - crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo \ +am__depfiles_remade = crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Plo \ + crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Plo \ + crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Plo \ + crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Plo \ + crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Plo \ + crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Plo \ + crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Plo \ + crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Plo \ + crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Plo \ + crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo \ + crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Plo \ + crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo \ + crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo \ crypto_auth/$(DEPDIR)/libsodium_la-crypto_auth.Plo \ crypto_auth/hmacsha256/$(DEPDIR)/libsodium_la-auth_hmacsha256.Plo \ crypto_auth/hmacsha512/$(DEPDIR)/libsodium_la-auth_hmacsha512.Plo \ @@ -550,6 +598,7 @@ am__depfiles_remade = crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes crypto_core/hsalsa20/$(DEPDIR)/libsodium_la-core_hsalsa20.Plo \ crypto_core/hsalsa20/ref2/$(DEPDIR)/libsodium_la-core_hsalsa20_ref2.Plo \ crypto_core/salsa/ref/$(DEPDIR)/libsodium_la-core_salsa_ref.Plo \ + crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Plo \ crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Plo \ crypto_generichash/blake2b/$(DEPDIR)/libsodium_la-generichash_blake2.Plo \ crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Plo \ @@ -565,6 +614,8 @@ am__depfiles_remade = crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes crypto_hash/sha512/cp/$(DEPDIR)/libsodium_la-hash_sha512_cp.Plo \ crypto_kdf/$(DEPDIR)/libsodium_la-crypto_kdf.Plo \ crypto_kdf/blake2b/$(DEPDIR)/libsodium_la-kdf_blake2b.Plo \ + crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Plo \ + crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Plo \ crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Plo \ crypto_onetimeauth/$(DEPDIR)/libsodium_la-crypto_onetimeauth.Plo \ crypto_onetimeauth/poly1305/$(DEPDIR)/libsodium_la-onetimeauth_poly1305.Plo \ @@ -629,7 +680,7 @@ am__depfiles_remade = crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes crypto_stream/salsa208/ref/$(DEPDIR)/libsodium_la-stream_salsa208_ref.Plo \ crypto_stream/xchacha20/$(DEPDIR)/libsodium_la-stream_xchacha20.Plo \ crypto_stream/xsalsa20/$(DEPDIR)/libsodium_la-stream_xsalsa20.Plo \ - crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Plo \ + crypto_verify/$(DEPDIR)/libsodium_la-verify.Plo \ randombytes/$(DEPDIR)/libsodium_la-randombytes.Plo \ randombytes/internal/$(DEPDIR)/librdrand_la-randombytes_internal_random.Plo \ randombytes/sysrandom/$(DEPDIR)/libsodium_la-randombytes_sysrandom.Plo \ @@ -667,13 +718,14 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libaesni_la_SOURCES) $(libavx2_la_SOURCES) \ - $(libavx512f_la_SOURCES) $(librdrand_la_SOURCES) \ - $(libsodium_la_SOURCES) $(libsse2_la_SOURCES) \ - $(libsse41_la_SOURCES) $(libssse3_la_SOURCES) -DIST_SOURCES = $(libaesni_la_SOURCES) $(libavx2_la_SOURCES) \ - $(libavx512f_la_SOURCES) $(librdrand_la_SOURCES) \ - $(am__libsodium_la_SOURCES_DIST) \ +SOURCES = $(libaesni_la_SOURCES) $(libarmcrypto_la_SOURCES) \ + $(libavx2_la_SOURCES) $(libavx512f_la_SOURCES) \ + $(librdrand_la_SOURCES) $(libsodium_la_SOURCES) \ + $(libsse2_la_SOURCES) $(libsse41_la_SOURCES) \ + $(libssse3_la_SOURCES) +DIST_SOURCES = $(libaesni_la_SOURCES) $(libarmcrypto_la_SOURCES) \ + $(libavx2_la_SOURCES) $(libavx512f_la_SOURCES) \ + $(librdrand_la_SOURCES) $(am__libsodium_la_SOURCES_DIST) \ $(am__libsse2_la_SOURCES_DIST) $(libsse41_la_SOURCES) \ $(libssse3_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ @@ -716,8 +768,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp @@ -763,6 +813,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -775,6 +826,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -791,8 +844,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -914,9 +969,19 @@ valgrind_tools = @valgrind_tools@ lib_LTLIBRARIES = \ libsodium.la -libsodium_la_SOURCES = \ - crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \ - crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c \ +libsodium_la_SOURCES = crypto_aead/aegis128l/aead_aegis128l.c \ + crypto_aead/aegis128l/aegis128l_common.h \ + crypto_aead/aegis128l/aegis128l_soft.c \ + crypto_aead/aegis128l/aegis128l_soft.h \ + crypto_aead/aegis128l/implementations.h \ + crypto_aead/aegis256/aead_aegis256.c \ + crypto_aead/aegis256/aegis256_common.h \ + crypto_aead/aegis256/aegis256_soft.c \ + crypto_aead/aegis256/aegis256_soft.h \ + crypto_aead/aegis256/implementations.h \ + crypto_aead/aes256gcm/aead_aes256gcm.c \ + crypto_aead/chacha20poly1305/aead_chacha20poly1305.c \ + crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c \ crypto_auth/crypto_auth.c \ crypto_auth/hmacsha256/auth_hmacsha256.c \ crypto_auth/hmacsha512/auth_hmacsha512.c \ @@ -929,6 +994,7 @@ libsodium_la_SOURCES = \ crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \ crypto_core/hsalsa20/core_hsalsa20.c \ crypto_core/salsa/ref/core_salsa_ref.c \ + crypto_core/softaes/softaes.c \ crypto_generichash/crypto_generichash.c \ crypto_generichash/blake2b/generichash_blake2.c \ crypto_generichash/blake2b/ref/blake2.h \ @@ -943,7 +1009,9 @@ libsodium_la_SOURCES = \ crypto_hash/sha512/hash_sha512.c \ crypto_hash/sha512/cp/hash_sha512_cp.c \ crypto_kdf/blake2b/kdf_blake2b.c crypto_kdf/crypto_kdf.c \ - crypto_kx/crypto_kx.c crypto_onetimeauth/crypto_onetimeauth.c \ + crypto_kdf/hkdf/kdf_hkdf_sha256.c \ + crypto_kdf/hkdf/kdf_hkdf_sha512.c crypto_kx/crypto_kx.c \ + crypto_onetimeauth/crypto_onetimeauth.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.h \ crypto_onetimeauth/poly1305/donna/poly1305_donna.h \ @@ -988,13 +1056,14 @@ libsodium_la_SOURCES = \ crypto_stream/salsa20/stream_salsa20.c \ crypto_stream/salsa20/stream_salsa20.h \ crypto_stream/xsalsa20/stream_xsalsa20.c \ - crypto_verify/sodium/verify.c \ + crypto_verify/verify.c include/sodium/private/asm_cet.h \ include/sodium/private/chacha20_ietf_ext.h \ include/sodium/private/common.h \ include/sodium/private/ed25519_ref10.h \ include/sodium/private/implementations.h \ include/sodium/private/mutex.h \ - include/sodium/private/sse2_64_32.h randombytes/randombytes.c \ + include/sodium/private/sse2_64_32.h \ + include/sodium/private/softaes.h randombytes/randombytes.c \ sodium/codecs.c sodium/core.c sodium/runtime.c sodium/utils.c \ sodium/version.c $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) \ @@ -1020,10 +1089,12 @@ libsodium_la_CPPFLAGS = \ SUBDIRS = \ include -libsodium_la_LIBADD = libaesni.la libsse2.la libssse3.la libsse41.la \ - libavx2.la libavx512f.la $(am__append_8) -noinst_LTLIBRARIES = libaesni.la libsse2.la libssse3.la libsse41.la \ - libavx2.la libavx512f.la $(am__append_9) +libsodium_la_LIBADD = libaesni.la libarmcrypto.la libsse2.la \ + libssse3.la libsse41.la libavx2.la libavx512f.la \ + $(am__append_8) +noinst_LTLIBRARIES = libaesni.la libarmcrypto.la libsse2.la \ + libssse3.la libsse41.la libavx2.la libavx512f.la \ + $(am__append_9) librdrand_la_LDFLAGS = $(libsodium_la_LDFLAGS) librdrand_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ @CFLAGS_RDRAND@ @@ -1031,11 +1102,26 @@ librdrand_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ librdrand_la_SOURCES = \ randombytes/internal/randombytes_internal_random.c +libarmcrypto_la_LDFLAGS = $(libsodium_la_LDFLAGS) +libarmcrypto_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ + @CFLAGS_ARMCRYPTO@ + +libarmcrypto_la_SOURCES = \ + crypto_aead/aegis128l/aegis128l_armcrypto.c \ + crypto_aead/aegis128l/aegis128l_armcrypto.h \ + crypto_aead/aegis256/aegis256_armcrypto.c \ + crypto_aead/aegis256/aegis256_armcrypto.h \ + crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c + libaesni_la_LDFLAGS = $(libsodium_la_LDFLAGS) libaesni_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \ - @CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@ + @CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AVX@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@ libaesni_la_SOURCES = \ + crypto_aead/aegis128l/aegis128l_aesni.c \ + crypto_aead/aegis128l/aegis128l_aesni.h \ + crypto_aead/aegis256/aegis256_aesni.c \ + crypto_aead/aegis256/aegis256_aesni.h \ crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c libsse2_la_LDFLAGS = $(libsodium_la_LDFLAGS) @@ -1174,6 +1260,24 @@ clean-noinstLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +crypto_aead/aegis128l/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aegis128l + @: > crypto_aead/aegis128l/$(am__dirstamp) +crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aegis128l/$(DEPDIR) + @: > crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo: \ + crypto_aead/aegis128l/$(am__dirstamp) \ + crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis256/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aegis256 + @: > crypto_aead/aegis256/$(am__dirstamp) +crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aegis256/$(DEPDIR) + @: > crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo: \ + crypto_aead/aegis256/$(am__dirstamp) \ + crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) crypto_aead/aes256gcm/aesni/$(am__dirstamp): @$(MKDIR_P) crypto_aead/aes256gcm/aesni @: > crypto_aead/aes256gcm/aesni/$(am__dirstamp) @@ -1186,6 +1290,24 @@ crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo: \ libaesni.la: $(libaesni_la_OBJECTS) $(libaesni_la_DEPENDENCIES) $(EXTRA_libaesni_la_DEPENDENCIES) $(AM_V_CCLD)$(libaesni_la_LINK) $(libaesni_la_OBJECTS) $(libaesni_la_LIBADD) $(LIBS) +crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo: \ + crypto_aead/aegis128l/$(am__dirstamp) \ + crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo: \ + crypto_aead/aegis256/$(am__dirstamp) \ + crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aes256gcm/armcrypto/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aes256gcm/armcrypto + @: > crypto_aead/aes256gcm/armcrypto/$(am__dirstamp) +crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aes256gcm/armcrypto/$(DEPDIR) + @: > crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo: \ + crypto_aead/aes256gcm/armcrypto/$(am__dirstamp) \ + crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/$(am__dirstamp) + +libarmcrypto.la: $(libarmcrypto_la_OBJECTS) $(libarmcrypto_la_DEPENDENCIES) $(EXTRA_libarmcrypto_la_DEPENDENCIES) + $(AM_V_CCLD)$(libarmcrypto_la_LINK) $(libarmcrypto_la_OBJECTS) $(libarmcrypto_la_LIBADD) $(LIBS) crypto_generichash/blake2b/ref/$(am__dirstamp): @$(MKDIR_P) crypto_generichash/blake2b/ref @: > crypto_generichash/blake2b/ref/$(am__dirstamp) @@ -1243,24 +1365,45 @@ randombytes/internal/librdrand_la-randombytes_internal_random.lo: \ librdrand.la: $(librdrand_la_OBJECTS) $(librdrand_la_DEPENDENCIES) $(EXTRA_librdrand_la_DEPENDENCIES) $(AM_V_CCLD)$(librdrand_la_LINK) $(am_librdrand_la_rpath) $(librdrand_la_OBJECTS) $(librdrand_la_LIBADD) $(LIBS) -crypto_aead/chacha20poly1305/sodium/$(am__dirstamp): - @$(MKDIR_P) crypto_aead/chacha20poly1305/sodium - @: > crypto_aead/chacha20poly1305/sodium/$(am__dirstamp) -crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) crypto_aead/chacha20poly1305/sodium/$(DEPDIR) - @: > crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) -crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo: \ - crypto_aead/chacha20poly1305/sodium/$(am__dirstamp) \ - crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) -crypto_aead/xchacha20poly1305/sodium/$(am__dirstamp): - @$(MKDIR_P) crypto_aead/xchacha20poly1305/sodium - @: > crypto_aead/xchacha20poly1305/sodium/$(am__dirstamp) -crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) crypto_aead/xchacha20poly1305/sodium/$(DEPDIR) - @: > crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) -crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo: \ - crypto_aead/xchacha20poly1305/sodium/$(am__dirstamp) \ - crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo: \ + crypto_aead/aegis128l/$(am__dirstamp) \ + crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo: \ + crypto_aead/aegis128l/$(am__dirstamp) \ + crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis256/libsodium_la-aead_aegis256.lo: \ + crypto_aead/aegis256/$(am__dirstamp) \ + crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aegis256/libsodium_la-aegis256_soft.lo: \ + crypto_aead/aegis256/$(am__dirstamp) \ + crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aes256gcm/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aes256gcm + @: > crypto_aead/aes256gcm/$(am__dirstamp) +crypto_aead/aes256gcm/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/aes256gcm/$(DEPDIR) + @: > crypto_aead/aes256gcm/$(DEPDIR)/$(am__dirstamp) +crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo: \ + crypto_aead/aes256gcm/$(am__dirstamp) \ + crypto_aead/aes256gcm/$(DEPDIR)/$(am__dirstamp) +crypto_aead/chacha20poly1305/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/chacha20poly1305 + @: > crypto_aead/chacha20poly1305/$(am__dirstamp) +crypto_aead/chacha20poly1305/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/chacha20poly1305/$(DEPDIR) + @: > crypto_aead/chacha20poly1305/$(DEPDIR)/$(am__dirstamp) +crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo: \ + crypto_aead/chacha20poly1305/$(am__dirstamp) \ + crypto_aead/chacha20poly1305/$(DEPDIR)/$(am__dirstamp) +crypto_aead/xchacha20poly1305/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/xchacha20poly1305 + @: > crypto_aead/xchacha20poly1305/$(am__dirstamp) +crypto_aead/xchacha20poly1305/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_aead/xchacha20poly1305/$(DEPDIR) + @: > crypto_aead/xchacha20poly1305/$(DEPDIR)/$(am__dirstamp) +crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo: \ + crypto_aead/xchacha20poly1305/$(am__dirstamp) \ + crypto_aead/xchacha20poly1305/$(DEPDIR)/$(am__dirstamp) crypto_auth/$(am__dirstamp): @$(MKDIR_P) crypto_auth @: > crypto_auth/$(am__dirstamp) @@ -1364,6 +1507,15 @@ crypto_core/salsa/ref/$(DEPDIR)/$(am__dirstamp): crypto_core/salsa/ref/libsodium_la-core_salsa_ref.lo: \ crypto_core/salsa/ref/$(am__dirstamp) \ crypto_core/salsa/ref/$(DEPDIR)/$(am__dirstamp) +crypto_core/softaes/$(am__dirstamp): + @$(MKDIR_P) crypto_core/softaes + @: > crypto_core/softaes/$(am__dirstamp) +crypto_core/softaes/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_core/softaes/$(DEPDIR) + @: > crypto_core/softaes/$(DEPDIR)/$(am__dirstamp) +crypto_core/softaes/libsodium_la-softaes.lo: \ + crypto_core/softaes/$(am__dirstamp) \ + crypto_core/softaes/$(DEPDIR)/$(am__dirstamp) crypto_generichash/$(am__dirstamp): @$(MKDIR_P) crypto_generichash @: > crypto_generichash/$(am__dirstamp) @@ -1452,6 +1604,18 @@ crypto_kdf/$(DEPDIR)/$(am__dirstamp): @: > crypto_kdf/$(DEPDIR)/$(am__dirstamp) crypto_kdf/libsodium_la-crypto_kdf.lo: crypto_kdf/$(am__dirstamp) \ crypto_kdf/$(DEPDIR)/$(am__dirstamp) +crypto_kdf/hkdf/$(am__dirstamp): + @$(MKDIR_P) crypto_kdf/hkdf + @: > crypto_kdf/hkdf/$(am__dirstamp) +crypto_kdf/hkdf/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_kdf/hkdf/$(DEPDIR) + @: > crypto_kdf/hkdf/$(DEPDIR)/$(am__dirstamp) +crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo: \ + crypto_kdf/hkdf/$(am__dirstamp) \ + crypto_kdf/hkdf/$(DEPDIR)/$(am__dirstamp) +crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo: \ + crypto_kdf/hkdf/$(am__dirstamp) \ + crypto_kdf/hkdf/$(DEPDIR)/$(am__dirstamp) crypto_kx/$(am__dirstamp): @$(MKDIR_P) crypto_kx @: > crypto_kx/$(am__dirstamp) @@ -1678,15 +1842,14 @@ crypto_stream/xsalsa20/$(DEPDIR)/$(am__dirstamp): crypto_stream/xsalsa20/libsodium_la-stream_xsalsa20.lo: \ crypto_stream/xsalsa20/$(am__dirstamp) \ crypto_stream/xsalsa20/$(DEPDIR)/$(am__dirstamp) -crypto_verify/sodium/$(am__dirstamp): - @$(MKDIR_P) crypto_verify/sodium - @: > crypto_verify/sodium/$(am__dirstamp) -crypto_verify/sodium/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) crypto_verify/sodium/$(DEPDIR) - @: > crypto_verify/sodium/$(DEPDIR)/$(am__dirstamp) -crypto_verify/sodium/libsodium_la-verify.lo: \ - crypto_verify/sodium/$(am__dirstamp) \ - crypto_verify/sodium/$(DEPDIR)/$(am__dirstamp) +crypto_verify/$(am__dirstamp): + @$(MKDIR_P) crypto_verify + @: > crypto_verify/$(am__dirstamp) +crypto_verify/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) crypto_verify/$(DEPDIR) + @: > crypto_verify/$(DEPDIR)/$(am__dirstamp) +crypto_verify/libsodium_la-verify.lo: crypto_verify/$(am__dirstamp) \ + crypto_verify/$(DEPDIR)/$(am__dirstamp) randombytes/$(am__dirstamp): @$(MKDIR_P) randombytes @: > randombytes/$(am__dirstamp) @@ -1939,12 +2102,20 @@ libssse3.la: $(libssse3_la_OBJECTS) $(libssse3_la_DEPENDENCIES) $(EXTRA_libssse3 mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f crypto_aead/aegis128l/*.$(OBJEXT) + -rm -f crypto_aead/aegis128l/*.lo + -rm -f crypto_aead/aegis256/*.$(OBJEXT) + -rm -f crypto_aead/aegis256/*.lo + -rm -f crypto_aead/aes256gcm/*.$(OBJEXT) + -rm -f crypto_aead/aes256gcm/*.lo -rm -f crypto_aead/aes256gcm/aesni/*.$(OBJEXT) -rm -f crypto_aead/aes256gcm/aesni/*.lo - -rm -f crypto_aead/chacha20poly1305/sodium/*.$(OBJEXT) - -rm -f crypto_aead/chacha20poly1305/sodium/*.lo - -rm -f crypto_aead/xchacha20poly1305/sodium/*.$(OBJEXT) - -rm -f crypto_aead/xchacha20poly1305/sodium/*.lo + -rm -f crypto_aead/aes256gcm/armcrypto/*.$(OBJEXT) + -rm -f crypto_aead/aes256gcm/armcrypto/*.lo + -rm -f crypto_aead/chacha20poly1305/*.$(OBJEXT) + -rm -f crypto_aead/chacha20poly1305/*.lo + -rm -f crypto_aead/xchacha20poly1305/*.$(OBJEXT) + -rm -f crypto_aead/xchacha20poly1305/*.lo -rm -f crypto_auth/*.$(OBJEXT) -rm -f crypto_auth/*.lo -rm -f crypto_auth/hmacsha256/*.$(OBJEXT) @@ -1971,6 +2142,8 @@ mostlyclean-compile: -rm -f crypto_core/hsalsa20/ref2/*.lo -rm -f crypto_core/salsa/ref/*.$(OBJEXT) -rm -f crypto_core/salsa/ref/*.lo + -rm -f crypto_core/softaes/*.$(OBJEXT) + -rm -f crypto_core/softaes/*.lo -rm -f crypto_generichash/*.$(OBJEXT) -rm -f crypto_generichash/*.lo -rm -f crypto_generichash/blake2b/*.$(OBJEXT) @@ -1991,6 +2164,8 @@ mostlyclean-compile: -rm -f crypto_kdf/*.lo -rm -f crypto_kdf/blake2b/*.$(OBJEXT) -rm -f crypto_kdf/blake2b/*.lo + -rm -f crypto_kdf/hkdf/*.$(OBJEXT) + -rm -f crypto_kdf/hkdf/*.lo -rm -f crypto_kx/*.$(OBJEXT) -rm -f crypto_kx/*.lo -rm -f crypto_onetimeauth/*.$(OBJEXT) @@ -2071,8 +2246,8 @@ mostlyclean-compile: -rm -f crypto_stream/xchacha20/*.lo -rm -f crypto_stream/xsalsa20/*.$(OBJEXT) -rm -f crypto_stream/xsalsa20/*.lo - -rm -f crypto_verify/sodium/*.$(OBJEXT) - -rm -f crypto_verify/sodium/*.lo + -rm -f crypto_verify/*.$(OBJEXT) + -rm -f crypto_verify/*.lo -rm -f randombytes/*.$(OBJEXT) -rm -f randombytes/*.lo -rm -f randombytes/internal/*.$(OBJEXT) @@ -2085,9 +2260,19 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_auth/$(DEPDIR)/libsodium_la-crypto_auth.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_auth/hmacsha256/$(DEPDIR)/libsodium_la-auth_hmacsha256.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_auth/hmacsha512/$(DEPDIR)/libsodium_la-auth_hmacsha512.Plo@am__quote@ # am--include-marker @@ -2105,6 +2290,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@crypto_core/hsalsa20/$(DEPDIR)/libsodium_la-core_hsalsa20.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_core/hsalsa20/ref2/$(DEPDIR)/libsodium_la-core_hsalsa20_ref2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_core/salsa/ref/$(DEPDIR)/libsodium_la-core_salsa_ref.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_generichash/blake2b/$(DEPDIR)/libsodium_la-generichash_blake2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Plo@am__quote@ # am--include-marker @@ -2120,6 +2306,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@crypto_hash/sha512/cp/$(DEPDIR)/libsodium_la-hash_sha512_cp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_kdf/$(DEPDIR)/libsodium_la-crypto_kdf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_kdf/blake2b/$(DEPDIR)/libsodium_la-kdf_blake2b.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_onetimeauth/$(DEPDIR)/libsodium_la-crypto_onetimeauth.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_onetimeauth/poly1305/$(DEPDIR)/libsodium_la-onetimeauth_poly1305.Plo@am__quote@ # am--include-marker @@ -2184,7 +2372,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@crypto_stream/salsa208/ref/$(DEPDIR)/libsodium_la-stream_salsa208_ref.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_stream/xchacha20/$(DEPDIR)/libsodium_la-stream_xchacha20.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@crypto_stream/xsalsa20/$(DEPDIR)/libsodium_la-stream_xsalsa20.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@crypto_verify/$(DEPDIR)/libsodium_la-verify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@randombytes/$(DEPDIR)/libsodium_la-randombytes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@randombytes/internal/$(DEPDIR)/librdrand_la-randombytes_internal_random.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@randombytes/sysrandom/$(DEPDIR)/libsodium_la-randombytes_sysrandom.Plo@am__quote@ # am--include-marker @@ -2262,6 +2450,20 @@ crypto_scalarmult/curve25519/sandy2x/libsodium_la-sandy2x.lo: crypto_scalarmult/ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo: crypto_aead/aegis128l/aegis128l_aesni.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo -MD -MP -MF crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Tpo -c -o crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo `test -f 'crypto_aead/aegis128l/aegis128l_aesni.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_aesni.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Tpo crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis128l/aegis128l_aesni.c' object='crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis128l/libaesni_la-aegis128l_aesni.lo `test -f 'crypto_aead/aegis128l/aegis128l_aesni.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_aesni.c + +crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo: crypto_aead/aegis256/aegis256_aesni.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo -MD -MP -MF crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Tpo -c -o crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo `test -f 'crypto_aead/aegis256/aegis256_aesni.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_aesni.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Tpo crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis256/aegis256_aesni.c' object='crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis256/libaesni_la-aegis256_aesni.lo `test -f 'crypto_aead/aegis256/aegis256_aesni.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_aesni.c + crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo: crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo -MD -MP -MF crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Tpo -c -o crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo `test -f 'crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Tpo crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo @@ -2269,6 +2471,27 @@ crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo: crypto_aead/aes @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaesni_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aes256gcm/aesni/libaesni_la-aead_aes256gcm_aesni.lo `test -f 'crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo: crypto_aead/aegis128l/aegis128l_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo -MD -MP -MF crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Tpo -c -o crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo `test -f 'crypto_aead/aegis128l/aegis128l_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Tpo crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis128l/aegis128l_armcrypto.c' object='crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis128l/libarmcrypto_la-aegis128l_armcrypto.lo `test -f 'crypto_aead/aegis128l/aegis128l_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_armcrypto.c + +crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo: crypto_aead/aegis256/aegis256_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo -MD -MP -MF crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Tpo -c -o crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo `test -f 'crypto_aead/aegis256/aegis256_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Tpo crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis256/aegis256_armcrypto.c' object='crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis256/libarmcrypto_la-aegis256_armcrypto.lo `test -f 'crypto_aead/aegis256/aegis256_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_armcrypto.c + +crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo: crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo -MD -MP -MF crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Tpo -c -o crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo `test -f 'crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Tpo crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c' object='crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarmcrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aes256gcm/armcrypto/libarmcrypto_la-aead_aes256gcm_armcrypto.lo `test -f 'crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c + crypto_generichash/blake2b/ref/libavx2_la-blake2b-compress-avx2.lo: crypto_generichash/blake2b/ref/blake2b-compress-avx2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavx2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_generichash/blake2b/ref/libavx2_la-blake2b-compress-avx2.lo -MD -MP -MF crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Tpo -c -o crypto_generichash/blake2b/ref/libavx2_la-blake2b-compress-avx2.lo `test -f 'crypto_generichash/blake2b/ref/blake2b-compress-avx2.c' || echo '$(srcdir)/'`crypto_generichash/blake2b/ref/blake2b-compress-avx2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Tpo crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Plo @@ -2311,19 +2534,54 @@ randombytes/internal/librdrand_la-randombytes_internal_random.lo: randombytes/in @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librdrand_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o randombytes/internal/librdrand_la-randombytes_internal_random.lo `test -f 'randombytes/internal/randombytes_internal_random.c' || echo '$(srcdir)/'`randombytes/internal/randombytes_internal_random.c -crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo: crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo -MD -MP -MF crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Tpo -c -o crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo `test -f 'crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Tpo crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c' object='crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo' libtool=yes @AMDEPBACKSLASH@ +crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo: crypto_aead/aegis128l/aead_aegis128l.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo -MD -MP -MF crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Tpo -c -o crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo `test -f 'crypto_aead/aegis128l/aead_aegis128l.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aead_aegis128l.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Tpo crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis128l/aead_aegis128l.c' object='crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis128l/libsodium_la-aead_aegis128l.lo `test -f 'crypto_aead/aegis128l/aead_aegis128l.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aead_aegis128l.c + +crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo: crypto_aead/aegis128l/aegis128l_soft.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo -MD -MP -MF crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Tpo -c -o crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo `test -f 'crypto_aead/aegis128l/aegis128l_soft.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_soft.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Tpo crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis128l/aegis128l_soft.c' object='crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/chacha20poly1305/sodium/libsodium_la-aead_chacha20poly1305.lo `test -f 'crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis128l/libsodium_la-aegis128l_soft.lo `test -f 'crypto_aead/aegis128l/aegis128l_soft.c' || echo '$(srcdir)/'`crypto_aead/aegis128l/aegis128l_soft.c -crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo: crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo -MD -MP -MF crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Tpo -c -o crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo `test -f 'crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Tpo crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c' object='crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo' libtool=yes @AMDEPBACKSLASH@ +crypto_aead/aegis256/libsodium_la-aead_aegis256.lo: crypto_aead/aegis256/aead_aegis256.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis256/libsodium_la-aead_aegis256.lo -MD -MP -MF crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Tpo -c -o crypto_aead/aegis256/libsodium_la-aead_aegis256.lo `test -f 'crypto_aead/aegis256/aead_aegis256.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aead_aegis256.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Tpo crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis256/aead_aegis256.c' object='crypto_aead/aegis256/libsodium_la-aead_aegis256.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/xchacha20poly1305/sodium/libsodium_la-aead_xchacha20poly1305.lo `test -f 'crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis256/libsodium_la-aead_aegis256.lo `test -f 'crypto_aead/aegis256/aead_aegis256.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aead_aegis256.c + +crypto_aead/aegis256/libsodium_la-aegis256_soft.lo: crypto_aead/aegis256/aegis256_soft.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aegis256/libsodium_la-aegis256_soft.lo -MD -MP -MF crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Tpo -c -o crypto_aead/aegis256/libsodium_la-aegis256_soft.lo `test -f 'crypto_aead/aegis256/aegis256_soft.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_soft.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Tpo crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aegis256/aegis256_soft.c' object='crypto_aead/aegis256/libsodium_la-aegis256_soft.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aegis256/libsodium_la-aegis256_soft.lo `test -f 'crypto_aead/aegis256/aegis256_soft.c' || echo '$(srcdir)/'`crypto_aead/aegis256/aegis256_soft.c + +crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo: crypto_aead/aes256gcm/aead_aes256gcm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo -MD -MP -MF crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Tpo -c -o crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo `test -f 'crypto_aead/aes256gcm/aead_aes256gcm.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/aead_aes256gcm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Tpo crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/aes256gcm/aead_aes256gcm.c' object='crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/aes256gcm/libsodium_la-aead_aes256gcm.lo `test -f 'crypto_aead/aes256gcm/aead_aes256gcm.c' || echo '$(srcdir)/'`crypto_aead/aes256gcm/aead_aes256gcm.c + +crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo: crypto_aead/chacha20poly1305/aead_chacha20poly1305.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo -MD -MP -MF crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Tpo -c -o crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo `test -f 'crypto_aead/chacha20poly1305/aead_chacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/chacha20poly1305/aead_chacha20poly1305.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Tpo crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/chacha20poly1305/aead_chacha20poly1305.c' object='crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/chacha20poly1305/libsodium_la-aead_chacha20poly1305.lo `test -f 'crypto_aead/chacha20poly1305/aead_chacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/chacha20poly1305/aead_chacha20poly1305.c + +crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo: crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo -MD -MP -MF crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Tpo -c -o crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo `test -f 'crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Tpo crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c' object='crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_aead/xchacha20poly1305/libsodium_la-aead_xchacha20poly1305.lo `test -f 'crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c' || echo '$(srcdir)/'`crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c crypto_auth/libsodium_la-crypto_auth.lo: crypto_auth/crypto_auth.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_auth/libsodium_la-crypto_auth.lo -MD -MP -MF crypto_auth/$(DEPDIR)/libsodium_la-crypto_auth.Tpo -c -o crypto_auth/libsodium_la-crypto_auth.lo `test -f 'crypto_auth/crypto_auth.c' || echo '$(srcdir)/'`crypto_auth/crypto_auth.c @@ -2416,6 +2674,13 @@ crypto_core/salsa/ref/libsodium_la-core_salsa_ref.lo: crypto_core/salsa/ref/core @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_core/salsa/ref/libsodium_la-core_salsa_ref.lo `test -f 'crypto_core/salsa/ref/core_salsa_ref.c' || echo '$(srcdir)/'`crypto_core/salsa/ref/core_salsa_ref.c +crypto_core/softaes/libsodium_la-softaes.lo: crypto_core/softaes/softaes.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_core/softaes/libsodium_la-softaes.lo -MD -MP -MF crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Tpo -c -o crypto_core/softaes/libsodium_la-softaes.lo `test -f 'crypto_core/softaes/softaes.c' || echo '$(srcdir)/'`crypto_core/softaes/softaes.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Tpo crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_core/softaes/softaes.c' object='crypto_core/softaes/libsodium_la-softaes.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_core/softaes/libsodium_la-softaes.lo `test -f 'crypto_core/softaes/softaes.c' || echo '$(srcdir)/'`crypto_core/softaes/softaes.c + crypto_generichash/libsodium_la-crypto_generichash.lo: crypto_generichash/crypto_generichash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_generichash/libsodium_la-crypto_generichash.lo -MD -MP -MF crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Tpo -c -o crypto_generichash/libsodium_la-crypto_generichash.lo `test -f 'crypto_generichash/crypto_generichash.c' || echo '$(srcdir)/'`crypto_generichash/crypto_generichash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Tpo crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Plo @@ -2500,6 +2765,20 @@ crypto_kdf/libsodium_la-crypto_kdf.lo: crypto_kdf/crypto_kdf.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_kdf/libsodium_la-crypto_kdf.lo `test -f 'crypto_kdf/crypto_kdf.c' || echo '$(srcdir)/'`crypto_kdf/crypto_kdf.c +crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo: crypto_kdf/hkdf/kdf_hkdf_sha256.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo -MD -MP -MF crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Tpo -c -o crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo `test -f 'crypto_kdf/hkdf/kdf_hkdf_sha256.c' || echo '$(srcdir)/'`crypto_kdf/hkdf/kdf_hkdf_sha256.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Tpo crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_kdf/hkdf/kdf_hkdf_sha256.c' object='crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha256.lo `test -f 'crypto_kdf/hkdf/kdf_hkdf_sha256.c' || echo '$(srcdir)/'`crypto_kdf/hkdf/kdf_hkdf_sha256.c + +crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo: crypto_kdf/hkdf/kdf_hkdf_sha512.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo -MD -MP -MF crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Tpo -c -o crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo `test -f 'crypto_kdf/hkdf/kdf_hkdf_sha512.c' || echo '$(srcdir)/'`crypto_kdf/hkdf/kdf_hkdf_sha512.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Tpo crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_kdf/hkdf/kdf_hkdf_sha512.c' object='crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_kdf/hkdf/libsodium_la-kdf_hkdf_sha512.lo `test -f 'crypto_kdf/hkdf/kdf_hkdf_sha512.c' || echo '$(srcdir)/'`crypto_kdf/hkdf/kdf_hkdf_sha512.c + crypto_kx/libsodium_la-crypto_kx.lo: crypto_kx/crypto_kx.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_kx/libsodium_la-crypto_kx.lo -MD -MP -MF crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Tpo -c -o crypto_kx/libsodium_la-crypto_kx.lo `test -f 'crypto_kx/crypto_kx.c' || echo '$(srcdir)/'`crypto_kx/crypto_kx.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Tpo crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Plo @@ -2724,12 +3003,12 @@ crypto_stream/xsalsa20/libsodium_la-stream_xsalsa20.lo: crypto_stream/xsalsa20/s @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_stream/xsalsa20/libsodium_la-stream_xsalsa20.lo `test -f 'crypto_stream/xsalsa20/stream_xsalsa20.c' || echo '$(srcdir)/'`crypto_stream/xsalsa20/stream_xsalsa20.c -crypto_verify/sodium/libsodium_la-verify.lo: crypto_verify/sodium/verify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_verify/sodium/libsodium_la-verify.lo -MD -MP -MF crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Tpo -c -o crypto_verify/sodium/libsodium_la-verify.lo `test -f 'crypto_verify/sodium/verify.c' || echo '$(srcdir)/'`crypto_verify/sodium/verify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Tpo crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_verify/sodium/verify.c' object='crypto_verify/sodium/libsodium_la-verify.lo' libtool=yes @AMDEPBACKSLASH@ +crypto_verify/libsodium_la-verify.lo: crypto_verify/verify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT crypto_verify/libsodium_la-verify.lo -MD -MP -MF crypto_verify/$(DEPDIR)/libsodium_la-verify.Tpo -c -o crypto_verify/libsodium_la-verify.lo `test -f 'crypto_verify/verify.c' || echo '$(srcdir)/'`crypto_verify/verify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) crypto_verify/$(DEPDIR)/libsodium_la-verify.Tpo crypto_verify/$(DEPDIR)/libsodium_la-verify.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto_verify/verify.c' object='crypto_verify/libsodium_la-verify.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_verify/sodium/libsodium_la-verify.lo `test -f 'crypto_verify/sodium/verify.c' || echo '$(srcdir)/'`crypto_verify/sodium/verify.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o crypto_verify/libsodium_la-verify.lo `test -f 'crypto_verify/verify.c' || echo '$(srcdir)/'`crypto_verify/verify.c randombytes/libsodium_la-randombytes.lo: randombytes/randombytes.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsodium_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT randombytes/libsodium_la-randombytes.lo -MD -MP -MF randombytes/$(DEPDIR)/libsodium_la-randombytes.Tpo -c -o randombytes/libsodium_la-randombytes.lo `test -f 'randombytes/randombytes.c' || echo '$(srcdir)/'`randombytes/randombytes.c @@ -3009,9 +3288,13 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs + -rm -rf crypto_aead/aegis128l/.libs crypto_aead/aegis128l/_libs + -rm -rf crypto_aead/aegis256/.libs crypto_aead/aegis256/_libs + -rm -rf crypto_aead/aes256gcm/.libs crypto_aead/aes256gcm/_libs -rm -rf crypto_aead/aes256gcm/aesni/.libs crypto_aead/aes256gcm/aesni/_libs - -rm -rf crypto_aead/chacha20poly1305/sodium/.libs crypto_aead/chacha20poly1305/sodium/_libs - -rm -rf crypto_aead/xchacha20poly1305/sodium/.libs crypto_aead/xchacha20poly1305/sodium/_libs + -rm -rf crypto_aead/aes256gcm/armcrypto/.libs crypto_aead/aes256gcm/armcrypto/_libs + -rm -rf crypto_aead/chacha20poly1305/.libs crypto_aead/chacha20poly1305/_libs + -rm -rf crypto_aead/xchacha20poly1305/.libs crypto_aead/xchacha20poly1305/_libs -rm -rf crypto_auth/.libs crypto_auth/_libs -rm -rf crypto_auth/hmacsha256/.libs crypto_auth/hmacsha256/_libs -rm -rf crypto_auth/hmacsha512/.libs crypto_auth/hmacsha512/_libs @@ -3025,6 +3308,7 @@ clean-libtool: -rm -rf crypto_core/hsalsa20/.libs crypto_core/hsalsa20/_libs -rm -rf crypto_core/hsalsa20/ref2/.libs crypto_core/hsalsa20/ref2/_libs -rm -rf crypto_core/salsa/ref/.libs crypto_core/salsa/ref/_libs + -rm -rf crypto_core/softaes/.libs crypto_core/softaes/_libs -rm -rf crypto_generichash/.libs crypto_generichash/_libs -rm -rf crypto_generichash/blake2b/.libs crypto_generichash/blake2b/_libs -rm -rf crypto_generichash/blake2b/ref/.libs crypto_generichash/blake2b/ref/_libs @@ -3035,6 +3319,7 @@ clean-libtool: -rm -rf crypto_hash/sha512/cp/.libs crypto_hash/sha512/cp/_libs -rm -rf crypto_kdf/.libs crypto_kdf/_libs -rm -rf crypto_kdf/blake2b/.libs crypto_kdf/blake2b/_libs + -rm -rf crypto_kdf/hkdf/.libs crypto_kdf/hkdf/_libs -rm -rf crypto_kx/.libs crypto_kx/_libs -rm -rf crypto_onetimeauth/.libs crypto_onetimeauth/_libs -rm -rf crypto_onetimeauth/poly1305/.libs crypto_onetimeauth/poly1305/_libs @@ -3075,7 +3360,7 @@ clean-libtool: -rm -rf crypto_stream/salsa208/ref/.libs crypto_stream/salsa208/ref/_libs -rm -rf crypto_stream/xchacha20/.libs crypto_stream/xchacha20/_libs -rm -rf crypto_stream/xsalsa20/.libs crypto_stream/xsalsa20/_libs - -rm -rf crypto_verify/sodium/.libs crypto_verify/sodium/_libs + -rm -rf crypto_verify/.libs crypto_verify/_libs -rm -rf randombytes/.libs randombytes/_libs -rm -rf randombytes/internal/.libs randombytes/internal/_libs -rm -rf randombytes/sysrandom/.libs randombytes/sysrandom/_libs @@ -3200,7 +3485,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -3294,12 +3578,20 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f crypto_aead/aegis128l/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/aegis128l/$(am__dirstamp) + -rm -f crypto_aead/aegis256/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/aegis256/$(am__dirstamp) + -rm -f crypto_aead/aes256gcm/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/aes256gcm/$(am__dirstamp) -rm -f crypto_aead/aes256gcm/aesni/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_aead/aes256gcm/aesni/$(am__dirstamp) - -rm -f crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) - -rm -f crypto_aead/chacha20poly1305/sodium/$(am__dirstamp) - -rm -f crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/$(am__dirstamp) - -rm -f crypto_aead/xchacha20poly1305/sodium/$(am__dirstamp) + -rm -f crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/aes256gcm/armcrypto/$(am__dirstamp) + -rm -f crypto_aead/chacha20poly1305/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/chacha20poly1305/$(am__dirstamp) + -rm -f crypto_aead/xchacha20poly1305/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_aead/xchacha20poly1305/$(am__dirstamp) -rm -f crypto_auth/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_auth/$(am__dirstamp) -rm -f crypto_auth/hmacsha256/$(DEPDIR)/$(am__dirstamp) @@ -3326,6 +3618,8 @@ distclean-generic: -rm -f crypto_core/hsalsa20/ref2/$(am__dirstamp) -rm -f crypto_core/salsa/ref/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_core/salsa/ref/$(am__dirstamp) + -rm -f crypto_core/softaes/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_core/softaes/$(am__dirstamp) -rm -f crypto_generichash/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_generichash/$(am__dirstamp) -rm -f crypto_generichash/blake2b/$(DEPDIR)/$(am__dirstamp) @@ -3346,6 +3640,8 @@ distclean-generic: -rm -f crypto_kdf/$(am__dirstamp) -rm -f crypto_kdf/blake2b/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_kdf/blake2b/$(am__dirstamp) + -rm -f crypto_kdf/hkdf/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_kdf/hkdf/$(am__dirstamp) -rm -f crypto_kx/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_kx/$(am__dirstamp) -rm -f crypto_onetimeauth/$(DEPDIR)/$(am__dirstamp) @@ -3426,8 +3722,8 @@ distclean-generic: -rm -f crypto_stream/xchacha20/$(am__dirstamp) -rm -f crypto_stream/xsalsa20/$(DEPDIR)/$(am__dirstamp) -rm -f crypto_stream/xsalsa20/$(am__dirstamp) - -rm -f crypto_verify/sodium/$(DEPDIR)/$(am__dirstamp) - -rm -f crypto_verify/sodium/$(am__dirstamp) + -rm -f crypto_verify/$(DEPDIR)/$(am__dirstamp) + -rm -f crypto_verify/$(am__dirstamp) -rm -f randombytes/$(DEPDIR)/$(am__dirstamp) -rm -f randombytes/$(am__dirstamp) -rm -f randombytes/internal/$(DEPDIR)/$(am__dirstamp) @@ -3446,9 +3742,19 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive - -rm -f crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo - -rm -f crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo - -rm -f crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Plo + -rm -f crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Plo + -rm -f crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo + -rm -f crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Plo + -rm -f crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo + -rm -f crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo -rm -f crypto_auth/$(DEPDIR)/libsodium_la-crypto_auth.Plo -rm -f crypto_auth/hmacsha256/$(DEPDIR)/libsodium_la-auth_hmacsha256.Plo -rm -f crypto_auth/hmacsha512/$(DEPDIR)/libsodium_la-auth_hmacsha512.Plo @@ -3466,6 +3772,7 @@ distclean: distclean-recursive -rm -f crypto_core/hsalsa20/$(DEPDIR)/libsodium_la-core_hsalsa20.Plo -rm -f crypto_core/hsalsa20/ref2/$(DEPDIR)/libsodium_la-core_hsalsa20_ref2.Plo -rm -f crypto_core/salsa/ref/$(DEPDIR)/libsodium_la-core_salsa_ref.Plo + -rm -f crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Plo -rm -f crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Plo -rm -f crypto_generichash/blake2b/$(DEPDIR)/libsodium_la-generichash_blake2.Plo -rm -f crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Plo @@ -3481,6 +3788,8 @@ distclean: distclean-recursive -rm -f crypto_hash/sha512/cp/$(DEPDIR)/libsodium_la-hash_sha512_cp.Plo -rm -f crypto_kdf/$(DEPDIR)/libsodium_la-crypto_kdf.Plo -rm -f crypto_kdf/blake2b/$(DEPDIR)/libsodium_la-kdf_blake2b.Plo + -rm -f crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Plo + -rm -f crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Plo -rm -f crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Plo -rm -f crypto_onetimeauth/$(DEPDIR)/libsodium_la-crypto_onetimeauth.Plo -rm -f crypto_onetimeauth/poly1305/$(DEPDIR)/libsodium_la-onetimeauth_poly1305.Plo @@ -3545,7 +3854,7 @@ distclean: distclean-recursive -rm -f crypto_stream/salsa208/ref/$(DEPDIR)/libsodium_la-stream_salsa208_ref.Plo -rm -f crypto_stream/xchacha20/$(DEPDIR)/libsodium_la-stream_xchacha20.Plo -rm -f crypto_stream/xsalsa20/$(DEPDIR)/libsodium_la-stream_xsalsa20.Plo - -rm -f crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Plo + -rm -f crypto_verify/$(DEPDIR)/libsodium_la-verify.Plo -rm -f randombytes/$(DEPDIR)/libsodium_la-randombytes.Plo -rm -f randombytes/internal/$(DEPDIR)/librdrand_la-randombytes_internal_random.Plo -rm -f randombytes/sysrandom/$(DEPDIR)/libsodium_la-randombytes_sysrandom.Plo @@ -3599,9 +3908,19 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo - -rm -f crypto_aead/chacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo - -rm -f crypto_aead/xchacha20poly1305/sodium/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libaesni_la-aegis128l_aesni.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libarmcrypto_la-aegis128l_armcrypto.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aead_aegis128l.Plo + -rm -f crypto_aead/aegis128l/$(DEPDIR)/libsodium_la-aegis128l_soft.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libaesni_la-aegis256_aesni.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libarmcrypto_la-aegis256_armcrypto.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aead_aegis256.Plo + -rm -f crypto_aead/aegis256/$(DEPDIR)/libsodium_la-aegis256_soft.Plo + -rm -f crypto_aead/aes256gcm/$(DEPDIR)/libsodium_la-aead_aes256gcm.Plo + -rm -f crypto_aead/aes256gcm/aesni/$(DEPDIR)/libaesni_la-aead_aes256gcm_aesni.Plo + -rm -f crypto_aead/aes256gcm/armcrypto/$(DEPDIR)/libarmcrypto_la-aead_aes256gcm_armcrypto.Plo + -rm -f crypto_aead/chacha20poly1305/$(DEPDIR)/libsodium_la-aead_chacha20poly1305.Plo + -rm -f crypto_aead/xchacha20poly1305/$(DEPDIR)/libsodium_la-aead_xchacha20poly1305.Plo -rm -f crypto_auth/$(DEPDIR)/libsodium_la-crypto_auth.Plo -rm -f crypto_auth/hmacsha256/$(DEPDIR)/libsodium_la-auth_hmacsha256.Plo -rm -f crypto_auth/hmacsha512/$(DEPDIR)/libsodium_la-auth_hmacsha512.Plo @@ -3619,6 +3938,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f crypto_core/hsalsa20/$(DEPDIR)/libsodium_la-core_hsalsa20.Plo -rm -f crypto_core/hsalsa20/ref2/$(DEPDIR)/libsodium_la-core_hsalsa20_ref2.Plo -rm -f crypto_core/salsa/ref/$(DEPDIR)/libsodium_la-core_salsa_ref.Plo + -rm -f crypto_core/softaes/$(DEPDIR)/libsodium_la-softaes.Plo -rm -f crypto_generichash/$(DEPDIR)/libsodium_la-crypto_generichash.Plo -rm -f crypto_generichash/blake2b/$(DEPDIR)/libsodium_la-generichash_blake2.Plo -rm -f crypto_generichash/blake2b/ref/$(DEPDIR)/libavx2_la-blake2b-compress-avx2.Plo @@ -3634,6 +3954,8 @@ maintainer-clean: maintainer-clean-recursive -rm -f crypto_hash/sha512/cp/$(DEPDIR)/libsodium_la-hash_sha512_cp.Plo -rm -f crypto_kdf/$(DEPDIR)/libsodium_la-crypto_kdf.Plo -rm -f crypto_kdf/blake2b/$(DEPDIR)/libsodium_la-kdf_blake2b.Plo + -rm -f crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha256.Plo + -rm -f crypto_kdf/hkdf/$(DEPDIR)/libsodium_la-kdf_hkdf_sha512.Plo -rm -f crypto_kx/$(DEPDIR)/libsodium_la-crypto_kx.Plo -rm -f crypto_onetimeauth/$(DEPDIR)/libsodium_la-crypto_onetimeauth.Plo -rm -f crypto_onetimeauth/poly1305/$(DEPDIR)/libsodium_la-onetimeauth_poly1305.Plo @@ -3698,7 +4020,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f crypto_stream/salsa208/ref/$(DEPDIR)/libsodium_la-stream_salsa208_ref.Plo -rm -f crypto_stream/xchacha20/$(DEPDIR)/libsodium_la-stream_xchacha20.Plo -rm -f crypto_stream/xsalsa20/$(DEPDIR)/libsodium_la-stream_xsalsa20.Plo - -rm -f crypto_verify/sodium/$(DEPDIR)/libsodium_la-verify.Plo + -rm -f crypto_verify/$(DEPDIR)/libsodium_la-verify.Plo -rm -f randombytes/$(DEPDIR)/libsodium_la-randombytes.Plo -rm -f randombytes/internal/$(DEPDIR)/librdrand_la-randombytes_internal_random.Plo -rm -f randombytes/sysrandom/$(DEPDIR)/libsodium_la-randombytes_sysrandom.Plo diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c new file mode 100644 index 000000000..ab2596e68 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c @@ -0,0 +1,159 @@ + +#include +#include + +#include "core.h" +#include "crypto_aead_aegis128l.h" +#include "private/common.h" +#include "private/implementations.h" +#include "randombytes.h" +#include "runtime.h" + +#include "aegis128l_soft.h" + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) +#include "aegis128l_armcrypto.h" +#endif + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) +#include "aegis128l_aesni.h" +#endif + +static const aegis128l_implementation *implementation = &aegis128l_soft_implementation; + +size_t +crypto_aead_aegis128l_keybytes(void) +{ + return crypto_aead_aegis128l_KEYBYTES; +} + +size_t +crypto_aead_aegis128l_nsecbytes(void) +{ + return crypto_aead_aegis128l_NSECBYTES; +} + +size_t +crypto_aead_aegis128l_npubbytes(void) +{ + return crypto_aead_aegis128l_NPUBBYTES; +} + +size_t +crypto_aead_aegis128l_abytes(void) +{ + return crypto_aead_aegis128l_ABYTES; +} + +size_t +crypto_aead_aegis128l_messagebytes_max(void) +{ + return crypto_aead_aegis128l_MESSAGEBYTES_MAX; +} + +void +crypto_aead_aegis128l_keygen(unsigned char k[crypto_aead_aegis128l_KEYBYTES]) +{ + randombytes_buf(k, crypto_aead_aegis128l_KEYBYTES); +} + +int +crypto_aead_aegis128l_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + unsigned long long clen = 0ULL; + int ret; + + ret = crypto_aead_aegis128l_encrypt_detached(c, c + mlen, NULL, m, mlen, ad, adlen, nsec, npub, + k); + if (clen_p != NULL) { + if (ret == 0) { + clen = mlen + crypto_aead_aegis128l_ABYTES; + } + *clen_p = clen; + } + return ret; +} + +int +crypto_aead_aegis128l_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) +{ + unsigned long long mlen = 0ULL; + int ret = -1; + + if (clen >= crypto_aead_aegis128l_ABYTES) { + ret = crypto_aead_aegis128l_decrypt_detached( + m, nsec, c, clen - crypto_aead_aegis128l_ABYTES, + c + clen - crypto_aead_aegis128l_ABYTES, ad, adlen, npub, k); + } + if (mlen_p != NULL) { + if (ret == 0) { + mlen = clen - crypto_aead_aegis128l_ABYTES; + } + *mlen_p = mlen; + } + return ret; +} + +int +crypto_aead_aegis128l_encrypt_detached(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + const size_t maclen = crypto_aead_aegis128l_ABYTES; + + if (maclen_p != NULL) { + *maclen_p = maclen; + } + if (mlen > crypto_aead_aegis128l_MESSAGEBYTES_MAX || + adlen > crypto_aead_aegis128l_MESSAGEBYTES_MAX) { + sodium_misuse(); + } + return implementation->encrypt_detached(c, mac, maclen, m, (size_t) mlen, ad, (size_t) adlen, + npub, k); +} + +int +crypto_aead_aegis128l_decrypt_detached(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *mac, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const unsigned char *k) +{ + const size_t maclen = crypto_aead_aegis128l_ABYTES; + + if (clen > crypto_aead_aegis128l_MESSAGEBYTES_MAX || + adlen > crypto_aead_aegis128l_MESSAGEBYTES_MAX) { + return -1; + } + return implementation->decrypt_detached(m, c, (size_t) clen, mac, maclen, ad, (size_t) adlen, + npub, k); +} + +int +_crypto_aead_aegis128l_pick_best_implementation(void) +{ + implementation = &aegis128l_soft_implementation; + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) + if (sodium_runtime_has_armcrypto()) { + implementation = &aegis128l_armcrypto_implementation; + return 0; + } +#endif + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) + if (sodium_runtime_has_aesni() & sodium_runtime_has_avx()) { + implementation = &aegis128l_aesni_implementation; + return 0; + } +#endif + return 0; /* LCOV_EXCL_LINE */ +} diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.c b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.c new file mode 100644 index 000000000..93782ce28 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis128l.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) + +#include "aegis128l_aesni.h" + +#ifdef __clang__ +#pragma clang attribute push(__attribute__((target("aes,avx"))), apply_to = function) +#elif defined(__GNUC__) +#pragma GCC target("aes,avx") +#endif + +#include "private/sse2_64_32.h" +#include +#include + +#define AES_BLOCK_LENGTH 16 + +typedef __m128i aes_block_t; +#define AES_BLOCK_XOR(A, B) _mm_xor_si128((A), (B)) +#define AES_BLOCK_AND(A, B) _mm_and_si128((A), (B)) +#define AES_BLOCK_LOAD(A) _mm_loadu_si128((const aes_block_t *) (const void *) (A)) +#define AES_BLOCK_LOAD_64x2(A, B) _mm_set_epi64x((long long) (A), (long long) (B)) +#define AES_BLOCK_STORE(A, B) _mm_storeu_si128((aes_block_t *) (void *) (A), (B)) +#define AES_ENC(A, B) _mm_aesenc_si128((A), (B)) + +static inline void +aegis128l_update(aes_block_t *const state, const aes_block_t d1, const aes_block_t d2) +{ + aes_block_t tmp; + + tmp = state[7]; + state[7] = AES_ENC(state[6], state[7]); + state[6] = AES_ENC(state[5], state[6]); + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_ENC(state[3], state[4]); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_ENC(tmp, state[0]); + + state[0] = AES_BLOCK_XOR(state[0], d1); + state[4] = AES_BLOCK_XOR(state[4], d2); +} + +#include "aegis128l_common.h" + +struct aegis128l_implementation aegis128l_aesni_implementation = { SODIUM_C99(.encrypt_detached =) + encrypt_detached, + SODIUM_C99(.decrypt_detached =) + decrypt_detached }; + +#ifdef __clang__ +#pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.h b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.h new file mode 100644 index 000000000..65e52dab1 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.h @@ -0,0 +1,8 @@ +#ifndef aegis128l_aesni_H +#define aegis128l_aesni_H + +#include "implementations.h" + +extern struct aegis128l_implementation aegis128l_aesni_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c new file mode 100644 index 000000000..a01f60cbe --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis128l.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) + +#include "aegis128l_armcrypto.h" + +#ifndef __ARM_FEATURE_CRYPTO +#define __ARM_FEATURE_CRYPTO 1 +#endif +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + +#include + +#ifdef __clang__ +#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) +#elif defined(__GNUC__) +#pragma GCC target("+simd+crypto") +#endif + +#define AES_BLOCK_LENGTH 16 + +typedef uint8x16_t aes_block_t; +#define AES_BLOCK_XOR(A, B) veorq_u8((A), (B)) +#define AES_BLOCK_AND(A, B) vandq_u8((A), (B)) +#define AES_BLOCK_LOAD(A) vld1q_u8(A) +#define AES_BLOCK_LOAD_64x2(A, B) vreinterpretq_u8_u64(vsetq_lane_u64((A), vmovq_n_u64(B), 1)) +#define AES_BLOCK_STORE(A, B) vst1q_u8((A), (B)) +#define AES_ENC(A, B) veorq_u8(vaesmcq_u8(vaeseq_u8((A), vmovq_n_u8(0))), (B)) + +static inline void +aegis128l_update(aes_block_t *const state, const aes_block_t d1, const aes_block_t d2) +{ + aes_block_t tmp; + + tmp = state[7]; + state[7] = AES_ENC(state[6], state[7]); + state[6] = AES_ENC(state[5], state[6]); + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_BLOCK_XOR(AES_ENC(state[3], state[4]), d2); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_BLOCK_XOR(AES_ENC(tmp, state[0]), d1); +} + +#include "aegis128l_common.h" + +struct aegis128l_implementation aegis128l_armcrypto_implementation = { + SODIUM_C99(.encrypt_detached =) encrypt_detached, + SODIUM_C99(.decrypt_detached =) decrypt_detached +}; + +#ifdef __clang__ +#pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.h b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.h new file mode 100644 index 000000000..41ad43cba --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.h @@ -0,0 +1,8 @@ +#ifndef aegis128l_armcrypto_H +#define aegis128l_armcrypto_H + +#include "implementations.h" + +extern struct aegis128l_implementation aegis128l_armcrypto_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h new file mode 100644 index 000000000..adce6cfa2 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h @@ -0,0 +1,248 @@ +#define RATE 32 + +static void +aegis128l_init(const uint8_t *key, const uint8_t *nonce, aes_block_t *const state) +{ + static CRYPTO_ALIGN(AES_BLOCK_LENGTH) + const uint8_t c0_[AES_BLOCK_LENGTH] = { 0x00, 0x01, 0x01, 0x02, 0x03, 0x05, 0x08, 0x0d, + 0x15, 0x22, 0x37, 0x59, 0x90, 0xe9, 0x79, 0x62 }; + static CRYPTO_ALIGN(AES_BLOCK_LENGTH) + const uint8_t c1_[AES_BLOCK_LENGTH] = { 0xdb, 0x3d, 0x18, 0x55, 0x6d, 0xc2, 0x2f, 0xf1, + 0x20, 0x11, 0x31, 0x42, 0x73, 0xb5, 0x28, 0xdd }; + + const aes_block_t c0 = AES_BLOCK_LOAD(c0_); + const aes_block_t c1 = AES_BLOCK_LOAD(c1_); + aes_block_t k; + aes_block_t n; + int i; + + k = AES_BLOCK_LOAD(key); + n = AES_BLOCK_LOAD(nonce); + + state[0] = AES_BLOCK_XOR(k, n); + state[1] = c1; + state[2] = c0; + state[3] = c1; + state[4] = AES_BLOCK_XOR(k, n); + state[5] = AES_BLOCK_XOR(k, c0); + state[6] = AES_BLOCK_XOR(k, c1); + state[7] = AES_BLOCK_XOR(k, c0); + for (i = 0; i < 10; i++) { + aegis128l_update(state, n, k); + } +} + +static void +aegis128l_mac(uint8_t *mac, size_t maclen, size_t adlen, size_t mlen, aes_block_t *const state) +{ + aes_block_t tmp; + int i; + + tmp = AES_BLOCK_LOAD_64x2(((uint64_t) mlen) << 3, ((uint64_t) adlen) << 3); + tmp = AES_BLOCK_XOR(tmp, state[2]); + + for (i = 0; i < 7; i++) { + aegis128l_update(state, tmp, tmp); + } + + if (maclen == 16) { + tmp = AES_BLOCK_XOR(state[6], AES_BLOCK_XOR(state[5], state[4])); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[3], state[2])); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[1], state[0])); + AES_BLOCK_STORE(mac, tmp); + } else if (maclen == 32) { + tmp = AES_BLOCK_XOR(state[3], state[2]); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[1], state[0])); + AES_BLOCK_STORE(mac, tmp); + tmp = AES_BLOCK_XOR(state[7], state[6]); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[5], state[4])); + AES_BLOCK_STORE(mac + 16, tmp); + } else { + memset(mac, 0, maclen); + } +} + +static inline void +aegis128l_absorb(const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg0, msg1; + + msg0 = AES_BLOCK_LOAD(src); + msg1 = AES_BLOCK_LOAD(src + AES_BLOCK_LENGTH); + aegis128l_update(state, msg0, msg1); +} + +static inline void +aegis128l_absorb2(const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg0, msg1, msg2, msg3; + + msg0 = AES_BLOCK_LOAD(src + 0 * AES_BLOCK_LENGTH); + msg1 = AES_BLOCK_LOAD(src + 1 * AES_BLOCK_LENGTH); + msg2 = AES_BLOCK_LOAD(src + 2 * AES_BLOCK_LENGTH); + msg3 = AES_BLOCK_LOAD(src + 3 * AES_BLOCK_LENGTH); + aegis128l_update(state, msg0, msg1); + aegis128l_update(state, msg2, msg3); +} + +static void +aegis128l_enc(uint8_t *const dst, const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg0, msg1; + aes_block_t tmp0, tmp1; + + msg0 = AES_BLOCK_LOAD(src); + msg1 = AES_BLOCK_LOAD(src + AES_BLOCK_LENGTH); + tmp0 = AES_BLOCK_XOR(msg0, state[6]); + tmp0 = AES_BLOCK_XOR(tmp0, state[1]); + tmp1 = AES_BLOCK_XOR(msg1, state[5]); + tmp1 = AES_BLOCK_XOR(tmp1, state[2]); + tmp0 = AES_BLOCK_XOR(tmp0, AES_BLOCK_AND(state[2], state[3])); + tmp1 = AES_BLOCK_XOR(tmp1, AES_BLOCK_AND(state[6], state[7])); + AES_BLOCK_STORE(dst, tmp0); + AES_BLOCK_STORE(dst + AES_BLOCK_LENGTH, tmp1); + + aegis128l_update(state, msg0, msg1); +} + +static void +aegis128l_dec(uint8_t *const dst, const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg0, msg1; + + msg0 = AES_BLOCK_LOAD(src); + msg1 = AES_BLOCK_LOAD(src + AES_BLOCK_LENGTH); + msg0 = AES_BLOCK_XOR(msg0, state[6]); + msg0 = AES_BLOCK_XOR(msg0, state[1]); + msg1 = AES_BLOCK_XOR(msg1, state[5]); + msg1 = AES_BLOCK_XOR(msg1, state[2]); + msg0 = AES_BLOCK_XOR(msg0, AES_BLOCK_AND(state[2], state[3])); + msg1 = AES_BLOCK_XOR(msg1, AES_BLOCK_AND(state[6], state[7])); + AES_BLOCK_STORE(dst, msg0); + AES_BLOCK_STORE(dst + AES_BLOCK_LENGTH, msg1); + + aegis128l_update(state, msg0, msg1); +} + +static void +aegis128l_declast(uint8_t *const dst, const uint8_t *const src, size_t len, + aes_block_t *const state) +{ + uint8_t pad[RATE]; + aes_block_t msg0, msg1; + + memset(pad, 0, sizeof pad); + memcpy(pad, src, len); + + msg0 = AES_BLOCK_LOAD(pad); + msg1 = AES_BLOCK_LOAD(pad + AES_BLOCK_LENGTH); + msg0 = AES_BLOCK_XOR(msg0, state[6]); + msg0 = AES_BLOCK_XOR(msg0, state[1]); + msg1 = AES_BLOCK_XOR(msg1, state[5]); + msg1 = AES_BLOCK_XOR(msg1, state[2]); + msg0 = AES_BLOCK_XOR(msg0, AES_BLOCK_AND(state[2], state[3])); + msg1 = AES_BLOCK_XOR(msg1, AES_BLOCK_AND(state[6], state[7])); + AES_BLOCK_STORE(pad, msg0); + AES_BLOCK_STORE(pad + AES_BLOCK_LENGTH, msg1); + + memset(pad + len, 0, sizeof pad - len); + memcpy(dst, pad, len); + + msg0 = AES_BLOCK_LOAD(pad); + msg1 = AES_BLOCK_LOAD(pad + AES_BLOCK_LENGTH); + + aegis128l_update(state, msg0, msg1); +} + +static int +encrypt_detached(uint8_t *c, uint8_t *mac, size_t maclen, const uint8_t *m, size_t mlen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k) +{ + aes_block_t state[8]; + CRYPTO_ALIGN(RATE) uint8_t src[RATE]; + CRYPTO_ALIGN(RATE) uint8_t dst[RATE]; + size_t i; + + aegis128l_init(k, npub, state); + + for (i = 0; i + RATE * 2 <= adlen; i += RATE * 2) { + aegis128l_absorb2(ad + i, state); + } + for (; i + RATE <= adlen; i += RATE) { + aegis128l_absorb(ad + i, state); + } + if (adlen % RATE) { + memset(src, 0, RATE); + memcpy(src, ad + i, adlen % RATE); + aegis128l_absorb(src, state); + } + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis128l_enc(c + i, m + i, state); + } + if (mlen % RATE) { + memset(src, 0, RATE); + memcpy(src, m + i, mlen % RATE); + aegis128l_enc(dst, src, state); + memcpy(c + i, dst, mlen % RATE); + } + + aegis128l_mac(mac, maclen, adlen, mlen, state); + + return 0; +} + +static int +decrypt_detached(uint8_t *m, const uint8_t *c, size_t clen, const uint8_t *mac, size_t maclen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k) +{ + aes_block_t state[8]; + CRYPTO_ALIGN(RATE) uint8_t src[RATE]; + CRYPTO_ALIGN(RATE) uint8_t dst[RATE]; + CRYPTO_ALIGN(16) uint8_t computed_mac[32]; + const size_t mlen = clen; + size_t i; + int ret; + + aegis128l_init(k, npub, state); + + for (i = 0; i + RATE * 2 <= adlen; i += RATE * 2) { + aegis128l_absorb2(ad + i, state); + } + for (; i + RATE <= adlen; i += RATE) { + aegis128l_absorb(ad + i, state); + } + if (adlen % RATE) { + memset(src, 0, RATE); + memcpy(src, ad + i, adlen % RATE); + aegis128l_absorb(src, state); + } + if (m != NULL) { + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis128l_dec(m + i, c + i, state); + } + } else { + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis128l_dec(dst, c + i, state); + } + } + if (mlen % RATE) { + if (m != NULL) { + aegis128l_declast(m + i, c + i, mlen % RATE, state); + } else { + aegis128l_declast(dst, c + i, mlen % RATE, state); + } + } + + COMPILER_ASSERT(sizeof computed_mac >= 32); + aegis128l_mac(computed_mac, maclen, adlen, mlen, state); + ret = -1; + if (maclen == 16) { + ret = crypto_verify_16(computed_mac, mac); + } else if (maclen == 32) { + ret = crypto_verify_32(computed_mac, mac); + } + if (ret != 0 && m != NULL) { + memset(m, 0, mlen); + } + return ret; +} diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c new file mode 100644 index 000000000..e1d60ecb4 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis128l.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#include "crypto_aead_aegis128l.h" +#include "private/softaes.h" + +#if 1 + +#include "aegis128l_soft.h" + +#define AES_BLOCK_LENGTH 16 + +typedef SoftAesBlock aes_block_t; +#define AES_BLOCK_XOR(A, B) softaes_block_xor((A), (B)) +#define AES_BLOCK_AND(A, B) softaes_block_and((A), (B)) +#define AES_BLOCK_LOAD(A) softaes_block_load(A) +#define AES_BLOCK_LOAD_64x2(A, B) softaes_block_load64x2((A), (B)) +#define AES_BLOCK_STORE(A, B) softaes_block_store((A), (B)) +#define AES_ENC(A, B) softaes_block_encrypt((A), (B)) + +static inline void +aegis128l_update(aes_block_t *const state, const aes_block_t d1, const aes_block_t d2) +{ + aes_block_t tmp; + + tmp = state[7]; + state[7] = AES_ENC(state[6], state[7]); + state[6] = AES_ENC(state[5], state[6]); + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_ENC(state[3], state[4]); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_ENC(tmp, state[0]); + + state[0] = AES_BLOCK_XOR(state[0], d1); + state[4] = AES_BLOCK_XOR(state[4], d2); +} + +#include "aegis128l_common.h" + +struct aegis128l_implementation aegis128l_soft_implementation = { SODIUM_C99(.encrypt_detached =) + encrypt_detached, + SODIUM_C99(.decrypt_detached =) + decrypt_detached }; + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.h b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.h new file mode 100644 index 000000000..df8ddece0 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.h @@ -0,0 +1,8 @@ +#ifndef aegis128l_soft_H +#define aegis128l_soft_H + +#include "implementations.h" + +extern struct aegis128l_implementation aegis128l_soft_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis128l/implementations.h b/src/libsodium/src/libsodium/crypto_aead/aegis128l/implementations.h new file mode 100644 index 000000000..29e7b1cb8 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis128l/implementations.h @@ -0,0 +1,17 @@ +#ifndef aegis128l_implementations_H +#define aegis128l_implementations_H + +#include +#include + +#include "crypto_aead_aegis128l.h" + +typedef struct aegis128l_implementation { + int (*encrypt_detached)(uint8_t *c, uint8_t *mac, size_t maclen, const uint8_t *m, size_t mlen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k); + int (*decrypt_detached)(uint8_t *m, const uint8_t *c, size_t clen, const uint8_t *mac, + size_t maclen, const uint8_t *ad, size_t adlen, const uint8_t *npub, + const uint8_t *k); +} aegis128l_implementation; + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c b/src/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c new file mode 100644 index 000000000..0fd8f966c --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c @@ -0,0 +1,158 @@ + +#include +#include + +#include "core.h" +#include "crypto_aead_aegis256.h" +#include "private/common.h" +#include "private/implementations.h" +#include "randombytes.h" +#include "runtime.h" + +#include "aegis256_soft.h" + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) +#include "aegis256_armcrypto.h" +#endif + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) +#include "aegis256_aesni.h" +#endif + +static const aegis256_implementation *implementation = &aegis256_soft_implementation; + +size_t +crypto_aead_aegis256_keybytes(void) +{ + return crypto_aead_aegis256_KEYBYTES; +} + +size_t +crypto_aead_aegis256_nsecbytes(void) +{ + return crypto_aead_aegis256_NSECBYTES; +} + +size_t +crypto_aead_aegis256_npubbytes(void) +{ + return crypto_aead_aegis256_NPUBBYTES; +} + +size_t +crypto_aead_aegis256_abytes(void) +{ + return crypto_aead_aegis256_ABYTES; +} + +size_t +crypto_aead_aegis256_messagebytes_max(void) +{ + return crypto_aead_aegis256_MESSAGEBYTES_MAX; +} + +void +crypto_aead_aegis256_keygen(unsigned char k[crypto_aead_aegis256_KEYBYTES]) +{ + randombytes_buf(k, crypto_aead_aegis256_KEYBYTES); +} + +int +crypto_aead_aegis256_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + unsigned long long clen = 0ULL; + int ret; + + ret = + crypto_aead_aegis256_encrypt_detached(c, c + mlen, NULL, m, mlen, ad, adlen, nsec, npub, k); + if (clen_p != NULL) { + if (ret == 0) { + clen = mlen + crypto_aead_aegis256_ABYTES; + } + *clen_p = clen; + } + return ret; +} + +int +crypto_aead_aegis256_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) +{ + unsigned long long mlen = 0ULL; + int ret = -1; + + if (clen >= crypto_aead_aegis256_ABYTES) { + ret = crypto_aead_aegis256_decrypt_detached(m, nsec, c, clen - crypto_aead_aegis256_ABYTES, + c + clen - crypto_aead_aegis256_ABYTES, ad, + adlen, npub, k); + } + if (mlen_p != NULL) { + if (ret == 0) { + mlen = clen - crypto_aead_aegis256_ABYTES; + } + *mlen_p = mlen; + } + return ret; +} + +int +crypto_aead_aegis256_encrypt_detached(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + const size_t maclen = crypto_aead_aegis256_ABYTES; + + if (maclen_p != NULL) { + *maclen_p = maclen; + } + if (mlen > crypto_aead_aegis256_MESSAGEBYTES_MAX || + adlen > crypto_aead_aegis256_MESSAGEBYTES_MAX) { + sodium_misuse(); + } + return implementation->encrypt_detached(c, mac, maclen, m, (size_t) mlen, ad, (size_t) adlen, + npub, k); +} + +int +crypto_aead_aegis256_decrypt_detached(unsigned char *m, unsigned char *nsec, const unsigned char *c, + unsigned long long clen, const unsigned char *mac, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) +{ + const size_t maclen = crypto_aead_aegis256_ABYTES; + + if (clen > crypto_aead_aegis256_MESSAGEBYTES_MAX || + adlen > crypto_aead_aegis256_MESSAGEBYTES_MAX) { + return -1; + } + return implementation->decrypt_detached(m, c, (size_t) clen, mac, maclen, ad, (size_t) adlen, + npub, k); +} + +int +_crypto_aead_aegis256_pick_best_implementation(void) +{ + implementation = &aegis256_soft_implementation; + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) + if (sodium_runtime_has_armcrypto()) { + implementation = &aegis256_armcrypto_implementation; + return 0; + } +#endif + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) + if (sodium_runtime_has_aesni() & sodium_runtime_has_avx()) { + implementation = &aegis256_aesni_implementation; + return 0; + } +#endif + return 0; /* LCOV_EXCL_LINE */ +} diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.c b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.c new file mode 100644 index 000000000..96aa0036b --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis256.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#if defined(HAVE_AVXINTRIN_H) && defined(HAVE_WMMINTRIN_H) + +#include "aegis256_aesni.h" + +#ifdef __clang__ +#pragma clang attribute push(__attribute__((target("aes,avx"))), apply_to = function) +#elif defined(__GNUC__) +#pragma GCC target("aes,avx") +#endif + +#include "private/sse2_64_32.h" +#include +#include + +#define AES_BLOCK_LENGTH 16 + +typedef __m128i aes_block_t; +#define AES_BLOCK_XOR(A, B) _mm_xor_si128((A), (B)) +#define AES_BLOCK_AND(A, B) _mm_and_si128((A), (B)) +#define AES_BLOCK_LOAD(A) _mm_loadu_si128((const aes_block_t *) (const void *) (A)) +#define AES_BLOCK_LOAD_64x2(A, B) _mm_set_epi64x((long long) (A), (long long) (B)) +#define AES_BLOCK_STORE(A, B) _mm_storeu_si128((aes_block_t *) (void *) (A), (B)) +#define AES_ENC(A, B) _mm_aesenc_si128((A), (B)) + +static inline void +aegis256_update(aes_block_t *const state, const aes_block_t d) +{ + aes_block_t tmp; + + tmp = state[5]; + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_ENC(state[3], state[4]); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_BLOCK_XOR(AES_ENC(tmp, state[0]), d); +} + +#include "aegis256_common.h" + +struct aegis256_implementation aegis256_aesni_implementation = { SODIUM_C99(.encrypt_detached =) + encrypt_detached, + SODIUM_C99(.decrypt_detached =) + decrypt_detached }; + +#ifdef __clang__ +#pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.h b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.h new file mode 100644 index 000000000..21f4d819b --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.h @@ -0,0 +1,8 @@ +#ifndef aegis256_aesni_H +#define aegis256_aesni_H + +#include "implementations.h" + +extern struct aegis256_implementation aegis256_aesni_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c new file mode 100644 index 000000000..058e2072b --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis256.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) + +#include "aegis256_armcrypto.h" + +#ifndef __ARM_FEATURE_CRYPTO +#define __ARM_FEATURE_CRYPTO 1 +#endif +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + +#include + +#ifdef __clang__ +#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) +#elif defined(__GNUC__) +#pragma GCC target("+simd+crypto") +#endif + +#define AES_BLOCK_LENGTH 16 + +typedef uint8x16_t aes_block_t; +#define AES_BLOCK_XOR(A, B) veorq_u8((A), (B)) +#define AES_BLOCK_AND(A, B) vandq_u8((A), (B)) +#define AES_BLOCK_LOAD(A) vld1q_u8(A) +#define AES_BLOCK_LOAD_64x2(A, B) vreinterpretq_u8_u64(vsetq_lane_u64((A), vmovq_n_u64(B), 1)) +#define AES_BLOCK_STORE(A, B) vst1q_u8((A), (B)) +#define AES_ENC(A, B) veorq_u8(vaesmcq_u8(vaeseq_u8((A), vmovq_n_u8(0))), (B)) + +static inline void +aegis256_update(aes_block_t *const state, const aes_block_t d) +{ + aes_block_t tmp; + + tmp = state[5]; + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_ENC(state[3], state[4]); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_BLOCK_XOR(AES_ENC(tmp, state[0]), d); +} + +#include "aegis256_common.h" + +struct aegis256_implementation aegis256_armcrypto_implementation = { SODIUM_C99(.encrypt_detached =) + encrypt_detached, + SODIUM_C99(.decrypt_detached =) + decrypt_detached }; + +#ifdef __clang__ +#pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.h b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.h new file mode 100644 index 000000000..a9bd4ad39 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.h @@ -0,0 +1,8 @@ +#ifndef aegis256_armcrypto_H +#define aegis256_armcrypto_H + +#include "implementations.h" + +extern struct aegis256_implementation aegis256_armcrypto_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_common.h b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_common.h new file mode 100644 index 000000000..7c5d25222 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_common.h @@ -0,0 +1,231 @@ +#define RATE 16 + +static void +aegis256_init(const uint8_t *key, const uint8_t *nonce, aes_block_t *const state) +{ + static CRYPTO_ALIGN(AES_BLOCK_LENGTH) + const uint8_t c0_[AES_BLOCK_LENGTH] = { 0x00, 0x01, 0x01, 0x02, 0x03, 0x05, 0x08, 0x0d, + 0x15, 0x22, 0x37, 0x59, 0x90, 0xe9, 0x79, 0x62 }; + static CRYPTO_ALIGN(AES_BLOCK_LENGTH) + const uint8_t c1_[AES_BLOCK_LENGTH] = { 0xdb, 0x3d, 0x18, 0x55, 0x6d, 0xc2, 0x2f, 0xf1, + 0x20, 0x11, 0x31, 0x42, 0x73, 0xb5, 0x28, 0xdd }; + + const aes_block_t c0 = AES_BLOCK_LOAD(c0_); + const aes_block_t c1 = AES_BLOCK_LOAD(c1_); + const aes_block_t k0 = AES_BLOCK_LOAD(key); + const aes_block_t k1 = AES_BLOCK_LOAD(key + AES_BLOCK_LENGTH); + const aes_block_t n0 = AES_BLOCK_LOAD(nonce); + const aes_block_t n1 = AES_BLOCK_LOAD(nonce + AES_BLOCK_LENGTH); + const aes_block_t k0_n0 = AES_BLOCK_XOR(k0, n0); + const aes_block_t k1_n1 = AES_BLOCK_XOR(k1, n1); + int i; + + state[0] = k0_n0; + state[1] = k1_n1; + state[2] = c1; + state[3] = c0; + state[4] = AES_BLOCK_XOR(k0, c0); + state[5] = AES_BLOCK_XOR(k1, c1); + for (i = 0; i < 4; i++) { + aegis256_update(state, k0); + aegis256_update(state, k1); + aegis256_update(state, k0_n0); + aegis256_update(state, k1_n1); + } +} + +static void +aegis256_mac(uint8_t *mac, size_t maclen, size_t adlen, size_t mlen, aes_block_t *const state) +{ + aes_block_t tmp; + int i; + + tmp = AES_BLOCK_LOAD_64x2(((uint64_t) mlen) << 3, ((uint64_t) adlen) << 3); + tmp = AES_BLOCK_XOR(tmp, state[3]); + + for (i = 0; i < 7; i++) { + aegis256_update(state, tmp); + } + + if (maclen == 16) { + tmp = AES_BLOCK_XOR(state[5], state[4]); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[3], state[2])); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_XOR(state[1], state[0])); + AES_BLOCK_STORE(mac, tmp); + } else if (maclen == 32) { + tmp = AES_BLOCK_XOR(AES_BLOCK_XOR(state[2], state[1]), state[0]); + AES_BLOCK_STORE(mac, tmp); + tmp = AES_BLOCK_XOR(AES_BLOCK_XOR(state[5], state[4]), state[3]); + AES_BLOCK_STORE(mac + 16, tmp); + } else { + memset(mac, 0, maclen); + } +} + +static inline void +aegis256_absorb(const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg; + + msg = AES_BLOCK_LOAD(src); + aegis256_update(state, msg); +} + +static inline void +aegis256_absorb2(const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg, msg2; + + msg = AES_BLOCK_LOAD(src + 0 * AES_BLOCK_LENGTH); + msg2 = AES_BLOCK_LOAD(src + 1 * AES_BLOCK_LENGTH); + aegis256_update(state, msg); + aegis256_update(state, msg2); +} + +static void +aegis256_enc(uint8_t *const dst, const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg; + aes_block_t tmp; + + msg = AES_BLOCK_LOAD(src); + tmp = AES_BLOCK_XOR(msg, state[5]); + tmp = AES_BLOCK_XOR(tmp, state[4]); + tmp = AES_BLOCK_XOR(tmp, state[1]); + tmp = AES_BLOCK_XOR(tmp, AES_BLOCK_AND(state[2], state[3])); + AES_BLOCK_STORE(dst, tmp); + + aegis256_update(state, msg); +} + +static void +aegis256_dec(uint8_t *const dst, const uint8_t *const src, aes_block_t *const state) +{ + aes_block_t msg; + + msg = AES_BLOCK_LOAD(src); + msg = AES_BLOCK_XOR(msg, state[5]); + msg = AES_BLOCK_XOR(msg, state[4]); + msg = AES_BLOCK_XOR(msg, state[1]); + msg = AES_BLOCK_XOR(msg, AES_BLOCK_AND(state[2], state[3])); + AES_BLOCK_STORE(dst, msg); + + aegis256_update(state, msg); +} + +static void +aegis256_declast(uint8_t *const dst, const uint8_t *const src, size_t len, aes_block_t *const state) +{ + uint8_t pad[RATE]; + aes_block_t msg; + + memset(pad, 0, sizeof pad); + memcpy(pad, src, len); + + msg = AES_BLOCK_LOAD(pad); + msg = AES_BLOCK_XOR(msg, state[5]); + msg = AES_BLOCK_XOR(msg, state[4]); + msg = AES_BLOCK_XOR(msg, state[1]); + msg = AES_BLOCK_XOR(msg, AES_BLOCK_AND(state[2], state[3])); + AES_BLOCK_STORE(pad, msg); + + memset(pad + len, 0, sizeof pad - len); + memcpy(dst, pad, len); + + msg = AES_BLOCK_LOAD(pad); + + aegis256_update(state, msg); +} + +static int +encrypt_detached(uint8_t *c, uint8_t *mac, size_t maclen, const uint8_t *m, size_t mlen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k) +{ + aes_block_t state[6]; + CRYPTO_ALIGN(RATE) uint8_t src[RATE]; + CRYPTO_ALIGN(RATE) uint8_t dst[RATE]; + size_t i; + + aegis256_init(k, npub, state); + + for (i = 0; i + 2 * RATE <= adlen; i += 2 * RATE) { + aegis256_absorb2(ad + i, state); + } + for (; i + RATE <= adlen; i += RATE) { + aegis256_absorb(ad + i, state); + } + if (adlen % RATE) { + memset(src, 0, RATE); + memcpy(src, ad + i, adlen % RATE); + aegis256_absorb(src, state); + } + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis256_enc(c + i, m + i, state); + } + if (mlen % RATE) { + memset(src, 0, RATE); + memcpy(src, m + i, mlen % RATE); + aegis256_enc(dst, src, state); + memcpy(c + i, dst, mlen % RATE); + } + + aegis256_mac(mac, maclen, adlen, mlen, state); + + return 0; +} + +static int +decrypt_detached(uint8_t *m, const uint8_t *c, size_t clen, const uint8_t *mac, size_t maclen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k) +{ + aes_block_t state[6]; + CRYPTO_ALIGN(RATE) uint8_t src[RATE]; + CRYPTO_ALIGN(RATE) uint8_t dst[RATE]; + CRYPTO_ALIGN(16) uint8_t computed_mac[32]; + const size_t mlen = clen; + size_t i; + int ret; + + aegis256_init(k, npub, state); + + for (i = 0; i + 2 * RATE <= adlen; i += 2 * RATE) { + aegis256_absorb2(ad + i, state); + } + for (; i + RATE <= adlen; i += RATE) { + aegis256_absorb(ad + i, state); + } + if (adlen % RATE) { + memset(src, 0, RATE); + memcpy(src, ad + i, adlen % RATE); + aegis256_absorb(src, state); + } + if (m != NULL) { + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis256_dec(m + i, c + i, state); + } + } else { + for (i = 0; i + RATE <= mlen; i += RATE) { + aegis256_dec(dst, c + i, state); + } + } + if (mlen % RATE) { + if (m != NULL) { + aegis256_declast(m + i, c + i, mlen % RATE, state); + } else { + aegis256_declast(dst, c + i, mlen % RATE, state); + } + } + + COMPILER_ASSERT(sizeof computed_mac >= 32); + aegis256_mac(computed_mac, maclen, adlen, mlen, state); + ret = -1; + if (maclen == 16) { + ret = crypto_verify_16(computed_mac, mac); + } else if (maclen == 32) { + ret = crypto_verify_32(computed_mac, mac); + } + if (ret != 0 && m != NULL) { + memset(m, 0, mlen); + } + return ret; +} diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c new file mode 100644 index 000000000..38024d17a --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aegis256.h" +#include "crypto_verify_16.h" +#include "crypto_verify_32.h" +#include "export.h" +#include "utils.h" + +#include "private/common.h" + +#include "crypto_aead_aegis256.h" +#include "private/softaes.h" + +#if 1 + +#include "aegis256_soft.h" + +#define AES_BLOCK_LENGTH 16 + +typedef SoftAesBlock aes_block_t; +#define AES_BLOCK_XOR(A, B) softaes_block_xor((A), (B)) +#define AES_BLOCK_AND(A, B) softaes_block_and((A), (B)) +#define AES_BLOCK_LOAD(A) softaes_block_load(A) +#define AES_BLOCK_LOAD_64x2(A, B) softaes_block_load64x2((A), (B)) +#define AES_BLOCK_STORE(A, B) softaes_block_store((A), (B)) +#define AES_ENC(A, B) softaes_block_encrypt((A), (B)) + +static inline void +aegis256_update(aes_block_t *const state, const aes_block_t d) +{ + aes_block_t tmp; + + tmp = state[5]; + state[5] = AES_ENC(state[4], state[5]); + state[4] = AES_ENC(state[3], state[4]); + state[3] = AES_ENC(state[2], state[3]); + state[2] = AES_ENC(state[1], state[2]); + state[1] = AES_ENC(state[0], state[1]); + state[0] = AES_BLOCK_XOR(AES_ENC(tmp, state[0]), d); +} + +#include "aegis256_common.h" + +struct aegis256_implementation aegis256_soft_implementation = { SODIUM_C99(.encrypt_detached =) + encrypt_detached, + SODIUM_C99(.decrypt_detached =) + decrypt_detached }; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.h b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.h new file mode 100644 index 000000000..c20198de3 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.h @@ -0,0 +1,8 @@ +#ifndef aegis256_soft_H +#define aegis256_soft_H + +#include "implementations.h" + +extern struct aegis256_implementation aegis256_soft_implementation; + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aegis256/implementations.h b/src/libsodium/src/libsodium/crypto_aead/aegis256/implementations.h new file mode 100644 index 000000000..9efbf3876 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aegis256/implementations.h @@ -0,0 +1,17 @@ +#ifndef aegis256_implementations_H +#define aegis256_implementations_H + +#include +#include + +#include "crypto_aead_aegis256.h" + +typedef struct aegis256_implementation { + int (*encrypt_detached)(uint8_t *c, uint8_t *mac, size_t maclen, const uint8_t *m, size_t mlen, + const uint8_t *ad, size_t adlen, const uint8_t *npub, const uint8_t *k); + int (*decrypt_detached)(uint8_t *m, const uint8_t *c, size_t clen, const uint8_t *mac, + size_t maclen, const uint8_t *ad, size_t adlen, const uint8_t *npub, + const uint8_t *k); +} aegis256_implementation; + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aead_aes256gcm.c b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aead_aes256gcm.c new file mode 100644 index 000000000..2946ba873 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aead_aes256gcm.c @@ -0,0 +1,157 @@ +#include +#include + +#include "crypto_aead_aes256gcm.h" +#include "private/common.h" +#include "randombytes.h" + +size_t +crypto_aead_aes256gcm_keybytes(void) +{ + return crypto_aead_aes256gcm_KEYBYTES; +} + +size_t +crypto_aead_aes256gcm_nsecbytes(void) +{ + return crypto_aead_aes256gcm_NSECBYTES; +} + +size_t +crypto_aead_aes256gcm_npubbytes(void) +{ + return crypto_aead_aes256gcm_NPUBBYTES; +} + +size_t +crypto_aead_aes256gcm_abytes(void) +{ + return crypto_aead_aes256gcm_ABYTES; +} + +size_t +crypto_aead_aes256gcm_statebytes(void) +{ + return (sizeof(crypto_aead_aes256gcm_state) + (size_t) 15U) & ~(size_t) 15U; +} + +size_t +crypto_aead_aes256gcm_messagebytes_max(void) +{ + return crypto_aead_aes256gcm_MESSAGEBYTES_MAX; +} + +void +crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]) +{ + randombytes_buf(k, crypto_aead_aes256gcm_KEYBYTES); +} + +#if !((defined(HAVE_ARMCRYPTO) && defined(__clang__) && defined(NATIVE_LITTLE_ENDIAN)) || \ + (defined(HAVE_TMMINTRIN_H) && defined(HAVE_WMMINTRIN_H))) + +#ifndef ENOSYS +#define ENOSYS ENXIO +#endif + +int +crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *mac, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const unsigned char *k) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *st_, const unsigned char *k) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long mlen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *nsec, + const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen_p, + const unsigned char *m, unsigned long long mlen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *nsec, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *mac, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen_p, + unsigned char *nsec, const unsigned char *c, + unsigned long long clen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + errno = ENOSYS; + return -1; +} + +int +crypto_aead_aes256gcm_is_available(void) +{ + return 0; +} + +#endif \ No newline at end of file diff --git a/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c index fbc662301..8dc9f840f 100644 --- a/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +++ b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @@ -1,996 +1,818 @@ - -/* - * AES256-GCM, based on the "Intel Carry-Less Multiplication Instruction and its Usage for Computing - * the GCM Mode" paper and reference code, using the aggregated reduction method. - * Originally adapted by Romain Dolbeau. - */ - #include +#include #include #include #include #include "core.h" #include "crypto_aead_aes256gcm.h" +#include "crypto_verify_16.h" #include "export.h" #include "private/common.h" +#include "private/sse2_64_32.h" #include "randombytes.h" #include "runtime.h" #include "utils.h" #if defined(HAVE_TMMINTRIN_H) && defined(HAVE_WMMINTRIN_H) -#ifdef __GNUC__ -# pragma GCC target("ssse3") -# pragma GCC target("aes") -# pragma GCC target("pclmul") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("aes,avx,pclmul"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("aes,avx,pclmul") +# endif + +#if !defined(_MSC_VER) || _MSC_VER < 1800 +#define __vectorcall #endif #include #include -#include "private/sse2_64_32.h" -#ifndef ENOSYS -# define ENOSYS ENXIO -#endif - -#if defined(__INTEL_COMPILER) || defined(_bswap64) -#elif defined(_MSC_VER) -# define _bswap64(a) _byteswap_uint64(a) -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) -# define _bswap64(a) __builtin_bswap64(a) -#else -static inline uint64_t -_bswap64(const uint64_t x) -{ - return - ((x << 56) & 0xFF00000000000000UL) | ((x << 40) & 0x00FF000000000000UL) | - ((x << 24) & 0x0000FF0000000000UL) | ((x << 8) & 0x000000FF00000000UL) | - ((x >> 8) & 0x00000000FF000000UL) | ((x >> 24) & 0x0000000000FF0000UL) | - ((x >> 40) & 0x000000000000FF00UL) | ((x >> 56) & 0x00000000000000FFUL); +#define ABYTES crypto_aead_aes256gcm_ABYTES +#define NPUBBYTES crypto_aead_aes256gcm_NPUBBYTES +#define KEYBYTES crypto_aead_aes256gcm_KEYBYTES + +#define PARALLEL_BLOCKS 7 +#undef USE_KARATSUBA_MULTIPLICATION + +typedef __m128i BlockVec; + +#define LOAD128(a) _mm_loadu_si128((const BlockVec *) (a)) +#define STORE128(a, b) _mm_storeu_si128((BlockVec *) (a), (b)) +#define AES_ENCRYPT(block_vec, rkey) _mm_aesenc_si128((block_vec), (rkey)) +#define AES_ENCRYPTLAST(block_vec, rkey) _mm_aesenclast_si128((block_vec), (rkey)) +#define AES_KEYGEN(block_vec, rc) _mm_aeskeygenassist_si128((block_vec), (rc)) +#define XOR128(a, b) _mm_xor_si128((a), (b)) +#define AND128(a, b) _mm_and_si128((a), (b)) +#define OR128(a, b) _mm_or_si128((a), (b)) +#define SET64x2(a, b) _mm_set_epi64x((uint64_t) (a), (uint64_t) (b)) +#define ZERO128 _mm_setzero_si128() +#define ONE128 SET64x2(0, 1) +#define ADD64x2(a, b) _mm_add_epi64((a), (b)) +#define SUB64x2(a, b) _mm_sub_epi64((a), (b)) +#define SHL64x2(a, b) _mm_slli_epi64((a), (b)) +#define SHR64x2(a, b) _mm_srli_epi64((a), (b)) +#define REV128(x) \ + _mm_shuffle_epi8((x), _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) +#define SHUFFLE32x4(x, a, b, c, d) _mm_shuffle_epi32((x), _MM_SHUFFLE((d), (c), (b), (a))) +#define BYTESHL128(a, b) _mm_slli_si128(a, b) +#define BYTESHR128(a, b) _mm_srli_si128(a, b) +#define SHL128(a, b) OR128(SHL64x2((a), (b)), SHR64x2(BYTESHL128((a), 8), 64 - (b))) +#define CLMULLO128(a, b) _mm_clmulepi64_si128((a), (b), 0x00) +#define CLMULHI128(a, b) _mm_clmulepi64_si128((a), (b), 0x11) +#define CLMULLOHI128(a, b) _mm_clmulepi64_si128((a), (b), 0x10) +#define CLMULHILO128(a, b) _mm_clmulepi64_si128((a), (b), 0x01) +#define PREFETCH_READ(x) _mm_prefetch((x), _MM_HINT_T1) +#define PREFETCH_WRITE(x) _mm_prefetch((x), _MM_HINT_T1) + +#define ROUNDS 14 + +#define PC_COUNT (2 * PARALLEL_BLOCKS) + +typedef struct I256 { + BlockVec hi; + BlockVec lo; + BlockVec mid; +} I256; + +typedef BlockVec Precomp; + +typedef struct GHash { + BlockVec acc; +} GHash; + +typedef struct State { + BlockVec rkeys[ROUNDS + 1]; + Precomp hx[PC_COUNT]; +} State; + +static void __vectorcall expand256(const unsigned char key[KEYBYTES], BlockVec rkeys[1 + ROUNDS]) +{ + BlockVec t1, t2, s; + size_t i = 0; + +#define EXPAND_KEY_1(RC) \ + rkeys[i++] = t2; \ + s = AES_KEYGEN(t2, RC); \ + t1 = XOR128(t1, BYTESHL128(t1, 4)); \ + t1 = XOR128(t1, BYTESHL128(t1, 8)); \ + t1 = XOR128(t1, SHUFFLE32x4(s, 3, 3, 3, 3)); + +#define EXPAND_KEY_2(RC) \ + rkeys[i++] = t1; \ + s = AES_KEYGEN(t1, RC); \ + t2 = XOR128(t2, BYTESHL128(t2, 4)); \ + t2 = XOR128(t2, BYTESHL128(t2, 8)); \ + t2 = XOR128(t2, SHUFFLE32x4(s, 2, 2, 2, 2)); + + t1 = LOAD128(&key[0]); + t2 = LOAD128(&key[16]); + + rkeys[i++] = t1; + EXPAND_KEY_1(0x01); + EXPAND_KEY_2(0x01); + EXPAND_KEY_1(0x02); + EXPAND_KEY_2(0x02); + EXPAND_KEY_1(0x04); + EXPAND_KEY_2(0x04); + EXPAND_KEY_1(0x08); + EXPAND_KEY_2(0x08); + EXPAND_KEY_1(0x10); + EXPAND_KEY_2(0x10); + EXPAND_KEY_1(0x20); + EXPAND_KEY_2(0x20); + EXPAND_KEY_1(0x40); + rkeys[i++] = t1; } -#endif -typedef struct aes256gcm_state { - __m128i rkeys[16]; - unsigned char H[16]; -} aes256gcm_state; +/* Encrypt a single AES block */ static inline void -aesni_key256_expand(const unsigned char *key, __m128i * const rkeys) +encrypt(const State *st, unsigned char dst[16], const unsigned char src[16]) { - __m128i X0, X1, X2, X3; - int i = 0; - - X0 = _mm_loadu_si128((const __m128i *) &key[0]); - rkeys[i++] = X0; - - X2 = _mm_loadu_si128((const __m128i *) &key[16]); - rkeys[i++] = X2; - -#define EXPAND_KEY_1(S) do { \ - X1 = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(X2, (S)), 0xff); \ - X3 = _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(X3), _mm_castsi128_ps(X0), 0x10)); \ - X0 = _mm_xor_si128(X0, X3); \ - X3 = _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(X3), _mm_castsi128_ps(X0), 0x8c)); \ - X0 = _mm_xor_si128(_mm_xor_si128(X0, X3), X1); \ - rkeys[i++] = X0; \ -} while (0) - -#define EXPAND_KEY_2(S) do { \ - X1 = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(X0, (S)), 0xaa); \ - X3 = _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(X3), _mm_castsi128_ps(X2), 0x10)); \ - X2 = _mm_xor_si128(X2, X3); \ - X3 = _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(X3), _mm_castsi128_ps(X2), 0x8c)); \ - X2 = _mm_xor_si128(_mm_xor_si128(X2, X3), X1); \ - rkeys[i++] = X2; \ -} while (0) - - X3 = _mm_setzero_si128(); - EXPAND_KEY_1(0x01); EXPAND_KEY_2(0x01); - EXPAND_KEY_1(0x02); EXPAND_KEY_2(0x02); - EXPAND_KEY_1(0x04); EXPAND_KEY_2(0x04); - EXPAND_KEY_1(0x08); EXPAND_KEY_2(0x08); - EXPAND_KEY_1(0x10); EXPAND_KEY_2(0x10); - EXPAND_KEY_1(0x20); EXPAND_KEY_2(0x20); - EXPAND_KEY_1(0x40); + BlockVec t; + + size_t i; + + t = XOR128(LOAD128(src), st->rkeys[0]); + for (i = 1; i < ROUNDS; i++) { + t = AES_ENCRYPT(t, st->rkeys[i]); + } + t = AES_ENCRYPTLAST(t, st->rkeys[ROUNDS]); + STORE128(dst, t); } -/** single, by-the-book AES encryption with AES-NI */ -static inline void -aesni_encrypt1(unsigned char *out, __m128i nv, const __m128i *rkeys) +/* Encrypt and add a single AES block */ + +static inline void __vectorcall encrypt_xor_block(const State *st, unsigned char dst[16], + const unsigned char src[16], + const BlockVec counter) { - __m128i temp = _mm_xor_si128(nv, rkeys[0]); - - temp = _mm_aesenc_si128(temp, rkeys[1]); - temp = _mm_aesenc_si128(temp, rkeys[2]); - temp = _mm_aesenc_si128(temp, rkeys[3]); - temp = _mm_aesenc_si128(temp, rkeys[4]); - temp = _mm_aesenc_si128(temp, rkeys[5]); - temp = _mm_aesenc_si128(temp, rkeys[6]); - temp = _mm_aesenc_si128(temp, rkeys[7]); - temp = _mm_aesenc_si128(temp, rkeys[8]); - temp = _mm_aesenc_si128(temp, rkeys[9]); - temp = _mm_aesenc_si128(temp, rkeys[10]); - temp = _mm_aesenc_si128(temp, rkeys[11]); - temp = _mm_aesenc_si128(temp, rkeys[12]); - temp = _mm_aesenc_si128(temp, rkeys[13]); - - temp = _mm_aesenclast_si128(temp, rkeys[14]); - _mm_storeu_si128((__m128i *) out, temp); -} + BlockVec ts; + size_t i; -/** multiple-blocks-at-once AES encryption with AES-NI ; - on Haswell, aesenc has a latency of 7 and a throughput of 1 - so the sequence of aesenc should be bubble-free if you - have at least 8 blocks. Let's build an arbitratry-sized - function */ -/* Step 1 : loading the nonce */ -/* load & increment the n vector (non-vectorized, unused for now) */ -#define NVDECLx(a) \ - __m128i nv##a - -#define NVx(a) \ - nv##a = _mm_shuffle_epi8(_mm_load_si128((const __m128i *) n), pt); \ - n[3]++ - -/* Step 2 : define value in round one (xor with subkey #0, aka key) */ -#define TEMPDECLx(a) \ - __m128i temp##a - -#define TEMPx(a) \ - temp##a = _mm_xor_si128(nv##a, rkeys[0]) - -/* Step 3: one round of AES */ -#define AESENCx(a) \ - temp##a = _mm_aesenc_si128(temp##a, rkeys[roundctr]) - -/* Step 4: last round of AES */ -#define AESENCLASTx(a) \ - temp##a = _mm_aesenclast_si128(temp##a, rkeys[14]) - -/* Step 5: store result */ -#define STOREx(a) \ - _mm_storeu_si128((__m128i *) (out + (a * 16)), temp##a) - -/* all the MAKE* macros are for automatic explicit unrolling */ -#define MAKE4(X) \ - X(0); \ - X(1); \ - X(2); \ - X(3) - -#define MAKE8(X) \ - X(0); \ - X(1); \ - X(2); \ - X(3); \ - X(4); \ - X(5); \ - X(6); \ - X(7) - -#define COUNTER_INC2(N) (N)[3] += 2 - -/* create a function of unrolling N ; the MAKEN is the unrolling - macro, defined above. The N in MAKEN must match N, obviously. */ -#define FUNC(N, MAKEN) \ - static inline void aesni_encrypt##N(unsigned char *out, uint32_t *n, const __m128i *rkeys) \ - { \ - const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \ - int roundctr; \ - MAKEN(NVDECLx); \ - MAKEN(TEMPDECLx); \ - \ - MAKEN(NVx); \ - MAKEN(TEMPx); \ - for (roundctr = 1; roundctr < 14; roundctr++) { \ - MAKEN(AESENCx); \ - } \ - MAKEN(AESENCLASTx); \ - MAKEN(STOREx); \ + ts = XOR128(counter, st->rkeys[0]); + for (i = 1; i < ROUNDS; i++) { + ts = AES_ENCRYPT(ts, st->rkeys[i]); } + ts = AES_ENCRYPTLAST(ts, st->rkeys[i]); + ts = XOR128(ts, LOAD128(src)); + STORE128(dst, ts); +} -FUNC(8, MAKE8) - -/* all GF(2^128) fnctions are by the book, meaning this one: - -*/ +/* Encrypt and add PARALLEL_BLOCKS AES blocks */ -static inline void -addmul(unsigned char *c, const unsigned char *a, unsigned int xlen, const unsigned char *b) +static inline void __vectorcall encrypt_xor_wide(const State *st, + unsigned char dst[16 * PARALLEL_BLOCKS], + const unsigned char src[16 * PARALLEL_BLOCKS], + const BlockVec counters[PARALLEL_BLOCKS]) { - const __m128i rev = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - __m128i A, B, C; - __m128i tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; - __m128i tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17, tmp18; - __m128i tmp19, tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; - __m128i tmp28, tmp29, tmp30, tmp31, tmp32, tmp33, tmp34, tmp35, tmp36; - - if (xlen >= 16) { - A = _mm_loadu_si128((const __m128i *) a); - } else { - CRYPTO_ALIGN(16) unsigned char padded[16]; - unsigned int i; + BlockVec ts[PARALLEL_BLOCKS]; + size_t i, j; - memset(padded, 0, 16); - for (i = 0; i < xlen; i++) { - padded[i] = a[i]; + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = XOR128(counters[j], st->rkeys[0]); + } + for (i = 1; i < ROUNDS; i++) { + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = AES_ENCRYPT(ts[j], st->rkeys[i]); } - A = _mm_load_si128((const __m128i *) padded); } - A = _mm_shuffle_epi8(A, rev); - B = _mm_loadu_si128((const __m128i *) b); - C = _mm_loadu_si128((const __m128i *) c); - A = _mm_xor_si128(A, C); - tmp3 = _mm_clmulepi64_si128(A, B, 0x00); - tmp4 = _mm_clmulepi64_si128(A, B, 0x10); - tmp5 = _mm_clmulepi64_si128(A, B, 0x01); - tmp6 = _mm_clmulepi64_si128(A, B, 0x11); - tmp10 = _mm_xor_si128(tmp4, tmp5); - tmp13 = _mm_slli_si128(tmp10, 8); - tmp11 = _mm_srli_si128(tmp10, 8); - tmp15 = _mm_xor_si128(tmp3, tmp13); - tmp17 = _mm_xor_si128(tmp6, tmp11); - tmp7 = _mm_srli_epi32(tmp15, 31); - tmp8 = _mm_srli_epi32(tmp17, 31); - tmp16 = _mm_slli_epi32(tmp15, 1); - tmp18 = _mm_slli_epi32(tmp17, 1); - tmp9 = _mm_srli_si128(tmp7, 12); - tmp22 = _mm_slli_si128(tmp8, 4); - tmp25 = _mm_slli_si128(tmp7, 4); - tmp29 = _mm_or_si128(tmp16, tmp25); - tmp19 = _mm_or_si128(tmp18, tmp22); - tmp20 = _mm_or_si128(tmp19, tmp9); - tmp26 = _mm_slli_epi32(tmp29, 31); - tmp23 = _mm_slli_epi32(tmp29, 30); - tmp32 = _mm_slli_epi32(tmp29, 25); - tmp27 = _mm_xor_si128(tmp26, tmp23); - tmp28 = _mm_xor_si128(tmp27, tmp32); - tmp24 = _mm_srli_si128(tmp28, 4); - tmp33 = _mm_slli_si128(tmp28, 12); - tmp30 = _mm_xor_si128(tmp29, tmp33); - tmp2 = _mm_srli_epi32(tmp30, 1); - tmp12 = _mm_srli_epi32(tmp30, 2); - tmp14 = _mm_srli_epi32(tmp30, 7); - tmp34 = _mm_xor_si128(tmp2, tmp12); - tmp35 = _mm_xor_si128(tmp34, tmp14); - tmp36 = _mm_xor_si128(tmp35, tmp24); - tmp31 = _mm_xor_si128(tmp30, tmp36); - tmp21 = _mm_xor_si128(tmp20, tmp31); - _mm_storeu_si128((__m128i *) c, tmp21); + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = AES_ENCRYPTLAST(ts[j], st->rkeys[i]); + ts[j] = XOR128(ts[j], LOAD128(&src[16 * j])); + } + for (j = 0; j < PARALLEL_BLOCKS; j++) { + STORE128(&dst[16 * j], ts[j]); + } } -/* pure multiplication, for pre-computing powers of H */ -static inline __m128i -mulv(__m128i A, __m128i B) +/* Square a field element */ + +static inline I256 __vectorcall clsq128(const BlockVec x) { - __m128i tmp3 = _mm_clmulepi64_si128(A, B, 0x00); - __m128i tmp4 = _mm_clmulepi64_si128(A, B, 0x10); - __m128i tmp5 = _mm_clmulepi64_si128(A, B, 0x01); - __m128i tmp6 = _mm_clmulepi64_si128(A, B, 0x11); - __m128i tmp10 = _mm_xor_si128(tmp4, tmp5); - __m128i tmp13 = _mm_slli_si128(tmp10, 8); - __m128i tmp11 = _mm_srli_si128(tmp10, 8); - __m128i tmp15 = _mm_xor_si128(tmp3, tmp13); - __m128i tmp17 = _mm_xor_si128(tmp6, tmp11); - __m128i tmp7 = _mm_srli_epi32(tmp15, 31); - __m128i tmp8 = _mm_srli_epi32(tmp17, 31); - __m128i tmp16 = _mm_slli_epi32(tmp15, 1); - __m128i tmp18 = _mm_slli_epi32(tmp17, 1); - __m128i tmp9 = _mm_srli_si128(tmp7, 12); - __m128i tmp22 = _mm_slli_si128(tmp8, 4); - __m128i tmp25 = _mm_slli_si128(tmp7, 4); - __m128i tmp29 = _mm_or_si128(tmp16, tmp25); - __m128i tmp19 = _mm_or_si128(tmp18, tmp22); - __m128i tmp20 = _mm_or_si128(tmp19, tmp9); - __m128i tmp26 = _mm_slli_epi32(tmp29, 31); - __m128i tmp23 = _mm_slli_epi32(tmp29, 30); - __m128i tmp32 = _mm_slli_epi32(tmp29, 25); - __m128i tmp27 = _mm_xor_si128(tmp26, tmp23); - __m128i tmp28 = _mm_xor_si128(tmp27, tmp32); - __m128i tmp24 = _mm_srli_si128(tmp28, 4); - __m128i tmp33 = _mm_slli_si128(tmp28, 12); - __m128i tmp30 = _mm_xor_si128(tmp29, tmp33); - __m128i tmp2 = _mm_srli_epi32(tmp30, 1); - __m128i tmp12 = _mm_srli_epi32(tmp30, 2); - __m128i tmp14 = _mm_srli_epi32(tmp30, 7); - __m128i tmp34 = _mm_xor_si128(tmp2, tmp12); - __m128i tmp35 = _mm_xor_si128(tmp34, tmp14); - __m128i tmp36 = _mm_xor_si128(tmp35, tmp24); - __m128i tmp31 = _mm_xor_si128(tmp30, tmp36); - __m128i C = _mm_xor_si128(tmp20, tmp31); - - return C; + const BlockVec r_lo = CLMULLO128(x, x); + const BlockVec r_hi = CLMULHI128(x, x); + + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) ZERO128, + }; } -/* 4 multiply-accumulate at once; again - - for the Aggregated Reduction Method & sample code. - Algorithm by Krzysztof Jankowski, Pierre Laurent - Intel */ - -#define RED_DECL(a) __m128i H##a##_X##a##_lo, H##a##_X##a##_hi, tmp##a, tmp##a##B -#define RED_SHUFFLE(a) X##a = _mm_shuffle_epi8(X##a, rev) -#define RED_MUL_LOW(a) H##a##_X##a##_lo = _mm_clmulepi64_si128(H##a, X##a, 0x00) -#define RED_MUL_HIGH(a) H##a##_X##a##_hi = _mm_clmulepi64_si128(H##a, X##a, 0x11) -#define RED_MUL_MID(a) \ - tmp##a = _mm_shuffle_epi32(H##a, 0x4e); \ - tmp##a##B = _mm_shuffle_epi32(X##a, 0x4e); \ - tmp##a = _mm_xor_si128(tmp##a, H##a); \ - tmp##a##B = _mm_xor_si128(tmp##a##B, X##a); \ - tmp##a = _mm_clmulepi64_si128(tmp##a, tmp##a##B, 0x00) - -#define MULREDUCE4(rev, H0_, H1_, H2_, H3_, X0_, X1_, X2_, X3_, accv) \ -do { \ - MAKE4(RED_DECL); \ - __m128i lo, hi; \ - __m128i tmp8, tmp9; \ - __m128i H0 = H0_; \ - __m128i H1 = H1_; \ - __m128i H2 = H2_; \ - __m128i H3 = H3_; \ - __m128i X0 = X0_; \ - __m128i X1 = X1_; \ - __m128i X2 = X2_; \ - __m128i X3 = X3_; \ -\ -/* byte-revert the inputs & xor the first one into the accumulator */ \ -\ - MAKE4(RED_SHUFFLE); \ - X3 = _mm_xor_si128(X3, accv); \ -\ -/* 4 low H*X (x0*h0) */ \ -\ - MAKE4(RED_MUL_LOW); \ - lo = _mm_xor_si128(H0_X0_lo, H1_X1_lo); \ - lo = _mm_xor_si128(lo, H2_X2_lo); \ - lo = _mm_xor_si128(lo, H3_X3_lo); \ -\ -/* 4 high H*X (x1*h1) */ \ -\ - MAKE4(RED_MUL_HIGH); \ - hi = _mm_xor_si128(H0_X0_hi, H1_X1_hi); \ - hi = _mm_xor_si128(hi, H2_X2_hi); \ - hi = _mm_xor_si128(hi, H3_X3_hi); \ -\ -/* 4 middle H*X, using Karatsuba, i.e. \ - x1*h0+x0*h1 =(x1+x0)*(h1+h0)-x1*h1-x0*h0 \ - we already have all x1y1 & x0y0 (accumulated in hi & lo) \ - (0 is low half and 1 is high half) \ - */ \ -/* permute the high and low 64 bits in H1 & X1, \ - so create (h0,h1) from (h1,h0) and (x0,x1) from (x1,x0), \ - then compute (h0+h1,h1+h0) and (x0+x1,x1+x0), \ - and finally multiply \ - */ \ - MAKE4(RED_MUL_MID); \ -\ - /* subtracts x1*h1 and x0*h0 */ \ - tmp0 = _mm_xor_si128(tmp0, lo); \ - tmp0 = _mm_xor_si128(tmp0, hi); \ - tmp0 = _mm_xor_si128(tmp1, tmp0); \ - tmp0 = _mm_xor_si128(tmp2, tmp0); \ - tmp0 = _mm_xor_si128(tmp3, tmp0);\ -\ - /* reduction */ \ - tmp0B = _mm_slli_si128(tmp0, 8); \ - tmp0 = _mm_srli_si128(tmp0, 8); \ - lo = _mm_xor_si128(tmp0B, lo); \ - hi = _mm_xor_si128(tmp0, hi); \ - tmp3 = lo; \ - tmp2B = hi; \ - tmp3B = _mm_srli_epi32(tmp3, 31); \ - tmp8 = _mm_srli_epi32(tmp2B, 31); \ - tmp3 = _mm_slli_epi32(tmp3, 1); \ - tmp2B = _mm_slli_epi32(tmp2B, 1); \ - tmp9 = _mm_srli_si128(tmp3B, 12); \ - tmp8 = _mm_slli_si128(tmp8, 4); \ - tmp3B = _mm_slli_si128(tmp3B, 4); \ - tmp3 = _mm_or_si128(tmp3, tmp3B); \ - tmp2B = _mm_or_si128(tmp2B, tmp8); \ - tmp2B = _mm_or_si128(tmp2B, tmp9); \ - tmp3B = _mm_slli_epi32(tmp3, 31); \ - tmp8 = _mm_slli_epi32(tmp3, 30); \ - tmp9 = _mm_slli_epi32(tmp3, 25); \ - tmp3B = _mm_xor_si128(tmp3B, tmp8); \ - tmp3B = _mm_xor_si128(tmp3B, tmp9); \ - tmp8 = _mm_srli_si128(tmp3B, 4); \ - tmp3B = _mm_slli_si128(tmp3B, 12); \ - tmp3 = _mm_xor_si128(tmp3, tmp3B); \ - tmp2 = _mm_srli_epi32(tmp3, 1); \ - tmp0B = _mm_srli_epi32(tmp3, 2); \ - tmp1B = _mm_srli_epi32(tmp3, 7); \ - tmp2 = _mm_xor_si128(tmp2, tmp0B); \ - tmp2 = _mm_xor_si128(tmp2, tmp1B); \ - tmp2 = _mm_xor_si128(tmp2, tmp8); \ - tmp3 = _mm_xor_si128(tmp3, tmp2); \ - tmp2B = _mm_xor_si128(tmp2B, tmp3); \ -\ - accv = tmp2B; \ -} while(0) - -#define XORx(a) \ - temp##a = _mm_xor_si128(temp##a, \ - _mm_loadu_si128((const __m128i *) (in + a * 16))) - -#define LOADx(a) \ - __m128i in##a = _mm_loadu_si128((const __m128i *) (in + a * 16)) - -/* full encrypt & checksum 8 blocks at once */ -#define aesni_encrypt8full(out_, n_, rkeys, in_, accum, hv_, h2v_, h3v_, h4v_, rev) \ -do { \ - unsigned char *out = out_; \ - uint32_t *n = n_; \ - const unsigned char *in = in_; \ - const __m128i hv = hv_; \ - const __m128i h2v = h2v_; \ - const __m128i h3v = h3v_; \ - const __m128i h4v = h4v_; \ - const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \ - __m128i accv_; \ - int roundctr; \ - \ - MAKE8(NVDECLx); \ - MAKE8(TEMPDECLx); \ - MAKE8(NVx); \ - MAKE8(TEMPx); \ - for (roundctr = 1; roundctr < 14; roundctr++) { \ - MAKE8(AESENCx); \ - } \ - MAKE8(AESENCLASTx); \ - MAKE8(XORx); \ - MAKE8(STOREx); \ - accv_ = _mm_load_si128((const __m128i *) accum); \ - MULREDUCE4(rev, hv, h2v, h3v, h4v, temp3, temp2, temp1, temp0, accv_); \ - MULREDUCE4(rev, hv, h2v, h3v, h4v, temp7, temp6, temp5, temp4, accv_); \ - _mm_store_si128((__m128i *) accum, accv_); \ -} while(0) - -/* checksum 8 blocks at once */ -#define aesni_addmul8full(in_, accum, hv_, h2v_, h3v_, h4v_, rev) \ -do { \ - const unsigned char *in = in_; \ - const __m128i hv = hv_; \ - const __m128i h2v = h2v_; \ - const __m128i h3v = h3v_; \ - const __m128i h4v = h4v_; \ - __m128i accv_; \ - \ - MAKE8(LOADx); \ - accv_ = _mm_load_si128((const __m128i *) accum); \ - MULREDUCE4(rev, hv, h2v, h3v, h4v, in3, in2, in1, in0, accv_); \ - MULREDUCE4(rev, hv, h2v, h3v, h4v, in7, in6, in5, in4, accv_); \ - _mm_store_si128((__m128i *) accum, accv_); \ -} while(0) - -/* decrypt 8 blocks at once */ -#define aesni_decrypt8full(out_, n_, rkeys, in_) \ -do { \ - unsigned char *out = out_; \ - uint32_t *n = n_; \ - const unsigned char *in = in_; \ - const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \ - int roundctr; \ -\ - MAKE8(NVDECLx); \ - MAKE8(TEMPDECLx); \ - MAKE8(NVx); \ - MAKE8(TEMPx); \ - for (roundctr = 1; roundctr < 14; roundctr++) { \ - MAKE8(AESENCx); \ - } \ - MAKE8(AESENCLASTx); \ - MAKE8(XORx); \ - MAKE8(STOREx); \ -} while(0) +/* Multiply two field elements -- Textbook multiplication is faster than Karatsuba on some recent + * CPUs */ -int -crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_, - const unsigned char *k) +static inline I256 __vectorcall clmul128(const BlockVec x, const BlockVec y) { - aes256gcm_state *ctx = (aes256gcm_state *) (void *) ctx_; - unsigned char *H = ctx->H; - __m128i *rkeys = ctx->rkeys; - __m128i zero = _mm_setzero_si128(); +#ifdef USE_KARATSUBA_MULTIPLICATION + const BlockVec x_hi = BYTESHR128(x, 8); + const BlockVec y_hi = BYTESHR128(y, 8); + const BlockVec r_lo = CLMULLO128(x, y); + const BlockVec r_hi = CLMULHI128(x, y); + const BlockVec r_mid = XOR128(CLMULLO128(XOR128(x, x_hi), XOR128(y, y_hi)), XOR128(r_lo, r_hi)); - COMPILER_ASSERT((sizeof *ctx_) >= (sizeof *ctx)); - aesni_key256_expand(k, rkeys); - aesni_encrypt1(H, zero, rkeys); + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) r_mid, + }; +#else + const BlockVec r_hi = CLMULHI128(x, y); + const BlockVec r_lo = CLMULLO128(x, y); + const BlockVec r_mid = XOR128(CLMULHILO128(x, y), CLMULLOHI128(x, y)); + + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) r_mid, + }; +#endif +} - return 0; +/* Merge the middle word and reduce a field element */ + +static inline BlockVec __vectorcall gcm_reduce(const I256 x) +{ + const BlockVec hi = XOR128(x.hi, BYTESHR128(x.mid, 8)); + const BlockVec lo = XOR128(x.lo, BYTESHL128(x.mid, 8)); + + const BlockVec p64 = SET64x2(0, 0xc200000000000000); + const BlockVec a = CLMULLO128(lo, p64); + const BlockVec b = XOR128(SHUFFLE32x4(lo, 2, 3, 0, 1), a); + const BlockVec c = CLMULLO128(b, p64); + const BlockVec d = XOR128(SHUFFLE32x4(b, 2, 3, 0, 1), c); + + return XOR128(d, hi); } -int -crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, - unsigned char *mac, unsigned long long *maclen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) +/* Precompute powers of H from `from` to `to` */ + +static inline void __vectorcall precomp(Precomp hx[PC_COUNT], const size_t from, const size_t to) { - const __m128i rev = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - const aes256gcm_state *ctx = (const aes256gcm_state *) (const void *) ctx_; - const __m128i *rkeys = ctx->rkeys; - __m128i Hv, H2v, H3v, H4v, accv; - unsigned long long i, j; - unsigned long long adlen_rnd64 = adlen & ~63ULL; - unsigned long long mlen_rnd128 = mlen & ~127ULL; - CRYPTO_ALIGN(16) uint32_t n2[4]; - CRYPTO_ALIGN(16) unsigned char H[16]; - CRYPTO_ALIGN(16) unsigned char T[16]; - CRYPTO_ALIGN(16) unsigned char accum[16]; - CRYPTO_ALIGN(16) unsigned char fb[16]; + const Precomp h = hx[0]; + size_t i; - (void) nsec; - memcpy(H, ctx->H, sizeof H); - if (mlen > crypto_aead_aes256gcm_MESSAGEBYTES_MAX) { - sodium_misuse(); /* LCOV_EXCL_LINE */ + for (i = from & ~1U; i < to; i += 2) { + hx[i] = gcm_reduce(clmul128(hx[i - 1], h)); + hx[i + 1] = gcm_reduce(clsq128(hx[i / 2])); } - memcpy(&n2[0], npub, 3 * 4); - n2[3] = 0x01000000; - aesni_encrypt1(T, _mm_load_si128((const __m128i *) n2), rkeys); - { - uint64_t x; - x = _bswap64((uint64_t) (8 * adlen)); - memcpy(&fb[0], &x, sizeof x); - x = _bswap64((uint64_t) (8 * mlen)); - memcpy(&fb[8], &x, sizeof x); +} + +/* Precompute powers of H given a key and a block count */ + +static void __vectorcall precomp_for_block_count(Precomp hx[PC_COUNT], + const unsigned char gh_key[16], + const size_t block_count) +{ + const BlockVec h0 = REV128(LOAD128(gh_key)); + BlockVec carry = SET64x2(0xc200000000000000, 1); + BlockVec mask = SUB64x2(ZERO128, SHR64x2(h0, 63)); + BlockVec h0_shifted; + BlockVec h; + + mask = SHUFFLE32x4(mask, 3, 3, 3, 3); + carry = AND128(carry, mask); + h0_shifted = SHL128(h0, 1); + h = XOR128(h0_shifted, carry); + + hx[0] = h; + hx[1] = gcm_reduce(clsq128(hx[0])); + + if (block_count >= PC_COUNT) { + precomp(hx, 2, PC_COUNT); + } else { + precomp(hx, 2, block_count); } - /* we store H (and it's power) byte-reverted once and for all */ - Hv = _mm_shuffle_epi8(_mm_load_si128((const __m128i *) H), rev); - _mm_store_si128((__m128i *) H, Hv); - H2v = mulv(Hv, Hv); - H3v = mulv(H2v, Hv); - H4v = mulv(H3v, Hv); - - accv = _mm_setzero_si128(); - /* unrolled by 4 GCM (by 8 doesn't improve using MULREDUCE4) */ - for (i = 0; i < adlen_rnd64; i += 64) { - __m128i X4_ = _mm_loadu_si128((const __m128i *) (ad + i + 0)); - __m128i X3_ = _mm_loadu_si128((const __m128i *) (ad + i + 16)); - __m128i X2_ = _mm_loadu_si128((const __m128i *) (ad + i + 32)); - __m128i X1_ = _mm_loadu_si128((const __m128i *) (ad + i + 48)); - MULREDUCE4(rev, Hv, H2v, H3v, H4v, X1_, X2_, X3_, X4_, accv); +} + +/* Initialize a GHash */ + +static inline void +gh_init(GHash *sth) +{ + sth->acc = ZERO128; +} + +static inline I256 __vectorcall gh_update0(const GHash *const sth, const unsigned char *const p, + const Precomp hn) +{ + const BlockVec m = REV128(LOAD128(p)); + return clmul128(XOR128(sth->acc, m), hn); +} + +static inline void __vectorcall gh_update(I256 *const u, const unsigned char *p, const Precomp hn) +{ + const BlockVec m = REV128(LOAD128(p)); + const I256 t = clmul128(m, hn); + *u = (I256) { SODIUM_C99(.hi =) XOR128(u->hi, t.hi), SODIUM_C99(.lo =) XOR128(u->lo, t.lo), + SODIUM_C99(.mid =) XOR128(u->mid, t.mid) }; +} + +/* Absorb ad_len bytes of associated data. There has to be no partial block. */ + +static inline void +gh_ad_blocks(const State *st, GHash *sth, const unsigned char *ad, size_t ad_len) +{ + size_t i; + + i = (size_t) 0U; + for (; i + PC_COUNT * 16 <= ad_len; i += PC_COUNT * 16) { + I256 u = gh_update0(sth, ad + i, st->hx[PC_COUNT - 1 - 0]); + size_t j; + + for (j = 1; j < PC_COUNT; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[PC_COUNT - 1 - j]); + } + sth->acc = gcm_reduce(u); } - _mm_store_si128((__m128i *) accum, accv); + for (; i + PC_COUNT * 16 / 2 <= ad_len; i += PC_COUNT * 16 / 2) { + I256 u = gh_update0(sth, ad + i, st->hx[PC_COUNT / 2 - 1 - 0]); + size_t j; - /* GCM remainder loop */ - for (i = adlen_rnd64; i < adlen; i += 16) { - unsigned int blocklen = 16; + for (j = 1; j < PC_COUNT / 2; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[PC_COUNT / 2 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + for (; i + 4 * 16 <= ad_len; i += 4 * 16) { + size_t j; + I256 u = gh_update0(sth, ad + i, st->hx[4 - 1 - 0]); - if (i + (unsigned long long) blocklen > adlen) { - blocklen = (unsigned int) (adlen - i); + for (j = 1; j < 4; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[4 - 1 - j]); } - addmul(accum, ad + i, blocklen, H); + sth->acc = gcm_reduce(u); } + for (; i + 2 * 16 <= ad_len; i += 2 * 16) { + size_t j; + I256 u = gh_update0(sth, ad + i, st->hx[2 - 1 - 0]); -/* this only does 8 full blocks, so no fancy bounds checking is necessary*/ -#define LOOPRND128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - \ - for (i = 0; i < mlen_rnd128; i += lb) { \ - aesni_encrypt8full(c + i, n2, rkeys, m + i, accum, Hv, H2v, H3v, H4v, rev); \ - } \ - } while(0) - -/* remainder loop, with the slower GCM update to accommodate partial blocks */ -#define LOOPRMD128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - \ - for (i = mlen_rnd128; i < mlen; i += lb) { \ - CRYPTO_ALIGN(16) unsigned char outni[8 * 16]; \ - unsigned long long mj = lb; \ - \ - aesni_encrypt8(outni, n2, rkeys); \ - if ((i + mj) >= mlen) { \ - mj = mlen - i; \ - } \ - for (j = 0; j < mj; j++) { \ - c[i + j] = m[i + j] ^ outni[j]; \ - } \ - for (j = 0; j < mj; j += 16) { \ - unsigned int bl = 16; \ - \ - if (j + (unsigned long long) bl >= mj) { \ - bl = (unsigned int) (mj - j); \ - } \ - addmul(accum, c + i + j, bl, H); \ - } \ - } \ - } while(0) - - n2[3] &= 0x00ffffff; - COUNTER_INC2(n2); - LOOPRND128; - LOOPRMD128; - - addmul(accum, fb, 16, H); - - for (i = 0; i < 16; ++i) { - mac[i] = T[i] ^ accum[15 - i]; + for (j = 1; j < 2; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[2 - 1 - j]); + } + sth->acc = gcm_reduce(u); } - if (maclen_p != NULL) { - *maclen_p = 16; + if (i < ad_len) { + I256 u = gh_update0(sth, ad + i, st->hx[0]); + sth->acc = gcm_reduce(u); } - return 0; } -int -crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) +/* Increment counters */ + +static inline BlockVec __vectorcall incr_counters(BlockVec rev_counters[], BlockVec counter, + const size_t n) { - int ret = crypto_aead_aes256gcm_encrypt_detached_afternm(c, - c + mlen, NULL, - m, mlen, - ad, adlen, - nsec, npub, ctx_); - if (clen_p != NULL) { - *clen_p = mlen + crypto_aead_aes256gcm_ABYTES; + size_t i; + + const BlockVec one = ONE128; + for (i = 0; i < n; i++) { + rev_counters[i] = REV128(counter); + counter = ADD64x2(counter, one); } - return ret; + return counter; } -int -crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned char *nsec, - const unsigned char *c, unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) +/* Compute the number of required blocks to encrypt and authenticate `ad_len` of associated data, + * and `m_len` of encrypted bytes. Return `0` if limits would be exceeded.*/ + +static inline size_t +required_blocks(const size_t ad_len, const size_t m_len) { - const __m128i rev = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - const aes256gcm_state *ctx = (const aes256gcm_state *) (const void *) ctx_; - const __m128i *rkeys = ctx->rkeys; - __m128i Hv, H2v, H3v, H4v, accv; - unsigned long long i, j; - unsigned long long adlen_rnd64 = adlen & ~63ULL; - unsigned long long mlen; - unsigned long long mlen_rnd128; - CRYPTO_ALIGN(16) uint32_t n2[4]; - CRYPTO_ALIGN(16) unsigned char H[16]; - CRYPTO_ALIGN(16) unsigned char T[16]; - CRYPTO_ALIGN(16) unsigned char accum[16]; - CRYPTO_ALIGN(16) unsigned char fb[16]; + const size_t ad_blocks = (ad_len + 15) / 16; + const size_t m_blocks = (m_len + 15) / 16; - (void) nsec; - if (clen > crypto_aead_aes256gcm_MESSAGEBYTES_MAX) { - sodium_misuse(); /* LCOV_EXCL_LINE */ + if (ad_len > SIZE_MAX - 2 * PARALLEL_BLOCKS * 16 || + m_len > SIZE_MAX - 2 * PARALLEL_BLOCKS * 16 || ad_len < ad_blocks || m_len < m_blocks || + m_blocks >= (1ULL << 32) - 2) { + return 0; } - mlen = clen; - - memcpy(&n2[0], npub, 3 * 4); - n2[3] = 0x01000000; - aesni_encrypt1(T, _mm_load_si128((const __m128i *) n2), rkeys); - - { - uint64_t x; - x = _bswap64((uint64_t)(8 * adlen)); - memcpy(&fb[0], &x, sizeof x); - x = _bswap64((uint64_t)(8 * mlen)); - memcpy(&fb[8], &x, sizeof x); + return ad_blocks + m_blocks + 1; +} + +/* Generic AES-GCM encryption. "Generic" as it can handle arbitrary input sizes, +unlike a length-limited version that would precompute all the required powers of H */ + +static void +aes_gcm_encrypt_generic(const State *st, GHash *sth, unsigned char mac[ABYTES], unsigned char *dst, + const unsigned char *src, size_t src_len, const unsigned char *ad, + size_t ad_len, unsigned char counter_[16]) +{ + CRYPTO_ALIGN(32) I256 u; + CRYPTO_ALIGN(16) unsigned char last_blocks[2 * 16]; + const BlockVec one = ONE128; + BlockVec final_block; + BlockVec rev_counters[PARALLEL_BLOCKS]; + BlockVec counter; + size_t i; + size_t j; + size_t left; + size_t pi; + + COMPILER_ASSERT(PC_COUNT % PARALLEL_BLOCKS == 0); + + /* Associated data */ + + if (ad != NULL && ad_len != 0) { + gh_ad_blocks(st, sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, sth, pad, sizeof pad); + } } - memcpy(H, ctx->H, sizeof H); - Hv = _mm_shuffle_epi8(_mm_load_si128((const __m128i *) H), rev); - _mm_store_si128((__m128i *) H, Hv); - H2v = mulv(Hv, Hv); - H3v = mulv(H2v, Hv); - H4v = mulv(H3v, Hv); - - accv = _mm_setzero_si128(); - for (i = 0; i < adlen_rnd64; i += 64) { - __m128i X4_ = _mm_loadu_si128((const __m128i *) (ad + i + 0)); - __m128i X3_ = _mm_loadu_si128((const __m128i *) (ad + i + 16)); - __m128i X2_ = _mm_loadu_si128((const __m128i *) (ad + i + 32)); - __m128i X1_ = _mm_loadu_si128((const __m128i *) (ad + i + 48)); - MULREDUCE4(rev, Hv, H2v, H3v, H4v, X1_, X2_, X3_, X4_, accv); + /* Encrypted data */ + + counter = REV128(LOAD128(counter_)); + i = 0; + + /* 2*PARALLEL_BLOCKS aggregation */ + + if (src_len - i >= 2 * PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; + + for (; i + 2 * PARALLEL_BLOCKS * 16 <= src_len; i += 2 * PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + PREFETCH_READ(src + i + PARALLEL_BLOCKS * 16); +#if PARALLEL_BLOCKS >= 64 / 16 + PREFETCH_READ(src + i + PARALLEL_BLOCKS * 16 + 64); +#endif + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[2 * PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[2 * PARALLEL_BLOCKS - 1 - j]); + } + + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i + PARALLEL_BLOCKS * 16, src + i + PARALLEL_BLOCKS * 16, + rev_counters); + + PREFETCH_READ(src + i + 2 * PARALLEL_BLOCKS * 16); +#if PARALLEL_BLOCKS >= 64 / 16 + PREFETCH_READ(src + i + 2 * PARALLEL_BLOCKS * 16 + 64); +#endif + pi = i; + for (j = 0; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); } - _mm_store_si128((__m128i *) accum, accv); - for (i = adlen_rnd64; i < adlen; i += 16) { - unsigned int blocklen = 16; - if (i + (unsigned long long) blocklen > adlen) { - blocklen = (unsigned int) (adlen - i); + /* PARALLEL_BLOCKS aggregation */ + + if (src_len - i >= PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; + + for (; i + PARALLEL_BLOCKS * 16 <= src_len; i += PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); } - addmul(accum, ad + i, blocklen, H); + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); } - mlen_rnd128 = mlen & ~127ULL; - -#define LOOPACCUMDRND128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - for (i = 0; i < mlen_rnd128; i += lb) { \ - aesni_addmul8full(c + i, accum, Hv, H2v, H3v, H4v, rev); \ - } \ - } while(0) - -#define LOOPDRND128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - \ - for (i = 0; i < mlen_rnd128; i += lb) { \ - aesni_decrypt8full(m + i, n2, rkeys, c + i); \ - } \ - } while(0) - -#define LOOPACCUMDRMD128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - \ - for (i = mlen_rnd128; i < mlen; i += lb) { \ - unsigned long long mj = lb; \ - \ - if ((i + mj) >= mlen) { \ - mj = mlen - i; \ - } \ - for (j = 0; j < mj; j += 16) { \ - unsigned int bl = 16; \ - \ - if (j + (unsigned long long) bl >= mj) { \ - bl = (unsigned int) (mj - j); \ - } \ - addmul(accum, c + i + j, bl, H); \ - } \ - } \ - } while(0) - -#define LOOPDRMD128 \ - do { \ - const int iter = 8; \ - const int lb = iter * 16; \ - \ - for (i = mlen_rnd128; i < mlen; i += lb) { \ - CRYPTO_ALIGN(16) unsigned char outni[8 * 16]; \ - unsigned long long mj = lb; \ - \ - if ((i + mj) >= mlen) { \ - mj = mlen - i; \ - } \ - aesni_encrypt8(outni, n2, rkeys); \ - for (j = 0; j < mj; j++) { \ - m[i + j] = c[i + j] ^ outni[j]; \ - } \ - } \ - } while(0) - - n2[3] &= 0x00ffffff; - - COUNTER_INC2(n2); - LOOPACCUMDRND128; - LOOPACCUMDRMD128; - addmul(accum, fb, 16, H); - { - unsigned char d = 0; - - for (i = 0; i < 16; i++) { - d |= (mac[i] ^ (T[i] ^ accum[15 - i])); + /* 4-blocks aggregation */ + + for (; i + 4 * 16 <= src_len; i += 4 * 16) { + counter = incr_counters(rev_counters, counter, 4); + for (j = 0; j < 4; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); } - if (d != 0) { - if (m != NULL) { - memset(m, 0, mlen); - } - return -1; + + u = gh_update0(sth, dst + i, st->hx[4 - 1 - 0]); + for (j = 1; j < 4; j += 1) { + gh_update(&u, dst + i + j * 16, st->hx[4 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + /* 2-blocks aggregation */ + + for (; i + 2 * 16 <= src_len; i += 2 * 16) { + counter = incr_counters(rev_counters, counter, 2); + for (j = 0; j < 2; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); } - if (m == NULL) { - return 0; + + u = gh_update0(sth, dst + i, st->hx[2 - 1 - 0]); + for (j = 1; j < 2; j += 1) { + gh_update(&u, dst + i + j * 16, st->hx[2 - 1 - j]); } + sth->acc = gcm_reduce(u); } - n2[3] = 0U; - COUNTER_INC2(n2); - LOOPDRND128; - LOOPDRMD128; - return 0; + /* Remaining *partial* blocks; if we have 16 bytes left, we want to keep the + full block authenticated along with the final block, hence < and not <= */ + + for (; i + 16 < src_len; i += 16) { + encrypt_xor_block(st, dst + i, src + i, REV128(counter)); + u = gh_update0(sth, dst + i, st->hx[1 - 1 - 0]); + sth->acc = gcm_reduce(u); + counter = ADD64x2(counter, one); + } + + /* Authenticate both the last block of the message and the final block */ + + final_block = REV128(SET64x2(ad_len * 8, src_len * 8)); + STORE32_BE(counter_ + NPUBBYTES, 1); + encrypt(st, mac, counter_); + left = src_len - i; + if (left != 0) { + for (j = 0; j < left; j++) { + last_blocks[j] = src[i + j]; + } + STORE128(last_blocks + 16, final_block); + encrypt_xor_block(st, last_blocks, last_blocks, REV128(counter)); + for (; j < 16; j++) { + last_blocks[j] = 0; + } + for (j = 0; j < left; j++) { + dst[i + j] = last_blocks[j]; + } + gh_ad_blocks(st, sth, last_blocks, 32); + } else { + STORE128(last_blocks, final_block); + gh_ad_blocks(st, sth, last_blocks, 16); + } + STORE128(mac, XOR128(LOAD128(mac), REV128(sth->acc))); } -int -crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, unsigned long long clen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) +/* Generic AES-GCM decryption. "Generic" as it can handle arbitrary input sizes, +unlike a length-limited version that would precompute all the required powers of H */ + +static void +aes_gcm_decrypt_generic(const State *st, GHash *sth, unsigned char mac[ABYTES], unsigned char *dst, + const unsigned char *src, size_t src_len, const unsigned char *ad, + size_t ad_len, unsigned char counter_[16]) { - unsigned long long mlen = 0ULL; - int ret = -1; + CRYPTO_ALIGN(32) I256 u; + CRYPTO_ALIGN(16) unsigned char last_blocks[2 * 16]; + const BlockVec one = ONE128; + BlockVec final_block; + BlockVec rev_counters[PARALLEL_BLOCKS]; + BlockVec counter; + size_t i; + size_t j; + size_t left; - if (clen >= crypto_aead_aes256gcm_ABYTES) { - ret = crypto_aead_aes256gcm_decrypt_detached_afternm - (m, nsec, c, clen - crypto_aead_aes256gcm_ABYTES, - c + clen - crypto_aead_aes256gcm_ABYTES, - ad, adlen, npub, ctx_); + COMPILER_ASSERT(PC_COUNT % PARALLEL_BLOCKS == 0); + + /* Associated data */ + + if (ad != NULL && ad_len != 0) { + gh_ad_blocks(st, sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, sth, pad, sizeof pad); + } } - if (mlen_p != NULL) { - if (ret == 0) { - mlen = clen - crypto_aead_aes256gcm_ABYTES; + + /* Encrypted data */ + + counter = REV128(LOAD128(counter_)); + i = 0; + + /* 2*PARALLEL_BLOCKS aggregation */ + + while (i + 2 * PARALLEL_BLOCKS * 16 <= src_len) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + + u = gh_update0(sth, src + i, st->hx[2 * PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[2 * PARALLEL_BLOCKS - 1 - j]); } - *mlen_p = mlen; + + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + + i += PARALLEL_BLOCKS * 16; + for (j = 0; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; } - return ret; -} -int -crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k) -{ - CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state ctx; + /* PARALLEL_BLOCKS aggregation */ - crypto_aead_aes256gcm_beforenm(&ctx, k); + for (; i + PARALLEL_BLOCKS * 16 <= src_len; i += PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); - return crypto_aead_aes256gcm_encrypt_detached_afternm - (c, mac, maclen_p, m, mlen, ad, adlen, nsec, npub, - (const crypto_aead_aes256gcm_state *) &ctx); -} + u = gh_update0(sth, src + i, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); -int -crypto_aead_aes256gcm_encrypt(unsigned char *c, - unsigned long long *clen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k) -{ - CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state ctx; - int ret; + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + } - crypto_aead_aes256gcm_beforenm(&ctx, k); + /* 4-blocks aggregation */ - ret = crypto_aead_aes256gcm_encrypt_afternm - (c, clen_p, m, mlen, ad, adlen, nsec, npub, - (const crypto_aead_aes256gcm_state *) &ctx); - sodium_memzero(&ctx, sizeof ctx); + for (; i + 4 * 16 <= src_len; i += 4 * 16) { + counter = incr_counters(rev_counters, counter, 4); - return ret; -} + u = gh_update0(sth, src + i, st->hx[4 - 1 - 0]); + for (j = 1; j < 4; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[4 - 1 - j]); + } + sth->acc = gcm_reduce(u); -int -crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) -{ - CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state ctx; + for (j = 0; j < 4; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + } - crypto_aead_aes256gcm_beforenm(&ctx, k); + /* 2-blocks aggregation */ - return crypto_aead_aes256gcm_decrypt_detached_afternm - (m, nsec, c, clen, mac, ad, adlen, npub, - (const crypto_aead_aes256gcm_state *) &ctx); -} + for (; i + 2 * 16 <= src_len; i += 2 * 16) { + counter = incr_counters(rev_counters, counter, 2); -int -crypto_aead_aes256gcm_decrypt(unsigned char *m, - unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) -{ - CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state ctx; - int ret; + u = gh_update0(sth, src + i, st->hx[2 - 1 - 0]); + for (j = 1; j < 2; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[2 - 1 - j]); + } + sth->acc = gcm_reduce(u); - crypto_aead_aes256gcm_beforenm(&ctx, k); + for (j = 0; j < 2; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + } - ret = crypto_aead_aes256gcm_decrypt_afternm - (m, mlen_p, nsec, c, clen, ad, adlen, npub, - (const crypto_aead_aes256gcm_state *) &ctx); - sodium_memzero(&ctx, sizeof ctx); + /* Remaining *partial* blocks; if we have 16 bytes left, we want to keep the + full block authenticated along with the final block, hence < and not <= */ - return ret; + for (; i + 16 < src_len; i += 16) { + u = gh_update0(sth, src + i, st->hx[1 - 1 - 0]); + sth->acc = gcm_reduce(u); + encrypt_xor_block(st, dst + i, src + i, REV128(counter)); + counter = ADD64x2(counter, one); + } + + /* Authenticate both the last block of the message and the final block */ + + final_block = REV128(SET64x2(ad_len * 8, src_len * 8)); + STORE32_BE(counter_ + NPUBBYTES, 1); + encrypt(st, mac, counter_); + left = src_len - i; + if (left != 0) { + for (j = 0; j < left; j++) { + last_blocks[j] = src[i + j]; + } + for (; j < 16; j++) { + last_blocks[j] = 0; + } + STORE128(last_blocks + 16, final_block); + gh_ad_blocks(st, sth, last_blocks, 32); + encrypt_xor_block(st, last_blocks, last_blocks, REV128(counter)); + for (j = 0; j < left; j++) { + dst[i + j] = last_blocks[j]; + } + } else { + STORE128(last_blocks, final_block); + gh_ad_blocks(st, sth, last_blocks, 16); + } + STORE128(mac, XOR128(LOAD128(mac), REV128(sth->acc))); } int -crypto_aead_aes256gcm_is_available(void) +crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *st_, const unsigned char *k) { - return sodium_runtime_has_pclmul() & sodium_runtime_has_aesni(); -} + State *st = (State *) (void *) st_; + CRYPTO_ALIGN(16) unsigned char h[16]; -#else + COMPILER_ASSERT(sizeof *st_ >= sizeof *st); -int -crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, - unsigned char *mac, - unsigned long long *maclen_p, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const unsigned char *k) -{ - errno = ENOSYS; - return -1; -} + expand256(k, st->rkeys); + memset(h, 0, sizeof h); + encrypt(st, h, h); -int -crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long *clen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k) -{ - errno = ENOSYS; - return -1; -} + precomp_for_block_count(st->hx, h, PC_COUNT); -int -crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, - unsigned char *nsec, - const unsigned char *c, - unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, - unsigned long long adlen, - const unsigned char *npub, - const unsigned char *k) -{ - errno = ENOSYS; - return -1; + return 0; } int -crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, - unsigned char *nsec, const unsigned char *c, - unsigned long long clen, const unsigned char *ad, - unsigned long long adlen, const unsigned char *npub, - const unsigned char *k) -{ - errno = ENOSYS; - return -1; +crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long m_len_, const unsigned char *ad, + unsigned long long ad_len_, + const unsigned char *nsec, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + CRYPTO_ALIGN(16) unsigned char j[16]; + size_t gh_required_blocks; + const size_t ad_len = (size_t) ad_len_; + const size_t m_len = (size_t) m_len_; + + (void) nsec; + if (maclen_p != NULL) { + *maclen_p = 0; + } + if (ad_len_ > SODIUM_SIZE_MAX || m_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + gh_required_blocks = required_blocks(ad_len, m_len); + if (gh_required_blocks == 0) { + memset(mac, 0xd0, ABYTES); + memset(c, 0, m_len); + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + aes_gcm_encrypt_generic(st, &sth, mac, c, m, m_len, ad, ad_len, j); + + if (maclen_p != NULL) { + *maclen_p = ABYTES; + } + return 0; } int -crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_, - const unsigned char *k) +crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, + unsigned long long m_len, const unsigned char *ad, + unsigned long long ad_len, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) { - errno = ENOSYS; - return -1; + const int ret = crypto_aead_aes256gcm_encrypt_detached(c, c + m_len, NULL, m, m_len, ad, ad_len, + nsec, npub, k); + if (clen_p != NULL) { + if (ret == 0) { + *clen_p = m_len + crypto_aead_aes256gcm_ABYTES; + } else { + *clen_p = 0; + } + } + return ret; } int -crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, - unsigned char *mac, unsigned long long *maclen_p, - const unsigned char *m, unsigned long long mlen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *nsec, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) +crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long m_len, const unsigned char *ad, + unsigned long long ad_len, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) { - errno = ENOSYS; - return -1; + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; + int ret; + + PREFETCH_WRITE(c); + PREFETCH_READ(m); + PREFETCH_READ(ad); + + crypto_aead_aes256gcm_beforenm(&st, k); + ret = crypto_aead_aes256gcm_encrypt_detached_afternm(c, mac, maclen_p, m, m_len, ad, ad_len, + nsec, npub, &st); + sodium_memzero(&st, sizeof st); + + return ret; } int @@ -998,82 +820,196 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) + const crypto_aead_aes256gcm_state *st_) { - errno = ENOSYS; - return -1; + int ret = crypto_aead_aes256gcm_encrypt_detached_afternm(c, c + mlen, NULL, m, mlen, ad, adlen, + nsec, npub, st_); + if (clen_p != NULL) { + *clen_p = mlen + crypto_aead_aes256gcm_ABYTES; + } + return ret; +} + +static int +crypto_aead_aes256gcm_verify_mac(unsigned char *nsec, const unsigned char *c, + unsigned long long c_len_, const unsigned char *mac, + const unsigned char *ad, unsigned long long ad_len_, + const unsigned char *npub, const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + BlockVec final_block; + CRYPTO_ALIGN(16) unsigned char j[16]; + CRYPTO_ALIGN(16) unsigned char computed_mac[16]; + CRYPTO_ALIGN(16) unsigned char last_block[16]; + size_t gh_required_blocks; + size_t left; + const size_t ad_len = (size_t) ad_len_; + const size_t c_len = (size_t) c_len_; + int ret; + + (void) nsec; + if (ad_len_ > SODIUM_SIZE_MAX || c_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + gh_required_blocks = required_blocks(ad_len, c_len); + if (gh_required_blocks == 0) { + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + gh_ad_blocks(st, &sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, &sth, pad, sizeof pad); + } + + gh_ad_blocks(st, &sth, c, c_len & ~15); + left = c_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, c + c_len - left, left); + gh_ad_blocks(st, &sth, pad, sizeof pad); + } + final_block = REV128(SET64x2(ad_len * 8, c_len * 8)); + STORE32_BE(j + NPUBBYTES, 1); + encrypt(st, computed_mac, j); + STORE128(last_block, final_block); + gh_ad_blocks(st, &sth, last_block, 16); + STORE128(computed_mac, XOR128(LOAD128(computed_mac), REV128(sth.acc))); + + ret = crypto_verify_16(mac, computed_mac); + sodium_memzero(computed_mac, sizeof computed_mac); + + return ret; } int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned char *nsec, - const unsigned char *c, unsigned long long clen, - const unsigned char *mac, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) -{ - errno = ENOSYS; - return -1; + const unsigned char *c, unsigned long long c_len_, + const unsigned char *mac, const unsigned char *ad, + unsigned long long ad_len_, + const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + CRYPTO_ALIGN(16) unsigned char j[16]; + unsigned char computed_mac[16]; + size_t gh_required_blocks; + const size_t ad_len = (size_t) ad_len_; + const size_t c_len = (size_t) c_len_; + const size_t m_len = c_len; + + (void) nsec; + if (ad_len_ > SODIUM_SIZE_MAX || c_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + if (m == NULL) { + return crypto_aead_aes256gcm_verify_mac(nsec, c, c_len, mac, ad, ad_len, npub, st_); + } + gh_required_blocks = required_blocks(ad_len, m_len); + if (gh_required_blocks == 0) { + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + aes_gcm_decrypt_generic(st, &sth, computed_mac, m, c, m_len, ad, ad_len, j); + + if (crypto_verify_16(mac, computed_mac) != 0) { + sodium_memzero(computed_mac, sizeof computed_mac); + memset(m, 0xd0, m_len); + return -1; + } + return 0; } int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen_p, - unsigned char *nsec, - const unsigned char *c, unsigned long long clen, - const unsigned char *ad, unsigned long long adlen, - const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_) + unsigned char *nsec, const unsigned char *c, + unsigned long long clen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) { - errno = ENOSYS; - return -1; + unsigned long long mlen = 0ULL; + int ret = -1; + + if (clen >= ABYTES) { + ret = crypto_aead_aes256gcm_decrypt_detached_afternm( + m, nsec, c, clen - ABYTES, c + clen - ABYTES, ad, adlen, npub, st_); + } + if (mlen_p != NULL) { + if (ret == 0) { + mlen = clen - ABYTES; + } + *mlen_p = mlen; + } + return ret; } int -crypto_aead_aes256gcm_is_available(void) +crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *mac, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const unsigned char *k) { - return 0; -} + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; -#endif + PREFETCH_WRITE(m); + PREFETCH_READ(c); + PREFETCH_READ(ad); -size_t -crypto_aead_aes256gcm_keybytes(void) -{ - return crypto_aead_aes256gcm_KEYBYTES; -} + crypto_aead_aes256gcm_beforenm(&st, k); -size_t -crypto_aead_aes256gcm_nsecbytes(void) -{ - return crypto_aead_aes256gcm_NSECBYTES; + return crypto_aead_aes256gcm_decrypt_detached_afternm( + m, nsec, c, clen, mac, ad, adlen, npub, (const crypto_aead_aes256gcm_state *) &st); } -size_t -crypto_aead_aes256gcm_npubbytes(void) +int +crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) { - return crypto_aead_aes256gcm_NPUBBYTES; -} + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; + int ret; -size_t -crypto_aead_aes256gcm_abytes(void) -{ - return crypto_aead_aes256gcm_ABYTES; -} + PREFETCH_WRITE(m); + PREFETCH_READ(c); + PREFETCH_READ(ad); -size_t -crypto_aead_aes256gcm_statebytes(void) -{ - return (sizeof(crypto_aead_aes256gcm_state) + (size_t) 15U) & ~(size_t) 15U; -} + crypto_aead_aes256gcm_beforenm(&st, k); -size_t -crypto_aead_aes256gcm_messagebytes_max(void) -{ - return crypto_aead_aes256gcm_MESSAGEBYTES_MAX; + ret = crypto_aead_aes256gcm_decrypt_afternm(m, mlen_p, nsec, c, clen, ad, adlen, npub, + (const crypto_aead_aes256gcm_state *) &st); + sodium_memzero(&st, sizeof st); + + return ret; } -void -crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]) +int +crypto_aead_aes256gcm_is_available(void) { - randombytes_buf(k, crypto_aead_aes256gcm_KEYBYTES); + return sodium_runtime_has_pclmul() & sodium_runtime_has_aesni() & sodium_runtime_has_avx(); } + +#ifdef __clang__ +# pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c new file mode 100644 index 000000000..aa76f5cd1 --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c @@ -0,0 +1,1032 @@ +#include +#include +#include +#include +#include + +#include "core.h" +#include "crypto_aead_aes256gcm.h" +#include "crypto_verify_16.h" +#include "export.h" +#include "private/common.h" +#include "randombytes.h" +#include "runtime.h" +#include "utils.h" + +#if defined(HAVE_ARMCRYPTO) && defined(__clang__) && defined(NATIVE_LITTLE_ENDIAN) + +#if !defined(MSC_VER) || _MSC_VER < 1800 +#define __vectorcall +#endif + +#ifndef __ARM_FEATURE_CRYPTO +#define __ARM_FEATURE_CRYPTO 1 +#endif +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + +#include + +#ifdef __clang__ +#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) +#elif defined(__GNUC__) +#pragma GCC target("+simd+crypto") +#endif + +#define ABYTES crypto_aead_aes256gcm_ABYTES +#define NPUBBYTES crypto_aead_aes256gcm_NPUBBYTES +#define KEYBYTES crypto_aead_aes256gcm_KEYBYTES + +#define PARALLEL_BLOCKS 6 +#undef USE_KARATSUBA_MULTIPLICATION + +typedef uint64x2_t BlockVec; + +#define LOAD128(a) vld1q_u64((const uint64_t *) (const void *) (a)) +#define STORE128(a, b) vst1q_u64((uint64_t *) (void *) (a), (b)) +#define AES_XENCRYPT(block_vec, rkey) \ + vreinterpretq_u64_u8(vaesmcq_u8(vaeseq_u8(vreinterpretq_u8_u64(block_vec), rkey))) +#define AES_XENCRYPTLAST(block_vec, rkey) \ + vreinterpretq_u64_u8(vaeseq_u8(vreinterpretq_u8_u64(block_vec), rkey)) +#define XOR128(a, b) veorq_u64((a), (b)) +#define AND128(a, b) vandq_u64((a), (b)) +#define OR128(a, b) vorrq_u64((a), (b)) +#define SET64x2(a, b) vsetq_lane_u64((uint64_t) (a), vmovq_n_u64((uint64_t) (b)), 1) +#define ZERO128 vmovq_n_u8(0) +#define ONE128 SET64x2(0, 1) +#define ADD64x2(a, b) vaddq_u64((a), (b)) +#define SUB64x2(a, b) vsubq_u64((a), (b)) +#define SHL64x2(a, b) vshlq_n_u64((a), (b)) +#define SHR64x2(a, b) vshrq_n_u64((a), (b)) +#define REV128(x) \ + vreinterpretq_u64_u8(__builtin_shufflevector(vreinterpretq_u8_u64(x), vreinterpretq_u8_u64(x), \ + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, \ + 1, 0)) +#define SHUFFLE32x4(x, a, b, c, d) \ + vreinterpretq_u64_u32(__builtin_shufflevector(vreinterpretq_u32_u64(x), \ + vreinterpretq_u32_u64(x), (a), (b), (c), (d))) +#define BYTESHL128(a, b) vreinterpretq_u64_u8(vextq_s8(vdupq_n_s8(0), (int8x16_t) a, 16 - (b))) +#define BYTESHR128(a, b) vreinterpretq_u64_u8(vextq_s8((int8x16_t) a, vdupq_n_s8(0), (b))) + +#define SHL128(a, b) OR128(SHL64x2((a), (b)), SHR64x2(BYTESHL128((a), 8), 64 - (b))) +#define CLMULLO128(a, b) \ + vreinterpretq_u64_p128(vmull_p64((poly64_t) vget_low_u64(a), (poly64_t) vget_low_u64(b))) +#define CLMULHI128(a, b) \ + vreinterpretq_u64_p128(vmull_high_p64(vreinterpretq_p64_s64(a), vreinterpretq_p64_s64(b))) +#define CLMULLOHI128(a, b) \ + vreinterpretq_u64_p128(vmull_p64((poly64_t) vget_low_u64(a), (poly64_t) vget_high_u64(b))) +#define CLMULHILO128(a, b) \ + vreinterpretq_u64_p128(vmull_p64((poly64_t) vget_high_u64(a), (poly64_t) vget_low_u64(b))) +#define PREFETCH_READ(x) __builtin_prefetch((x), 0, 2) +#define PREFETCH_WRITE(x) __builtin_prefetch((x), 1, 2); + +static inline BlockVec +AES_KEYGEN(BlockVec block_vec, const int rc) +{ + uint8x16_t a = vaeseq_u8(vreinterpretq_u8_u64(block_vec), vmovq_n_u8(0)); + const uint8x16_t b = + __builtin_shufflevector(a, a, 4, 1, 14, 11, 1, 14, 11, 4, 12, 9, 6, 3, 9, 6, 3, 12); + const uint64x2_t c = SET64x2((uint64_t) rc << 32, (uint64_t) rc << 32); + return XOR128(b, c); +} + +#define ROUNDS 14 + +#define PC_COUNT (2 * PARALLEL_BLOCKS) + +typedef struct I256 { + BlockVec hi; + BlockVec lo; + BlockVec mid; +} I256; + +typedef BlockVec Precomp; + +typedef struct GHash { + BlockVec acc; +} GHash; + +typedef struct State { + BlockVec rkeys[ROUNDS + 1]; + Precomp hx[PC_COUNT]; +} State; + +static void __vectorcall expand256(const unsigned char key[KEYBYTES], BlockVec rkeys[1 + ROUNDS]) +{ + BlockVec t1, t2, s; + size_t i = 0; + +#define EXPAND_KEY_1(RC) \ + rkeys[i++] = t2; \ + s = AES_KEYGEN(t2, RC); \ + t1 = XOR128(t1, BYTESHL128(t1, 4)); \ + t1 = XOR128(t1, BYTESHL128(t1, 8)); \ + t1 = XOR128(t1, SHUFFLE32x4(s, 3, 3, 3, 3)); + +#define EXPAND_KEY_2(RC) \ + rkeys[i++] = t1; \ + s = AES_KEYGEN(t1, RC); \ + t2 = XOR128(t2, BYTESHL128(t2, 4)); \ + t2 = XOR128(t2, BYTESHL128(t2, 8)); \ + t2 = XOR128(t2, SHUFFLE32x4(s, 2, 2, 2, 2)); + + t1 = LOAD128(&key[0]); + t2 = LOAD128(&key[16]); + + rkeys[i++] = t1; + EXPAND_KEY_1(0x01); + EXPAND_KEY_2(0x01); + EXPAND_KEY_1(0x02); + EXPAND_KEY_2(0x02); + EXPAND_KEY_1(0x04); + EXPAND_KEY_2(0x04); + EXPAND_KEY_1(0x08); + EXPAND_KEY_2(0x08); + EXPAND_KEY_1(0x10); + EXPAND_KEY_2(0x10); + EXPAND_KEY_1(0x20); + EXPAND_KEY_2(0x20); + EXPAND_KEY_1(0x40); + rkeys[i++] = t1; +} + +/* Encrypt a single AES block */ + +static inline void +encrypt(const State *st, unsigned char dst[16], const unsigned char src[16]) +{ + BlockVec t; + + size_t i; + + t = AES_XENCRYPT(LOAD128(src), st->rkeys[0]); + for (i = 1; i < ROUNDS - 1; i++) { + t = AES_XENCRYPT(t, st->rkeys[i]); + } + t = AES_XENCRYPTLAST(t, st->rkeys[i]); + t = XOR128(t, st->rkeys[ROUNDS]); + STORE128(dst, t); +} + +/* Encrypt and add a single AES block */ + +static inline void __vectorcall encrypt_xor_block(const State *st, unsigned char dst[16], + const unsigned char src[16], + const BlockVec counter) +{ + BlockVec ts; + size_t i; + + ts = AES_XENCRYPT(counter, st->rkeys[0]); + for (i = 1; i < ROUNDS - 1; i++) { + ts = AES_XENCRYPT(ts, st->rkeys[i]); + } + ts = AES_XENCRYPTLAST(ts, st->rkeys[i]); + ts = XOR128(ts, XOR128(st->rkeys[ROUNDS], LOAD128(src))); + STORE128(dst, ts); +} + +/* Encrypt and add PARALLEL_BLOCKS AES blocks */ + +static inline void __vectorcall encrypt_xor_wide(const State *st, + unsigned char dst[16 * PARALLEL_BLOCKS], + const unsigned char src[16 * PARALLEL_BLOCKS], + const BlockVec counters[PARALLEL_BLOCKS]) +{ + BlockVec ts[PARALLEL_BLOCKS]; + size_t i, j; + + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = AES_XENCRYPT(counters[j], st->rkeys[0]); + } + for (i = 1; i < ROUNDS - 1; i++) { + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = AES_XENCRYPT(ts[j], st->rkeys[i]); + } + } + for (j = 0; j < PARALLEL_BLOCKS; j++) { + ts[j] = AES_XENCRYPTLAST(ts[j], st->rkeys[i]); + ts[j] = XOR128(ts[j], XOR128(st->rkeys[ROUNDS], LOAD128(&src[16 * j]))); + } + for (j = 0; j < PARALLEL_BLOCKS; j++) { + STORE128(&dst[16 * j], ts[j]); + } +} + +/* Square a field element */ + +static inline I256 __vectorcall clsq128(const BlockVec x) +{ + const BlockVec r_lo = CLMULLO128(x, x); + const BlockVec r_hi = CLMULHI128(x, x); + + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) ZERO128, + }; +} + +/* Multiply two field elements -- Textbook multiplication is faster than Karatsuba on some recent + * CPUs */ + +static inline I256 __vectorcall clmul128(const BlockVec x, const BlockVec y) +{ +#ifdef USE_KARATSUBA_MULTIPLICATION + const BlockVec x_hi = BYTESHR128(x, 8); + const BlockVec y_hi = BYTESHR128(y, 8); + const BlockVec r_lo = CLMULLO128(x, y); + const BlockVec r_hi = CLMULHI128(x, y); + const BlockVec r_mid = XOR128(CLMULLO128(XOR128(x, x_hi), XOR128(y, y_hi)), XOR128(r_lo, r_hi)); + + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) r_mid, + }; +#else + const BlockVec r_hi = CLMULHI128(x, y); + const BlockVec r_lo = CLMULLO128(x, y); + const BlockVec r_mid = XOR128(CLMULHILO128(x, y), CLMULLOHI128(x, y)); + + return (I256) { + SODIUM_C99(.hi =) r_hi, + SODIUM_C99(.lo =) r_lo, + SODIUM_C99(.mid =) r_mid, + }; +#endif +} + +/* Merge the middle word and reduce a field element */ + +static inline BlockVec __vectorcall gcm_reduce(const I256 x) +{ + const BlockVec hi = XOR128(x.hi, BYTESHR128(x.mid, 8)); + const BlockVec lo = XOR128(x.lo, BYTESHL128(x.mid, 8)); + + const BlockVec p64 = SET64x2(0, 0xc200000000000000); + const BlockVec a = CLMULLO128(lo, p64); + const BlockVec b = XOR128(SHUFFLE32x4(lo, 2, 3, 0, 1), a); + const BlockVec c = CLMULLO128(b, p64); + const BlockVec d = XOR128(SHUFFLE32x4(b, 2, 3, 0, 1), c); + + return XOR128(d, hi); +} + +/* Precompute powers of H from `from` to `to` */ + +static inline void __vectorcall precomp(Precomp hx[PC_COUNT], const size_t from, const size_t to) +{ + const Precomp h = hx[0]; + size_t i; + + for (i = from & ~1U; i < to; i += 2) { + hx[i] = gcm_reduce(clmul128(hx[i - 1], h)); + hx[i + 1] = gcm_reduce(clsq128(hx[i / 2])); + } +} + +/* Precompute powers of H given a key and a block count */ + +static void __vectorcall precomp_for_block_count(Precomp hx[PC_COUNT], + const unsigned char gh_key[16], + const size_t block_count) +{ + const BlockVec h0 = REV128(LOAD128(gh_key)); + BlockVec carry = SET64x2(0xc200000000000000, 1); + BlockVec mask = SUB64x2(ZERO128, SHR64x2(h0, 63)); + BlockVec h0_shifted; + BlockVec h; + + mask = SHUFFLE32x4(mask, 3, 3, 3, 3); + carry = AND128(carry, mask); + h0_shifted = SHL128(h0, 1); + h = XOR128(h0_shifted, carry); + + hx[0] = h; + hx[1] = gcm_reduce(clsq128(hx[0])); + + if (block_count >= PC_COUNT) { + precomp(hx, 2, PC_COUNT); + } else { + precomp(hx, 2, block_count); + } +} + +/* Initialize a GHash */ + +static inline void +gh_init(GHash *sth) +{ + sth->acc = ZERO128; +} + +static inline I256 __vectorcall gh_update0(const GHash *const sth, const unsigned char *const p, + const Precomp hn) +{ + const BlockVec m = REV128(LOAD128(p)); + return clmul128(XOR128(sth->acc, m), hn); +} + +static inline void __vectorcall gh_update(I256 *const u, const unsigned char *p, const Precomp hn) +{ + const BlockVec m = REV128(LOAD128(p)); + const I256 t = clmul128(m, hn); + *u = (I256) { SODIUM_C99(.hi =) XOR128(u->hi, t.hi), SODIUM_C99(.lo =) XOR128(u->lo, t.lo), + SODIUM_C99(.mid =) XOR128(u->mid, t.mid) }; +} + +/* Absorb ad_len bytes of associated data. There has to be no partial block. */ + +static inline void +gh_ad_blocks(const State *st, GHash *sth, const unsigned char *ad, size_t ad_len) +{ + size_t i; + + i = (size_t) 0U; + for (; i + PC_COUNT * 16 <= ad_len; i += PC_COUNT * 16) { + I256 u = gh_update0(sth, ad + i, st->hx[PC_COUNT - 1 - 0]); + size_t j; + + for (j = 1; j < PC_COUNT; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[PC_COUNT - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + for (; i + PC_COUNT * 16 / 2 <= ad_len; i += PC_COUNT * 16 / 2) { + I256 u = gh_update0(sth, ad + i, st->hx[PC_COUNT / 2 - 1 - 0]); + size_t j; + + for (j = 1; j < PC_COUNT / 2; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[PC_COUNT / 2 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + for (; i + 4 * 16 <= ad_len; i += 4 * 16) { + size_t j; + I256 u = gh_update0(sth, ad + i, st->hx[4 - 1 - 0]); + + for (j = 1; j < 4; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[4 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + for (; i + 2 * 16 <= ad_len; i += 2 * 16) { + size_t j; + I256 u = gh_update0(sth, ad + i, st->hx[2 - 1 - 0]); + + for (j = 1; j < 2; j += 1) { + gh_update(&u, ad + i + j * 16, st->hx[2 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + if (i < ad_len) { + I256 u = gh_update0(sth, ad + i, st->hx[0]); + sth->acc = gcm_reduce(u); + } +} + +/* Increment counters */ + +static inline BlockVec __vectorcall incr_counters(BlockVec rev_counters[], BlockVec counter, + const size_t n) +{ + size_t i; + + const BlockVec one = ONE128; + for (i = 0; i < n; i++) { + rev_counters[i] = REV128(counter); + counter = ADD64x2(counter, one); + } + return counter; +} + +/* Compute the number of required blocks to encrypt and authenticate `ad_len` of associated data, + * and `m_len` of encrypted bytes. Return `0` if limits would be exceeded.*/ + +static inline size_t +required_blocks(const size_t ad_len, const size_t m_len) +{ + const size_t ad_blocks = (ad_len + 15) / 16; + const size_t m_blocks = (m_len + 15) / 16; + + if (ad_len > SIZE_MAX - 2 * PARALLEL_BLOCKS * 16 || + m_len > SIZE_MAX - 2 * PARALLEL_BLOCKS * 16 || ad_len < ad_blocks || m_len < m_blocks || + m_blocks >= (1ULL << 32) - 2) { + return 0; + } + return ad_blocks + m_blocks + 1; +} + +/* Generic AES-GCM encryption. "Generic" as it can handle arbitrary input sizes, +unlike a length-limited version that would precompute all the required powers of H */ + +static void +aes_gcm_encrypt_generic(const State *st, GHash *sth, unsigned char mac[ABYTES], unsigned char *dst, + const unsigned char *src, size_t src_len, const unsigned char *ad, + size_t ad_len, unsigned char counter_[16]) +{ + CRYPTO_ALIGN(32) I256 u; + CRYPTO_ALIGN(16) unsigned char last_blocks[2 * 16]; + const BlockVec one = ONE128; + BlockVec final_block; + BlockVec rev_counters[PARALLEL_BLOCKS]; + BlockVec counter; + size_t i; + size_t j; + size_t left; + size_t pi; + + COMPILER_ASSERT(PC_COUNT % PARALLEL_BLOCKS == 0); + + /* Associated data */ + + if (ad != NULL && ad_len != 0) { + gh_ad_blocks(st, sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, sth, pad, sizeof pad); + } + } + + /* Encrypted data */ + + counter = REV128(LOAD128(counter_)); + i = 0; + + /* 2*PARALLEL_BLOCKS aggregation */ + + if (src_len - i >= 2 * PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; + + for (; i + 2 * PARALLEL_BLOCKS * 16 <= src_len; i += 2 * PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[2 * PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[2 * PARALLEL_BLOCKS - 1 - j]); + } + + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i + PARALLEL_BLOCKS * 16, src + i + PARALLEL_BLOCKS * 16, + rev_counters); + + pi = i; + for (j = 0; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + /* PARALLEL_BLOCKS aggregation */ + + if (src_len - i >= PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; + + for (; i + PARALLEL_BLOCKS * 16 <= src_len; i += PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + pi = i - PARALLEL_BLOCKS * 16; + u = gh_update0(sth, dst + pi, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, dst + pi + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + /* 4-blocks aggregation */ + + for (; i + 4 * 16 <= src_len; i += 4 * 16) { + counter = incr_counters(rev_counters, counter, 4); + for (j = 0; j < 4; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + + u = gh_update0(sth, dst + i, st->hx[4 - 1 - 0]); + for (j = 1; j < 4; j += 1) { + gh_update(&u, dst + i + j * 16, st->hx[4 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + /* 2-blocks aggregation */ + + for (; i + 2 * 16 <= src_len; i += 2 * 16) { + counter = incr_counters(rev_counters, counter, 2); + for (j = 0; j < 2; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + + u = gh_update0(sth, dst + i, st->hx[2 - 1 - 0]); + for (j = 1; j < 2; j += 1) { + gh_update(&u, dst + i + j * 16, st->hx[2 - 1 - j]); + } + sth->acc = gcm_reduce(u); + } + + /* Remaining *partial* blocks; if we have 16 bytes left, we want to keep the + full block authenticated along with the final block, hence < and not <= */ + + for (; i + 16 < src_len; i += 16) { + encrypt_xor_block(st, dst + i, src + i, REV128(counter)); + u = gh_update0(sth, dst + i, st->hx[1 - 1 - 0]); + sth->acc = gcm_reduce(u); + counter = ADD64x2(counter, one); + } + + /* Authenticate both the last block of the message and the final block */ + + final_block = REV128(SET64x2(ad_len * 8, src_len * 8)); + STORE32_BE(counter_ + NPUBBYTES, 1); + encrypt(st, mac, counter_); + left = src_len - i; + if (left != 0) { + for (j = 0; j < left; j++) { + last_blocks[j] = src[i + j]; + } + STORE128(last_blocks + 16, final_block); + encrypt_xor_block(st, last_blocks, last_blocks, REV128(counter)); + for (; j < 16; j++) { + last_blocks[j] = 0; + } + for (j = 0; j < left; j++) { + dst[i + j] = last_blocks[j]; + } + gh_ad_blocks(st, sth, last_blocks, 32); + } else { + STORE128(last_blocks, final_block); + gh_ad_blocks(st, sth, last_blocks, 16); + } + STORE128(mac, XOR128(LOAD128(mac), REV128(sth->acc))); +} + +/* Generic AES-GCM decryption. "Generic" as it can handle arbitrary input sizes, +unlike a length-limited version that would precompute all the required powers of H */ + +static void +aes_gcm_decrypt_generic(const State *st, GHash *sth, unsigned char mac[ABYTES], unsigned char *dst, + const unsigned char *src, size_t src_len, const unsigned char *ad, + size_t ad_len, unsigned char counter_[16]) +{ + CRYPTO_ALIGN(32) I256 u; + CRYPTO_ALIGN(16) unsigned char last_blocks[2 * 16]; + const BlockVec one = ONE128; + BlockVec final_block; + BlockVec rev_counters[PARALLEL_BLOCKS]; + BlockVec counter; + size_t i; + size_t j; + size_t left; + + COMPILER_ASSERT(PC_COUNT % PARALLEL_BLOCKS == 0); + + /* Associated data */ + + if (ad != NULL && ad_len != 0) { + gh_ad_blocks(st, sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, sth, pad, sizeof pad); + } + } + + /* Encrypted data */ + + counter = REV128(LOAD128(counter_)); + i = 0; + + /* 2*PARALLEL_BLOCKS aggregation */ + + while (i + 2 * PARALLEL_BLOCKS * 16 <= src_len) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + + u = gh_update0(sth, src + i, st->hx[2 * PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[2 * PARALLEL_BLOCKS - 1 - j]); + } + + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + + i += PARALLEL_BLOCKS * 16; + for (j = 0; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + i += PARALLEL_BLOCKS * 16; + } + + /* PARALLEL_BLOCKS aggregation */ + + for (; i + PARALLEL_BLOCKS * 16 <= src_len; i += PARALLEL_BLOCKS * 16) { + counter = incr_counters(rev_counters, counter, PARALLEL_BLOCKS); + + u = gh_update0(sth, src + i, st->hx[PARALLEL_BLOCKS - 1 - 0]); + for (j = 1; j < PARALLEL_BLOCKS; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[PARALLEL_BLOCKS - 1 - j]); + } + sth->acc = gcm_reduce(u); + + encrypt_xor_wide(st, dst + i, src + i, rev_counters); + } + + /* 4-blocks aggregation */ + + for (; i + 4 * 16 <= src_len; i += 4 * 16) { + counter = incr_counters(rev_counters, counter, 4); + + u = gh_update0(sth, src + i, st->hx[4 - 1 - 0]); + for (j = 1; j < 4; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[4 - 1 - j]); + } + sth->acc = gcm_reduce(u); + + for (j = 0; j < 4; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + } + + /* 2-blocks aggregation */ + + for (; i + 2 * 16 <= src_len; i += 2 * 16) { + counter = incr_counters(rev_counters, counter, 2); + + u = gh_update0(sth, src + i, st->hx[2 - 1 - 0]); + for (j = 1; j < 2; j += 1) { + gh_update(&u, src + i + j * 16, st->hx[2 - 1 - j]); + } + sth->acc = gcm_reduce(u); + + for (j = 0; j < 2; j++) { + encrypt_xor_block(st, dst + i + j * 16, src + i + j * 16, rev_counters[j]); + } + } + + /* Remaining *partial* blocks; if we have 16 bytes left, we want to keep the + full block authenticated along with the final block, hence < and not <= */ + + for (; i + 16 < src_len; i += 16) { + u = gh_update0(sth, src + i, st->hx[1 - 1 - 0]); + sth->acc = gcm_reduce(u); + encrypt_xor_block(st, dst + i, src + i, REV128(counter)); + counter = ADD64x2(counter, one); + } + + /* Authenticate both the last block of the message and the final block */ + + final_block = REV128(SET64x2(ad_len * 8, src_len * 8)); + STORE32_BE(counter_ + NPUBBYTES, 1); + encrypt(st, mac, counter_); + left = src_len - i; + if (left != 0) { + for (j = 0; j < left; j++) { + last_blocks[j] = src[i + j]; + } + for (; j < 16; j++) { + last_blocks[j] = 0; + } + STORE128(last_blocks + 16, final_block); + gh_ad_blocks(st, sth, last_blocks, 32); + encrypt_xor_block(st, last_blocks, last_blocks, REV128(counter)); + for (j = 0; j < left; j++) { + dst[i + j] = last_blocks[j]; + } + } else { + STORE128(last_blocks, final_block); + gh_ad_blocks(st, sth, last_blocks, 16); + } + STORE128(mac, XOR128(LOAD128(mac), REV128(sth->acc))); +} + +int +crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *st_, const unsigned char *k) +{ + State *st = (State *) (void *) st_; + CRYPTO_ALIGN(16) unsigned char h[16]; + + COMPILER_ASSERT(sizeof *st_ >= sizeof *st); + + expand256(k, st->rkeys); + memset(h, 0, sizeof h); + encrypt(st, h, h); + + precomp_for_block_count(st->hx, h, PC_COUNT); + + return 0; +} + +int +crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long m_len_, const unsigned char *ad, + unsigned long long ad_len_, + const unsigned char *nsec, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + CRYPTO_ALIGN(16) unsigned char j[16]; + size_t gh_required_blocks; + const size_t ad_len = (size_t) ad_len_; + const size_t m_len = (size_t) m_len_; + + (void) nsec; + if (maclen_p != NULL) { + *maclen_p = 0; + } + if (ad_len_ > SODIUM_SIZE_MAX || m_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + gh_required_blocks = required_blocks(ad_len, m_len); + if (gh_required_blocks == 0) { + memset(mac, 0xd0, ABYTES); + memset(c, 0, m_len); + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + aes_gcm_encrypt_generic(st, &sth, mac, c, m, m_len, ad, ad_len, j); + + if (maclen_p != NULL) { + *maclen_p = ABYTES; + } + return 0; +} + +int +crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, + unsigned long long m_len, const unsigned char *ad, + unsigned long long ad_len, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + const int ret = crypto_aead_aes256gcm_encrypt_detached(c, c + m_len, NULL, m, m_len, ad, ad_len, + nsec, npub, k); + if (clen_p != NULL) { + if (ret == 0) { + *clen_p = m_len + crypto_aead_aes256gcm_ABYTES; + } else { + *clen_p = 0; + } + } + return ret; +} + +int +crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, unsigned char *mac, + unsigned long long *maclen_p, const unsigned char *m, + unsigned long long m_len, const unsigned char *ad, + unsigned long long ad_len, const unsigned char *nsec, + const unsigned char *npub, const unsigned char *k) +{ + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; + int ret; + + PREFETCH_WRITE(c); + PREFETCH_READ(m); + PREFETCH_READ(ad); + + crypto_aead_aes256gcm_beforenm(&st, k); + ret = crypto_aead_aes256gcm_encrypt_detached_afternm(c, mac, maclen_p, m, m_len, ad, ad_len, + nsec, npub, &st); + sodium_memzero(&st, sizeof st); + + return ret; +} + +int +crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen_p, + const unsigned char *m, unsigned long long mlen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *nsec, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + int ret = crypto_aead_aes256gcm_encrypt_detached_afternm(c, c + mlen, NULL, m, mlen, ad, adlen, + nsec, npub, st_); + if (clen_p != NULL) { + *clen_p = mlen + crypto_aead_aes256gcm_ABYTES; + } + return ret; +} + +static int +crypto_aead_aes256gcm_verify_mac(unsigned char *nsec, const unsigned char *c, + unsigned long long c_len_, const unsigned char *mac, + const unsigned char *ad, unsigned long long ad_len_, + const unsigned char *npub, const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + BlockVec final_block; + CRYPTO_ALIGN(16) unsigned char j[16]; + CRYPTO_ALIGN(16) unsigned char computed_mac[16]; + CRYPTO_ALIGN(16) unsigned char last_block[16]; + size_t gh_required_blocks; + size_t left; + const size_t ad_len = (size_t) ad_len_; + const size_t c_len = (size_t) c_len_; + int ret; + + (void) nsec; + if (ad_len_ > SODIUM_SIZE_MAX || c_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + gh_required_blocks = required_blocks(ad_len, c_len); + if (gh_required_blocks == 0) { + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + gh_ad_blocks(st, &sth, ad, ad_len & ~15); + left = ad_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, ad + ad_len - left, left); + gh_ad_blocks(st, &sth, pad, sizeof pad); + } + + gh_ad_blocks(st, &sth, c, c_len & ~15); + left = c_len & 15; + if (left != 0) { + unsigned char pad[16]; + + memset(pad, 0, sizeof pad); + memcpy(pad, c + c_len - left, left); + gh_ad_blocks(st, &sth, pad, sizeof pad); + } + final_block = REV128(SET64x2(ad_len * 8, c_len * 8)); + STORE32_BE(j + NPUBBYTES, 1); + encrypt(st, computed_mac, j); + STORE128(last_block, final_block); + gh_ad_blocks(st, &sth, last_block, 16); + STORE128(computed_mac, XOR128(LOAD128(computed_mac), REV128(sth.acc))); + + ret = crypto_verify_16(mac, computed_mac); + sodium_memzero(computed_mac, sizeof computed_mac); + + return ret; +} + +int +crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long c_len_, + const unsigned char *mac, const unsigned char *ad, + unsigned long long ad_len_, + const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + const State *st = (const State *) (const void *) st_; + GHash sth; + CRYPTO_ALIGN(16) unsigned char j[16]; + unsigned char computed_mac[16]; + size_t gh_required_blocks; + const size_t ad_len = (size_t) ad_len_; + const size_t c_len = (size_t) c_len_; + const size_t m_len = c_len; + + (void) nsec; + if (ad_len_ > SODIUM_SIZE_MAX || c_len_ > SODIUM_SIZE_MAX) { + sodium_misuse(); + } + if (m == NULL) { + return crypto_aead_aes256gcm_verify_mac(nsec, c, c_len, mac, ad, ad_len, npub, st_); + } + gh_required_blocks = required_blocks(ad_len, m_len); + if (gh_required_blocks == 0) { + return -1; + } + + gh_init(&sth); + + memcpy(j, npub, NPUBBYTES); + STORE32_BE(j + NPUBBYTES, 2); + + aes_gcm_decrypt_generic(st, &sth, computed_mac, m, c, m_len, ad, ad_len, j); + + if (crypto_verify_16(mac, computed_mac) != 0) { + sodium_memzero(computed_mac, sizeof computed_mac); + memset(m, 0xd0, m_len); + return -1; + } + return 0; +} + +int +crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long *mlen_p, + unsigned char *nsec, const unsigned char *c, + unsigned long long clen, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const crypto_aead_aes256gcm_state *st_) +{ + unsigned long long mlen = 0ULL; + int ret = -1; + + if (clen >= ABYTES) { + ret = crypto_aead_aes256gcm_decrypt_detached_afternm( + m, nsec, c, clen - ABYTES, c + clen - ABYTES, ad, adlen, npub, st_); + } + if (mlen_p != NULL) { + if (ret == 0) { + mlen = clen - ABYTES; + } + *mlen_p = mlen; + } + return ret; +} + +int +crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *mac, const unsigned char *ad, + unsigned long long adlen, const unsigned char *npub, + const unsigned char *k) +{ + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; + + PREFETCH_WRITE(m); + PREFETCH_READ(c); + PREFETCH_READ(ad); + + crypto_aead_aes256gcm_beforenm(&st, k); + + return crypto_aead_aes256gcm_decrypt_detached_afternm( + m, nsec, c, clen, mac, ad, adlen, npub, (const crypto_aead_aes256gcm_state *) &st); +} + +int +crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, + const unsigned char *c, unsigned long long clen, + const unsigned char *ad, unsigned long long adlen, + const unsigned char *npub, const unsigned char *k) +{ + CRYPTO_ALIGN(16) crypto_aead_aes256gcm_state st; + int ret; + + PREFETCH_WRITE(m); + PREFETCH_READ(c); + PREFETCH_READ(ad); + + crypto_aead_aes256gcm_beforenm(&st, k); + + ret = crypto_aead_aes256gcm_decrypt_afternm(m, mlen_p, nsec, c, clen, ad, adlen, npub, + (const crypto_aead_aes256gcm_state *) &st); + sodium_memzero(&st, sizeof st); + + return ret; +} + +int +crypto_aead_aes256gcm_is_available(void) +{ + return sodium_runtime_has_armcrypto(); +} + +#ifdef __clang__ +#pragma clang attribute pop +#endif + +#endif diff --git a/src/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c b/src/libsodium/src/libsodium/crypto_aead/chacha20poly1305/aead_chacha20poly1305.c similarity index 100% rename from src/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c rename to src/libsodium/src/libsodium/crypto_aead/chacha20poly1305/aead_chacha20poly1305.c diff --git a/src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c b/src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c similarity index 100% rename from src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c rename to src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c diff --git a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c index 425b5501c..8129d8be9 100644 --- a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +++ b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c @@ -293,7 +293,6 @@ ge25519_frombytes(ge25519_p3 *h, const unsigned char *s) { fe25519 u; fe25519 v; - fe25519 v3; fe25519 vxx; fe25519 m_root_check, p_root_check; fe25519 negx; @@ -307,15 +306,9 @@ ge25519_frombytes(ge25519_p3 *h, const unsigned char *s) fe25519_sub(u, u, h->Z); /* u = y^2-1 */ fe25519_add(v, v, h->Z); /* v = dy^2+1 */ - fe25519_sq(v3, v); - fe25519_mul(v3, v3, v); /* v3 = v^3 */ - fe25519_sq(h->X, v3); - fe25519_mul(h->X, h->X, v); - fe25519_mul(h->X, h->X, u); /* x = uv^7 */ - - fe25519_pow22523(h->X, h->X); /* x = (uv^7)^((q-5)/8) */ - fe25519_mul(h->X, h->X, v3); - fe25519_mul(h->X, h->X, u); /* x = uv^3(uv^7)^((q-5)/8) */ + fe25519_mul(h->X, u, v); + fe25519_pow22523(h->X, h->X); + fe25519_mul(h->X, u, h->X); /* u((uv)^((q-5)/8)) */ fe25519_sq(vxx, h->X); fe25519_mul(vxx, vxx, v); @@ -2519,6 +2512,21 @@ sc25519_is_canonical(const unsigned char s[32]) return (c != 0); } +/* multiply by the cofactor */ +static void +ge25519_clear_cofactor(ge25519_p3 *p3) +{ + ge25519_p1p1 p1; + ge25519_p2 p2; + + ge25519_p3_dbl(&p1, p3); + ge25519_p1p1_to_p2(&p2, &p1); + ge25519_p2_dbl(&p1, &p2); + ge25519_p1p1_to_p2(&p2, &p1); + ge25519_p2_dbl(&p1, &p2); + ge25519_p1p1_to_p3(p3, &p1); +} + static void ge25519_elligator2(unsigned char s[32], const fe25519 r, const unsigned char x_sign) { @@ -2527,8 +2535,6 @@ ge25519_elligator2(unsigned char s[32], const fe25519 r, const unsigned char x_s fe25519 rr2; fe25519 x, x2, x3; ge25519_p3 p3; - ge25519_p1p1 p1; - ge25519_p2 p2; unsigned int notsquare; fe25519_sq2(rr2, r); @@ -2572,14 +2578,7 @@ ge25519_elligator2(unsigned char s[32], const fe25519 r, const unsigned char x_s abort(); /* LCOV_EXCL_LINE */ } - /* multiply by the cofactor */ - ge25519_p3_dbl(&p1, &p3); - ge25519_p1p1_to_p2(&p2, &p1); - ge25519_p2_dbl(&p1, &p2); - ge25519_p1p1_to_p2(&p2, &p1); - ge25519_p2_dbl(&p1, &p2); - ge25519_p1p1_to_p3(&p3, &p1); - + ge25519_clear_cofactor(&p3); ge25519_p3_tobytes(s, &p3); } diff --git a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h index f216669e4..9e11afd11 100644 --- a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h +++ b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h @@ -1,5 +1,5 @@ /* - Ignores top bit of h. + Ignores top bit of s. */ void diff --git a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h index de876264c..be7d18129 100644 --- a/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h +++ b/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h @@ -1,5 +1,5 @@ /* - Ignores top bit of h. + Ignores top bit of s. */ void diff --git a/src/libsodium/src/libsodium/crypto_core/softaes/softaes.c b/src/libsodium/src/libsodium/crypto_core/softaes/softaes.c new file mode 100644 index 000000000..ae469c8ac --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_core/softaes/softaes.c @@ -0,0 +1,143 @@ +#include +#include +#include +#include + +#include "private/common.h" +#include "private/softaes.h" + +uint32_t _aes_lut[256] __attribute__ ((visibility ("hidden"))) = { + 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, + 0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec, + 0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa, 0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb, + 0xecadad41, 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453, 0x967272e4, 0x5bc0c09b, + 0xc2b7b775, 0x1cfdfde1, 0xae93933d, 0x6a26264c, 0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83, + 0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9, 0x937171e2, 0x73d8d8ab, 0x53313162, 0x3f15152a, + 0x0c040408, 0x52c7c795, 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637, 0x0f05050a, 0xb59a9a2f, + 0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df, 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, + 0x1b090912, 0x9e83831d, 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, 0xee5a5ab4, 0xfba0a05b, + 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, 0xceb3b37d, 0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413, + 0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1, 0x60202040, 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, + 0xbe6a6ad4, 0x46cbcb8d, 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, 0x4acfcf85, + 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, 0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511, + 0xcf45458a, 0x10f9f9e9, 0x06020204, 0x817f7ffe, 0xf05050a0, 0x443c3c78, 0xba9f9f25, 0xe3a8a84b, + 0xf35151a2, 0xfea3a35d, 0xc0404080, 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1, + 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf, + 0x4ccdcd81, 0x140c0c18, 0x35131326, 0x2fececc3, 0xe15f5fbe, 0xa2979735, 0xcc444488, 0x3917172e, + 0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a, 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6, + 0xa06060c0, 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54, 0xab90903b, 0x8388880b, + 0xca46468c, 0x29eeeec7, 0xd3b8b86b, 0x3c141428, 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, + 0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, 0x0a06060c, 0x6c242448, 0xe45c5cb8, + 0x5dc2c29f, 0x6ed3d3bd, 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531, 0x37e4e4d3, 0x8b7979f2, + 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda, 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, + 0xb46c6cd8, 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, 0xe9aeae47, 0x18080810, + 0xd5baba6f, 0x887878f0, 0x6f25254a, 0x722e2e5c, 0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697, + 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e, 0xdd4b4b96, 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, + 0x907070e0, 0x423e3e7c, 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x05030306, 0x01f6f6f7, 0x120e0e1c, + 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, 0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27, + 0x38e1e1d9, 0x13f8f8eb, 0xb398982b, 0x33111122, 0xbb6969d2, 0x70d9d9a9, 0x898e8e07, 0xa7949433, + 0xb69b9b2d, 0x221e1e3c, 0x92878715, 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5, + 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, 0x31e6e6d7, 0xc6424284, 0xb86868d0, + 0xc3414182, 0xb0999929, 0x772d2d5a, 0x110f0f1e, 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, 0x3a16162c +}; + +static const uint32_t * const LUT = _aes_lut; + +#ifndef SOFTAES_STRIDE +# ifdef FAVOR_PERFORMANCE +# define SOFTAES_STRIDE 256 +# else +# define SOFTAES_STRIDE 16 +# endif +#endif + +static SoftAesBlock +_encrypt(const uint8_t ix0[4], const uint8_t ix1[4], const uint8_t ix2[4], const uint8_t ix3[4]) +{ + CRYPTO_ALIGN(64) uint32_t t[4][4][256 / SOFTAES_STRIDE]; + CRYPTO_ALIGN(64) uint8_t of[4][4]; + CRYPTO_ALIGN(64) SoftAesBlock out; + size_t i; + size_t j; + + for (j = 0; j < 4; j++) { + of[j][0] = ix0[j] % SOFTAES_STRIDE; + of[j][1] = ix1[j] % SOFTAES_STRIDE; + of[j][2] = ix2[j] % SOFTAES_STRIDE; + of[j][3] = ix3[j] % SOFTAES_STRIDE; + } + for (i = 0; i < 256 / SOFTAES_STRIDE; i++) { + for (j = 0; j < 4; j++) { + t[j][0][i] = LUT[(i * SOFTAES_STRIDE) | of[j][0]]; + t[j][1][i] = LUT[(i * SOFTAES_STRIDE) | of[j][1]]; + t[j][2][i] = LUT[(i * SOFTAES_STRIDE) | of[j][2]]; + t[j][3][i] = LUT[(i * SOFTAES_STRIDE) | of[j][3]]; + } + } + +#ifdef HAVE_INLINE_ASM + __asm__ __volatile__("" : : "r"(t) : "memory"); +#endif + + out.w0 = t[0][0][ix0[0] / SOFTAES_STRIDE]; + out.w0 ^= ROTL32(t[0][1][ix1[0] / SOFTAES_STRIDE], 8); + out.w0 ^= ROTL32(t[0][2][ix2[0] / SOFTAES_STRIDE], 16); + out.w0 ^= ROTL32(t[0][3][ix3[0] / SOFTAES_STRIDE], 24); + + out.w1 = t[1][0][ix0[1] / SOFTAES_STRIDE]; + out.w1 ^= ROTL32(t[1][1][ix1[1] / SOFTAES_STRIDE], 8); + out.w1 ^= ROTL32(t[1][2][ix2[1] / SOFTAES_STRIDE], 16); + out.w1 ^= ROTL32(t[1][3][ix3[1] / SOFTAES_STRIDE], 24); + + out.w2 = t[2][0][ix0[2] / SOFTAES_STRIDE]; + out.w2 ^= ROTL32(t[2][1][ix1[2] / SOFTAES_STRIDE], 8); + out.w2 ^= ROTL32(t[2][2][ix2[2] / SOFTAES_STRIDE], 16); + out.w2 ^= ROTL32(t[2][3][ix3[2] / SOFTAES_STRIDE], 24); + + out.w3 = t[3][0][ix0[3] / SOFTAES_STRIDE]; + out.w3 ^= ROTL32(t[3][1][ix1[3] / SOFTAES_STRIDE], 8); + out.w3 ^= ROTL32(t[3][2][ix2[3] / SOFTAES_STRIDE], 16); + out.w3 ^= ROTL32(t[3][3][ix3[3] / SOFTAES_STRIDE], 24); + + return out; +} + +SoftAesBlock +softaes_block_encrypt(const SoftAesBlock block, const SoftAesBlock rk) +{ + CRYPTO_ALIGN(64) SoftAesBlock out; + CRYPTO_ALIGN(64) uint8_t ix0[4], ix1[4], ix2[4], ix3[4]; + const uint32_t s0 = block.w0; + const uint32_t s1 = block.w1; + const uint32_t s2 = block.w2; + const uint32_t s3 = block.w3; + + ix0[0] = (uint8_t) s0; + ix0[1] = (uint8_t) s1; + ix0[2] = (uint8_t) s2; + ix0[3] = (uint8_t) s3; + + ix1[0] = (uint8_t) (s1 >> 8); + ix1[1] = (uint8_t) (s2 >> 8); + ix1[2] = (uint8_t) (s3 >> 8); + ix1[3] = (uint8_t) (s0 >> 8); + + ix2[0] = (uint8_t) (s2 >> 16); + ix2[1] = (uint8_t) (s3 >> 16); + ix2[2] = (uint8_t) (s0 >> 16); + ix2[3] = (uint8_t) (s1 >> 16); + + ix3[0] = (uint8_t) (s3 >> 24); + ix3[1] = (uint8_t) (s0 >> 24); + ix3[2] = (uint8_t) (s1 >> 24); + ix3[3] = (uint8_t) (s2 >> 24); + + out = _encrypt(ix0, ix1, ix2, ix3); + + out.w0 ^= rk.w0; + out.w1 ^= rk.w1; + out.w2 ^= rk.w2; + out.w3 ^= rk.w3; + + return out; +} diff --git a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c index 4945462d4..3152e286a 100644 --- a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c +++ b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c @@ -12,11 +12,10 @@ #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") -# pragma GCC target("avx2") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1,avx2") # endif # include @@ -46,4 +45,8 @@ blake2b_compress_avx2(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES]) return 0; } +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c index f085c6153..ecab71644 100644 --- a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c +++ b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c @@ -11,10 +11,10 @@ #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && \ defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1") # endif # include @@ -84,4 +84,8 @@ blake2b_compress_sse41(blake2b_state *S, return 0; } +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h index ac78e5bb1..c4c93f779 100644 --- a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h +++ b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h @@ -5,6 +5,8 @@ #define LOADU(p) _mm_loadu_si128((const __m128i *) (const void *) (p)) #define STOREU(p, r) _mm_storeu_si128((__m128i *) (void *) (p), r) +#if !(defined(_mm_roti_epi64) && defined(__XOP__)) +#undef _mm_roti_epi64 #define _mm_roti_epi64(x, c) \ (-(c) == 32) \ ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2, 3, 0, 1)) \ @@ -17,6 +19,7 @@ _mm_add_epi64((x), (x))) \ : _mm_xor_si128(_mm_srli_epi64((x), -(c)), \ _mm_slli_epi64((x), 64 - (-(c)))) +#endif #define G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1) \ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ diff --git a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c index 6372da03e..8d0e3e9da 100644 --- a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c +++ b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c @@ -7,9 +7,10 @@ #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3") # endif # include @@ -87,4 +88,8 @@ blake2b_compress_ssse3(blake2b_state *S, return 0; } +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h index 9a7164fe2..9b96b8f97 100644 --- a/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h +++ b/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h @@ -5,6 +5,8 @@ #define LOADU(p) _mm_loadu_si128((const __m128i *) (const void *) (p)) #define STOREU(p, r) _mm_storeu_si128((__m128i *) (void *) (p), r) +#if !(defined(_mm_roti_epi64) && defined(__XOP__)) +#undef _mm_roti_epi64 #define _mm_roti_epi64(x, c) \ (-(c) == 32) \ ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2, 3, 0, 1)) \ @@ -17,6 +19,7 @@ _mm_add_epi64((x), (x))) \ : _mm_xor_si128(_mm_srli_epi64((x), -(c)), \ _mm_slli_epi64((x), 64 - (-(c)))) +#endif #define G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1) \ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \ diff --git a/src/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c b/src/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c index 264054f98..394c39141 100644 --- a/src/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +++ b/src/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c @@ -156,6 +156,7 @@ SHA256_Pad(crypto_hash_sha256_state *state, uint32_t tmp32[64 + 8]) unsigned int r; unsigned int i; + ACQUIRE_FENCE; r = (unsigned int) ((state->count >> 3) & 0x3f); if (r < 56) { for (i = 0; i < 56 - r; i++) { @@ -197,6 +198,7 @@ crypto_hash_sha256_update(crypto_hash_sha256_state *state, if (inlen <= 0U) { return 0; } + ACQUIRE_FENCE; r = (unsigned long long) ((state->count >> 3) & 0x3f); state->count += ((uint64_t) inlen) << 3; diff --git a/src/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c b/src/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c index 8e0f36fb6..a36841b98 100644 --- a/src/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +++ b/src/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c @@ -175,6 +175,7 @@ SHA512_Pad(crypto_hash_sha512_state *state, uint64_t tmp64[80 + 8]) unsigned int r; unsigned int i; + ACQUIRE_FENCE; r = (unsigned int) ((state->count[1] >> 3) & 0x7f); if (r < 112) { for (i = 0; i < 112 - r; i++) { @@ -218,6 +219,7 @@ crypto_hash_sha512_update(crypto_hash_sha512_state *state, if (inlen <= 0U) { return 0; } + ACQUIRE_FENCE; r = (unsigned long long) ((state->count[1] >> 3) & 0x7f); bitlen[1] = ((uint64_t) inlen) << 3; diff --git a/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c b/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c new file mode 100644 index 000000000..8eb7c878a --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c @@ -0,0 +1,123 @@ +#include +#include + +#include "crypto_auth_hmacsha256.h" +#include "crypto_kdf.h" +#include "crypto_kdf_hkdf_sha256.h" +#include "randombytes.h" +#include "utils.h" + +int +crypto_kdf_hkdf_sha256_extract_init(crypto_kdf_hkdf_sha256_state *state, + const unsigned char *salt, size_t salt_len) +{ + return crypto_auth_hmacsha256_init(&state->st, salt, salt_len); +} + +int +crypto_kdf_hkdf_sha256_extract_update(crypto_kdf_hkdf_sha256_state *state, + const unsigned char *ikm, size_t ikm_len) +{ + return crypto_auth_hmacsha256_update(&state->st, ikm, ikm_len); +} + +int +crypto_kdf_hkdf_sha256_extract_final(crypto_kdf_hkdf_sha256_state *state, + unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]) +{ + crypto_auth_hmacsha256_final(&state->st, prk); + sodium_memzero(state, sizeof state); + + return 0; +} + +int +crypto_kdf_hkdf_sha256_extract( + unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES], + const unsigned char *salt, size_t salt_len, const unsigned char *ikm, + size_t ikm_len) +{ + crypto_kdf_hkdf_sha256_state state; + + crypto_kdf_hkdf_sha256_extract_init(&state, salt, salt_len); + crypto_kdf_hkdf_sha256_extract_update(&state, ikm, ikm_len); + + return crypto_kdf_hkdf_sha256_extract_final(&state, prk); +} + +void +crypto_kdf_hkdf_sha256_keygen(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]) +{ + randombytes_buf(prk, crypto_kdf_hkdf_sha256_KEYBYTES); +} + +int +crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len, + const char *ctx, size_t ctx_len, + const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]) +{ + crypto_auth_hmacsha256_state st; + unsigned char tmp[crypto_auth_hmacsha256_BYTES]; + size_t i; + size_t left; + unsigned char counter = 1U; + + if (out_len > crypto_kdf_hkdf_sha256_BYTES_MAX) { + errno = EINVAL; + return -1; + } + for (i = (size_t) 0U; i + crypto_auth_hmacsha256_BYTES <= out_len; + i += crypto_auth_hmacsha256_BYTES) { + crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES); + if (i != (size_t) 0U) { + crypto_auth_hmacsha256_update(&st, + &out[i - crypto_auth_hmacsha256_BYTES], + crypto_auth_hmacsha256_BYTES); + } + crypto_auth_hmacsha256_update(&st, + (const unsigned char *) ctx, ctx_len); + crypto_auth_hmacsha256_update(&st, &counter, (size_t) 1U); + crypto_auth_hmacsha256_final(&st, &out[i]); + counter++; + } + if ((left = out_len & (crypto_auth_hmacsha256_BYTES - 1U)) != (size_t) 0U) { + crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES); + if (i != (size_t) 0U) { + crypto_auth_hmacsha256_update(&st, + &out[i - crypto_auth_hmacsha256_BYTES], + crypto_auth_hmacsha256_BYTES); + } + crypto_auth_hmacsha256_update(&st, + (const unsigned char *) ctx, ctx_len); + crypto_auth_hmacsha256_update(&st, &counter, (size_t) 1U); + crypto_auth_hmacsha256_final(&st, tmp); + memcpy(&out[i], tmp, left); + sodium_memzero(tmp, sizeof tmp); + } + sodium_memzero(&st, sizeof st); + + return 0; +} + +size_t +crypto_kdf_hkdf_sha256_keybytes(void) +{ + return crypto_kdf_hkdf_sha256_KEYBYTES; +} + +size_t +crypto_kdf_hkdf_sha256_bytes_min(void) +{ + return crypto_kdf_hkdf_sha256_BYTES_MIN; +} + +size_t +crypto_kdf_hkdf_sha256_bytes_max(void) +{ + return crypto_kdf_hkdf_sha256_BYTES_MAX; +} + +size_t crypto_kdf_hkdf_sha256_statebytes(void) +{ + return sizeof(crypto_kdf_hkdf_sha256_state); +} diff --git a/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c b/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c new file mode 100644 index 000000000..cb3735fee --- /dev/null +++ b/src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c @@ -0,0 +1,123 @@ +#include +#include + +#include "crypto_auth_hmacsha512.h" +#include "crypto_kdf.h" +#include "crypto_kdf_hkdf_sha512.h" +#include "randombytes.h" +#include "utils.h" + +int +crypto_kdf_hkdf_sha512_extract_init(crypto_kdf_hkdf_sha512_state *state, + const unsigned char *salt, size_t salt_len) +{ + return crypto_auth_hmacsha512_init(&state->st, salt, salt_len); +} + +int +crypto_kdf_hkdf_sha512_extract_update(crypto_kdf_hkdf_sha512_state *state, + const unsigned char *ikm, size_t ikm_len) +{ + return crypto_auth_hmacsha512_update(&state->st, ikm, ikm_len); +} + +int +crypto_kdf_hkdf_sha512_extract_final(crypto_kdf_hkdf_sha512_state *state, + unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) +{ + crypto_auth_hmacsha512_final(&state->st, prk); + sodium_memzero(state, sizeof state); + + return 0; +} + +int +crypto_kdf_hkdf_sha512_extract( + unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES], + const unsigned char *salt, size_t salt_len, const unsigned char *ikm, + size_t ikm_len) +{ + crypto_kdf_hkdf_sha512_state state; + + crypto_kdf_hkdf_sha512_extract_init(&state, salt, salt_len); + crypto_kdf_hkdf_sha512_extract_update(&state, ikm, ikm_len); + + return crypto_kdf_hkdf_sha512_extract_final(&state, prk); +} + +void +crypto_kdf_hkdf_sha512_keygen(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) +{ + randombytes_buf(prk, crypto_kdf_hkdf_sha512_KEYBYTES); +} + +int +crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len, + const char *ctx, size_t ctx_len, + const unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) +{ + crypto_auth_hmacsha512_state st; + unsigned char tmp[crypto_auth_hmacsha512_BYTES]; + size_t i; + size_t left; + unsigned char counter = 1U; + + if (out_len > crypto_kdf_hkdf_sha512_BYTES_MAX) { + errno = EINVAL; + return -1; + } + for (i = (size_t) 0U; i + crypto_auth_hmacsha512_BYTES <= out_len; + i += crypto_auth_hmacsha512_BYTES) { + crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES); + if (i != (size_t) 0U) { + crypto_auth_hmacsha512_update(&st, + &out[i - crypto_auth_hmacsha512_BYTES], + crypto_auth_hmacsha512_BYTES); + } + crypto_auth_hmacsha512_update(&st, + (const unsigned char *) ctx, ctx_len); + crypto_auth_hmacsha512_update(&st, &counter, (size_t) 1U); + crypto_auth_hmacsha512_final(&st, &out[i]); + counter++; + } + if ((left = out_len & (crypto_auth_hmacsha512_BYTES - 1U)) != (size_t) 0U) { + crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES); + if (i != (size_t) 0U) { + crypto_auth_hmacsha512_update(&st, + &out[i - crypto_auth_hmacsha512_BYTES], + crypto_auth_hmacsha512_BYTES); + } + crypto_auth_hmacsha512_update(&st, + (const unsigned char *) ctx, ctx_len); + crypto_auth_hmacsha512_update(&st, &counter, (size_t) 1U); + crypto_auth_hmacsha512_final(&st, tmp); + memcpy(&out[i], tmp, left); + sodium_memzero(tmp, sizeof tmp); + } + sodium_memzero(&st, sizeof st); + + return 0; +} + +size_t +crypto_kdf_hkdf_sha512_keybytes(void) +{ + return crypto_kdf_hkdf_sha512_KEYBYTES; +} + +size_t +crypto_kdf_hkdf_sha512_bytes_min(void) +{ + return crypto_kdf_hkdf_sha512_BYTES_MIN; +} + +size_t +crypto_kdf_hkdf_sha512_bytes_max(void) +{ + return crypto_kdf_hkdf_sha512_BYTES_MAX; +} + +size_t crypto_kdf_hkdf_sha512_statebytes(void) +{ + return sizeof(crypto_kdf_hkdf_sha512_state); +} diff --git a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h index cef644804..ed5250080 100644 --- a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +++ b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h @@ -122,7 +122,7 @@ poly1305_blocks(poly1305_state_internal_t *st, const unsigned char *m, h4 = (unsigned long) d4 & 0x3ffffff; h0 += c * 5; c = (h0 >> 26); - h0 = h0 & 0x3ffffff; + h0 &= 0x3ffffff; h1 += c; m += poly1305_block_size; diff --git a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h index 2475bfa1a..046ab09a7 100644 --- a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +++ b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h @@ -120,7 +120,7 @@ poly1305_blocks(poly1305_state_internal_t *st, const unsigned char *m, h2 = LO(d2) & 0x3ffffffffff; h0 += c * 5; c = (h0 >> 44); - h0 = h0 & 0xfffffffffff; + h0 &= 0xfffffffffff; h1 += c; m += poly1305_block_size; diff --git a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c index aa81777e7..0576c86ef 100644 --- a/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +++ b/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c @@ -10,7 +10,9 @@ #if defined(HAVE_TI_MODE) && defined(HAVE_EMMINTRIN_H) -# ifdef __GNUC__ +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2"))), apply_to = function) +# elif defined(__GNUC__) # pragma GCC target("sse2") # endif @@ -41,14 +43,14 @@ typedef struct poly1305_state_internal_t { union { uint64_t h[3]; uint32_t hh[10]; - } H; /* 40 bytes */ - uint32_t R[5]; /* 20 bytes */ - uint32_t R2[5]; /* 20 bytes */ - uint32_t R4[5]; /* 20 bytes */ - uint64_t pad[2]; /* 16 bytes */ - uint64_t flags; /* 8 bytes */ - unsigned long long leftover; /* 8 bytes */ - unsigned char buffer[poly1305_block_size]; /* 32 bytes */ + } H; /* 40 bytes */ + uint32_t R[5]; /* 20 bytes */ + uint32_t R2[5]; /* 20 bytes */ + uint32_t R4[5]; /* 20 bytes */ + uint64_t pad[2]; /* 16 bytes */ + uint64_t flags; /* 8 bytes */ + unsigned long long leftover; /* 8 bytes */ + unsigned char buffer[poly1305_block_size]; /* 32 bytes */ } poly1305_state_internal_t; /* 164 bytes total */ /* @@ -946,4 +948,8 @@ struct crypto_onetimeauth_poly1305_implementation SODIUM_C99(.onetimeauth_final =) crypto_onetimeauth_poly1305_sse2_final }; +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c index a35e1f910..5c7956632 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c @@ -22,11 +22,10 @@ #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") -# pragma GCC target("avx2") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1,avx2") # endif # ifdef _MSC_VER @@ -236,4 +235,9 @@ argon2_fill_segment_avx2(const argon2_instance_t *instance, } } } + +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c index 6566804ec..ea20fa83f 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c @@ -22,12 +22,14 @@ #if defined(HAVE_AVX512FINTRIN_H) && defined(HAVE_AVX2INTRIN_H) && \ defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") -# pragma GCC target("avx2") -# pragma GCC target("avx512f") +# ifdef __clang__ +# if __clang_major__ >= 18 +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2,avx512f,evex512"))), apply_to = function) +# else +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2,avx512f"))), apply_to = function) +# endif +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1,avx2,avx512f") # endif # ifdef _MSC_VER @@ -241,4 +243,9 @@ argon2_fill_segment_avx512f(const argon2_instance_t *instance, } } } + +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c index fc85a4787..1930bc35f 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c @@ -21,9 +21,10 @@ #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3") # endif # ifdef _MSC_VER @@ -235,4 +236,9 @@ argon2_fill_segment_ssse3(const argon2_instance_t *instance, } } } + +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c index c6277fc8e..4d69f1177 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c @@ -17,6 +17,7 @@ #include #include +#include "randombytes.h" #include "utils.h" #include "argon2-core.h" @@ -93,6 +94,10 @@ argon2_hash(const uint32_t t_cost, const uint32_t m_cost, int result; uint8_t *out; + if (hash != NULL) { + randombytes_buf(hash, hashlen); + } + if (pwdlen > ARGON2_MAX_PWD_LENGTH) { return ARGON2_PWD_TOO_LONG; } @@ -256,7 +261,7 @@ argon2_verify(const char *encoded, const void *pwd, const size_t pwdlen, free(ctx.ad); free(ctx.salt); - if (ret != ARGON2_OK || sodium_memcmp(out, ctx.out, ctx.outlen) != 0) { + if (ret == ARGON2_OK && sodium_memcmp(out, ctx.out, ctx.outlen) != 0) { ret = ARGON2_VERIFY_MISMATCH; } free(out); diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h b/src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h index 98a47b93f..5134b67c6 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h @@ -8,6 +8,9 @@ (_mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9)) #define r24 \ (_mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10)) + +#if !(defined(_mm_roti_epi64) && defined(__XOP__)) +#undef _mm_roti_epi64 #define _mm_roti_epi64(x, c) \ (-(c) == 32) \ ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2, 3, 0, 1)) \ @@ -20,6 +23,7 @@ _mm_add_epi64((x), (x))) \ : _mm_xor_si128(_mm_srli_epi64((x), -(c)), \ _mm_slli_epi64((x), 64 - (-(c)))) +#endif static inline __m128i fBlaMka(__m128i x, __m128i y) diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c index f9e9a3909..8e17c5b2f 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c @@ -214,8 +214,8 @@ crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], } int -crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], - const char *const passwd, +crypto_pwhash_argon2i_str_verify(const char * str, + const char * const passwd, unsigned long long passwdlen) { int verify_ret; @@ -280,14 +280,14 @@ _needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit, } int -crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES], +crypto_pwhash_argon2i_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { return _needs_rehash(str, opslimit, memlimit, Argon2_i); } int -crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES], +crypto_pwhash_argon2id_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { return _needs_rehash(str, opslimit, memlimit, Argon2_id); diff --git a/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c b/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c index d641a6172..e08be0a8e 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c @@ -210,8 +210,8 @@ crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES], } int -crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES], - const char *const passwd, +crypto_pwhash_argon2id_str_verify(const char * str, + const char * const passwd, unsigned long long passwdlen) { int verify_ret; diff --git a/src/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c b/src/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c index a229b9f79..fde099a62 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c @@ -172,7 +172,7 @@ crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES], } int -crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], +crypto_pwhash_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) { @@ -190,7 +190,7 @@ crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], } int -crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES], +crypto_pwhash_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { if (strncmp(str, crypto_pwhash_argon2id_STRPREFIX, diff --git a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c index c4dd46a28..65aebb11b 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c @@ -24,6 +24,7 @@ #include "crypto_pwhash_scryptsalsa208sha256.h" #include "crypto_scrypt.h" #include "private/common.h" +#include "randombytes.h" #include "runtime.h" #include "utils.h" @@ -150,6 +151,10 @@ escrypt_r(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen, uint32_t r; uint32_t p; + if (buf != NULL) { + randombytes_buf(buf, buflen); + } + src = escrypt_parse_setting(setting, &N_log2, &r, &p); if (!src) { return NULL; diff --git a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h index eee7b8b1f..1224c0f13 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +++ b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h @@ -34,12 +34,6 @@ #include #include -#if SIZE_MAX > 0xffffffffULL -#define ARCH_BITS 64 -#else -#define ARCH_BITS 32 -#endif - #define crypto_pwhash_scryptsalsa208sha256_STRPREFIXBYTES 14 #define crypto_pwhash_scryptsalsa208sha256_STRSETTINGBYTES 57 #define crypto_pwhash_scryptsalsa208sha256_STRSALTBYTES 32 diff --git a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c index 9f5b9a5e2..9ecaf52f5 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c @@ -39,71 +39,19 @@ #include "private/common.h" static inline void -blkcpy_64(escrypt_block_t *dest, const escrypt_block_t *src) +blkcpy(uint32_t *dest, const uint32_t *src, size_t len) { - int i; - -#if (ARCH_BITS == 32) - for (i = 0; i < 16; ++i) { - dest->w[i] = src->w[i]; - } -#else - for (i = 0; i < 8; ++i) { - dest->d[i] = src->d[i]; - } -#endif -} - -static inline void -blkxor_64(escrypt_block_t *dest, const escrypt_block_t *src) -{ - int i; - -#if (ARCH_BITS == 32) - for (i = 0; i < 16; ++i) { - dest->w[i] ^= src->w[i]; - } -#else - for (i = 0; i < 8; ++i) { - dest->d[i] ^= src->d[i]; - } -#endif + memcpy(dest, src, len * 64); } static inline void -blkcpy(escrypt_block_t *dest, const escrypt_block_t *src, size_t len) +blkxor(uint32_t *dest, const uint32_t *src, size_t len) { - size_t i, L; - -#if (ARCH_BITS == 32) - L = (len >> 2); - for (i = 0; i < L; ++i) { - dest->w[i] = src->w[i]; - } -#else - L = (len >> 3); - for (i = 0; i < L; ++i) { - dest->d[i] = src->d[i]; - } -#endif -} - -static inline void -blkxor(escrypt_block_t *dest, const escrypt_block_t *src, size_t len) -{ - size_t i, L; + size_t i; -#if (ARCH_BITS == 32) - L = (len >> 2); - for (i = 0; i < L; ++i) { - dest->w[i] ^= src->w[i]; + for (i = 0; i < len * 16; i++) { + dest[i] ^= src[i]; } -#else - L = (len >> 3); - for (i = 0; i < L; ++i) { - dest->d[i] ^= src->d[i]; - } -#endif } /* @@ -113,11 +61,10 @@ blkxor(escrypt_block_t *dest, const escrypt_block_t *src, size_t len) static void salsa20_8(uint32_t B[16]) { - escrypt_block_t X; - uint32_t *x = X.w; - size_t i; + uint32_t x[16]; + size_t i; - blkcpy_64(&X, (escrypt_block_t *) B); + blkcpy(x, B, 1); for (i = 0; i < 8; i += 2) { #define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) /* Operate on columns. */ @@ -181,30 +128,25 @@ blockmix_salsa8(const uint32_t *Bin, uint32_t *Bout, uint32_t *X, size_t r) size_t i; /* 1: X <-- B_{2r - 1} */ - blkcpy_64((escrypt_block_t *) X, - (const escrypt_block_t *) &Bin[(2 * r - 1) * 16]); + blkcpy(X, &Bin[(2 * r - 1) * 16], 1); /* 2: for i = 0 to 2r - 1 do */ for (i = 0; i < 2 * r; i += 2) { /* 3: X <-- H(X \xor B_i) */ - blkxor_64((escrypt_block_t *) X, - (const escrypt_block_t *) &Bin[i * 16]); + blkxor(X, &Bin[i * 16], 1); salsa20_8(X); /* 4: Y_i <-- X */ /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ - blkcpy_64((escrypt_block_t *) &Bout[i * 8], - (const escrypt_block_t *) X); + blkcpy(&Bout[i * 8], X, 1); /* 3: X <-- H(X \xor B_i) */ - blkxor_64((escrypt_block_t *) X, - (const escrypt_block_t *) &Bin[i * 16 + 16]); + blkxor(X, &Bin[i * 16 + 16], 1); salsa20_8(X); /* 4: Y_i <-- X */ /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ - blkcpy_64((escrypt_block_t *) &Bout[i * 8 + r * 16], - (escrypt_block_t *) X); + blkcpy(&Bout[i * 8 + r * 16], X, 1); } } @@ -213,9 +155,9 @@ blockmix_salsa8(const uint32_t *Bin, uint32_t *Bout, uint32_t *X, size_t r) * Return the result of parsing B_{2r-1} as a little-endian integer. */ static inline uint64_t -integerify(const void *B, size_t r) +integerify(const uint32_t *B, size_t r) { - const uint32_t *X = ((const uint32_t *) B) + (2 * r - 1) * 16; + const uint32_t *X = B + (2 * r - 1) * 16; return ((uint64_t) (X[1]) << 32) + X[0]; } @@ -245,15 +187,13 @@ smix(uint8_t *B, size_t r, uint64_t N, uint32_t *V, uint32_t *XY) /* 2: for i = 0 to N - 1 do */ for (i = 0; i < N; i += 2) { /* 3: V_i <-- X */ - blkcpy((escrypt_block_t *) &V[i * (32 * r)], (escrypt_block_t *) X, - 128 * r); + blkcpy(&V[i * (32 * r)], X, 2 * r); /* 4: X <-- H(X) */ blockmix_salsa8(X, Y, Z, r); /* 3: V_i <-- X */ - blkcpy((escrypt_block_t *) &V[(i + 1) * (32 * r)], - (escrypt_block_t *) Y, 128 * r); + blkcpy(&V[(i + 1) * (32 * r)], Y, 2 * r); /* 4: X <-- H(X) */ blockmix_salsa8(Y, X, Z, r); @@ -265,16 +205,14 @@ smix(uint8_t *B, size_t r, uint64_t N, uint32_t *V, uint32_t *XY) j = integerify(X, r) & (N - 1); /* 8: X <-- H(X \xor V_j) */ - blkxor((escrypt_block_t *) X, (escrypt_block_t *) &V[j * (32 * r)], - 128 * r); + blkxor(X, &V[j * (32 * r)], 2 * r); blockmix_salsa8(X, Y, Z, r); /* 7: j <-- Integerify(X) mod N */ j = integerify(Y, r) & (N - 1); /* 8: X <-- H(X \xor V_j) */ - blkxor((escrypt_block_t *) Y, (escrypt_block_t *) &V[j * (32 * r)], - 128 * r); + blkxor(Y, &V[j * (32 * r)], 2 * r); blockmix_salsa8(Y, X, Z, r); } /* 10: B' <-- X */ diff --git a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c index 6f0cb6bc7..f44e04e27 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c @@ -57,6 +57,7 @@ sodium_strnlen(const char *str, size_t maxlen) { size_t i = 0U; + ACQUIRE_FENCE; while (i < maxlen && str[i] != 0) { i++; } @@ -242,7 +243,7 @@ crypto_pwhash_scryptsalsa208sha256_str( int crypto_pwhash_scryptsalsa208sha256_str_verify( - const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], + const char *str, const char *const passwd, unsigned long long passwdlen) { char wanted[crypto_pwhash_scryptsalsa208sha256_STRBYTES]; @@ -272,7 +273,7 @@ crypto_pwhash_scryptsalsa208sha256_str_verify( int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash( - const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], + const char * str, unsigned long long opslimit, size_t memlimit) { uint32_t N_log2, N_log2_; diff --git a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c index 73ee40258..89fe8aec8 100644 --- a/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +++ b/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c @@ -38,13 +38,14 @@ #ifdef HAVE_EMMINTRIN_H -# ifdef __GNUC__ +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2"))), apply_to = function) +# elif defined(__GNUC__) # pragma GCC target("sse2") # endif + # include -# if defined(__XOP__) && defined(DISABLED) -# include -# endif + # include "private/sse2_64_32.h" # include "../crypto_scrypt.h" @@ -210,11 +211,13 @@ blockmix_salsa8_xor(const __m128i *Bin1, const __m128i *Bin2, __m128i *Bout, * Note that B's layout is permuted compared to the generic implementation. */ static inline uint64_t -integerify(const void *B, size_t r) +integerify(const __m128i *B, size_t r) { - const uint64_t *X = ((const uint64_t *) B) + (2 * r - 1) * 8; + const __m128i * X = B + (2*r - 1) * 4; + const uint32_t X0 = (uint32_t) _mm_cvtsi128_si32(X[0]); + const uint32_t X13 = (uint32_t) _mm_cvtsi128_si32(_mm_srli_si128(X[3], 4)); - return *X; + return (((uint64_t)(X13) << 32) + X0); } /* @@ -395,4 +398,9 @@ escrypt_kdf_sse(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen, /* Success! */ return 0; } + +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c index 9eaf0235f..d29892286 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c @@ -74,7 +74,7 @@ crypto_scalarmult_curve25519_ref10(unsigned char *q, const unsigned char *n, const unsigned char *p) { - unsigned char *t = q; + unsigned char t[32]; unsigned int i; fe25519 x1; fe25519 x2; @@ -136,6 +136,8 @@ crypto_scalarmult_curve25519_ref10(unsigned char *q, fe25519_mul(x2, x2, z2); fe25519_tobytes(q, x2); + sodium_memzero(t, sizeof t); + return 0; } diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c index 0f8f8b13c..d653b21f3 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c @@ -24,40 +24,42 @@ static int crypto_scalarmult_curve25519_sandy2x(unsigned char *q, const unsigned char *n, const unsigned char *p) { - unsigned char *t = q; - fe var[3]; - fe51 x_51; - fe51 z_51; - unsigned int i; + unsigned char t[32]; + fe var[3]; + fe51 x_51; + fe51 z_51; + unsigned int i; - for (i = 0; i < 32; i++) { - t[i] = n[i]; - } - t[0] &= 248; - t[31] &= 127; - t[31] |= 64; + for (i = 0; i < 32; i++) { + t[i] = n[i]; + } + t[0] &= 248; + t[31] &= 127; + t[31] |= 64; - fe_frombytes(x1, p); + fe_frombytes(x1, p); - ladder(var, t); + ladder(var, t); - z_51.v[0] = (z2[1] << 26) + z2[0]; - z_51.v[1] = (z2[3] << 26) + z2[2]; - z_51.v[2] = (z2[5] << 26) + z2[4]; - z_51.v[3] = (z2[7] << 26) + z2[6]; - z_51.v[4] = (z2[9] << 26) + z2[8]; + z_51.v[0] = (z2[1] << 26) + z2[0]; + z_51.v[1] = (z2[3] << 26) + z2[2]; + z_51.v[2] = (z2[5] << 26) + z2[4]; + z_51.v[3] = (z2[7] << 26) + z2[6]; + z_51.v[4] = (z2[9] << 26) + z2[8]; - x_51.v[0] = (x2[1] << 26) + x2[0]; - x_51.v[1] = (x2[3] << 26) + x2[2]; - x_51.v[2] = (x2[5] << 26) + x2[4]; - x_51.v[3] = (x2[7] << 26) + x2[6]; - x_51.v[4] = (x2[9] << 26) + x2[8]; + x_51.v[0] = (x2[1] << 26) + x2[0]; + x_51.v[1] = (x2[3] << 26) + x2[2]; + x_51.v[2] = (x2[5] << 26) + x2[4]; + x_51.v[3] = (x2[7] << 26) + x2[6]; + x_51.v[4] = (x2[9] << 26) + x2[8]; - fe51_invert(&z_51, &z_51); - fe51_mul(&x_51, &x_51, &z_51); - fe51_pack(q, &x_51); + fe51_invert(&z_51, &z_51); + fe51_mul(&x_51, &x_51, &z_51); + fe51_pack(q, &x_51); - return 0; + sodium_memzero(t, sizeof t); + + return 0; } struct crypto_scalarmult_curve25519_implementation diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S index 83501b039..94e36150c 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S @@ -3,6 +3,7 @@ /* This file is basically amd64-51/fe25519_mul.s. */ +#include "private/asm_cet.h" #include "fe51_namespace.h" #include "consts_namespace.h" .text @@ -19,6 +20,8 @@ ASM_HIDE_SYMBOL _fe51_mul #endif fe51_mul: _fe51_mul: + +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $96,%r11 diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S index 41c305480..75465b0b8 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S @@ -4,6 +4,7 @@ This file is adapted from amd64-51/fe25519_square.s: Adding loop to perform n squares. */ +#include "private/asm_cet.h" #include "fe51_namespace.h" #include "consts_namespace.h" .p2align 5 @@ -21,6 +22,7 @@ ASM_HIDE_SYMBOL _fe51_nsquare fe51_nsquare: _fe51_nsquare: +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $64,%r11 diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S index 500c85847..fb7a39a52 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S @@ -4,6 +4,7 @@ This file is the result of merging amd64-51/fe25519_pack.c and amd64-51/fe25519_freeze.s. */ +#include "private/asm_cet.h" #include "fe51_namespace.h" #include "consts_namespace.h" .p2align 5 @@ -21,6 +22,7 @@ ASM_HIDE_SYMBOL _fe51_pack fe51_pack: _fe51_pack: +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $32,%r11 diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c index 2fe081ee2..b6e687ead 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c @@ -9,70 +9,70 @@ static uint64_t load_3(const unsigned char *in) { - uint64_t result; - result = (uint64_t) in[0]; - result |= ((uint64_t) in[1]) << 8; - result |= ((uint64_t) in[2]) << 16; - return result; + uint64_t result; + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + return result; } static uint64_t load_4(const unsigned char *in) { - uint64_t result; - result = (uint64_t) in[0]; - result |= ((uint64_t) in[1]) << 8; - result |= ((uint64_t) in[2]) << 16; - result |= ((uint64_t) in[3]) << 24; - return result; + uint64_t result; + result = (uint64_t) in[0]; + result |= ((uint64_t) in[1]) << 8; + result |= ((uint64_t) in[2]) << 16; + result |= ((uint64_t) in[3]) << 24; + return result; } void fe_frombytes(fe h, const unsigned char *s) { - uint64_t h0 = load_4(s); - uint64_t h1 = load_3(s + 4) << 6; - uint64_t h2 = load_3(s + 7) << 5; - uint64_t h3 = load_3(s + 10) << 3; - uint64_t h4 = load_3(s + 13) << 2; - uint64_t h5 = load_4(s + 16); - uint64_t h6 = load_3(s + 20) << 7; - uint64_t h7 = load_3(s + 23) << 5; - uint64_t h8 = load_3(s + 26) << 4; - uint64_t h9 = (load_3(s + 29) & 8388607) << 2; - uint64_t carry0; - uint64_t carry1; - uint64_t carry2; - uint64_t carry3; - uint64_t carry4; - uint64_t carry5; - uint64_t carry6; - uint64_t carry7; - uint64_t carry8; - uint64_t carry9; + uint64_t h0 = load_4(s); + uint64_t h1 = load_3(s + 4) << 6; + uint64_t h2 = load_3(s + 7) << 5; + uint64_t h3 = load_3(s + 10) << 3; + uint64_t h4 = load_3(s + 13) << 2; + uint64_t h5 = load_4(s + 16); + uint64_t h6 = load_3(s + 20) << 7; + uint64_t h7 = load_3(s + 23) << 5; + uint64_t h8 = load_3(s + 26) << 4; + uint64_t h9 = (load_3(s + 29) & 8388607) << 2; + uint64_t carry0; + uint64_t carry1; + uint64_t carry2; + uint64_t carry3; + uint64_t carry4; + uint64_t carry5; + uint64_t carry6; + uint64_t carry7; + uint64_t carry8; + uint64_t carry9; - carry9 = h9 >> 25; h0 += carry9 * 19; h9 &= 0x1FFFFFF; - carry1 = h1 >> 25; h2 += carry1; h1 &= 0x1FFFFFF; - carry3 = h3 >> 25; h4 += carry3; h3 &= 0x1FFFFFF; - carry5 = h5 >> 25; h6 += carry5; h5 &= 0x1FFFFFF; - carry7 = h7 >> 25; h8 += carry7; h7 &= 0x1FFFFFF; + carry9 = h9 >> 25; h0 += carry9 * 19; h9 &= 0x1FFFFFF; + carry1 = h1 >> 25; h2 += carry1; h1 &= 0x1FFFFFF; + carry3 = h3 >> 25; h4 += carry3; h3 &= 0x1FFFFFF; + carry5 = h5 >> 25; h6 += carry5; h5 &= 0x1FFFFFF; + carry7 = h7 >> 25; h8 += carry7; h7 &= 0x1FFFFFF; - carry0 = h0 >> 26; h1 += carry0; h0 &= 0x3FFFFFF; - carry2 = h2 >> 26; h3 += carry2; h2 &= 0x3FFFFFF; - carry4 = h4 >> 26; h5 += carry4; h4 &= 0x3FFFFFF; - carry6 = h6 >> 26; h7 += carry6; h6 &= 0x3FFFFFF; - carry8 = h8 >> 26; h9 += carry8; h8 &= 0x3FFFFFF; + carry0 = h0 >> 26; h1 += carry0; h0 &= 0x3FFFFFF; + carry2 = h2 >> 26; h3 += carry2; h2 &= 0x3FFFFFF; + carry4 = h4 >> 26; h5 += carry4; h4 &= 0x3FFFFFF; + carry6 = h6 >> 26; h7 += carry6; h6 &= 0x3FFFFFF; + carry8 = h8 >> 26; h9 += carry8; h8 &= 0x3FFFFFF; - h[0] = h0; - h[1] = h1; - h[2] = h2; - h[3] = h3; - h[4] = h4; - h[5] = h5; - h[6] = h6; - h[7] = h7; - h[8] = h8; - h[9] = h9; + h[0] = h0; + h[1] = h1; + h[2] = h2; + h[3] = h3; + h[4] = h4; + h[5] = h5; + h[6] = h6; + h[7] = h7; + h[8] = h8; + h[9] = h9; } #endif diff --git a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S index c5c06021d..a25e57b38 100644 --- a/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +++ b/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S @@ -1,5 +1,6 @@ #ifdef IN_SANDY2X +#include "private/asm_cet.h" #include "ladder_namespace.h" #include "consts_namespace.h" .p2align 5 @@ -17,6 +18,7 @@ ASM_HIDE_SYMBOL _ladder ladder: _ladder: +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $1856,%r11 diff --git a/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c b/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c index 12132a2a6..c991ac667 100644 --- a/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +++ b/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c @@ -121,6 +121,7 @@ crypto_secretbox_open_detached(unsigned char *m, const unsigned char *c, for (i = 0U; i < mlen0; i++) { m[i] = block0[i + crypto_secretbox_ZEROBYTES]; } + sodium_memzero(block0, sizeof block0); if (clen > mlen0) { crypto_stream_salsa20_xor_ic(m + mlen0, c + mlen0, clen - mlen0, n + 16, 1U, subkey); diff --git a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c index e8e40150b..3a2414c69 100644 --- a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +++ b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c @@ -56,6 +56,7 @@ crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk, return -1; } fe25519_1(one_minus_y); + /* assumes A.Z=1 */ fe25519_sub(one_minus_y, one_minus_y, A.Y); fe25519_1(x); fe25519_add(x, x, A.Y); diff --git a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c index 26476b321..b5280a7d4 100644 --- a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +++ b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c @@ -7,6 +7,7 @@ #include "crypto_sign_ed25519.h" #include "crypto_verify_32.h" #include "sign_ed25519_ref10.h" +#include "private/common.h" #include "private/ed25519_ref10.h" #include "utils.h" @@ -23,6 +24,7 @@ _crypto_sign_ed25519_verify_detached(const unsigned char *sig, ge25519_p3 A; ge25519_p2 R; + ACQUIRE_FENCE; #ifdef ED25519_COMPAT if (sig[63] & 224) { return -1; diff --git a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c index bbdd8f729..b994cb680 100644 --- a/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +++ b/src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c @@ -33,31 +33,16 @@ _crypto_sign_ed25519_clamp(unsigned char k[32]) } #ifdef ED25519_NONDETERMINISTIC -/* r = hash(B || empty_labelset || Z || pad1 || k || pad2 || empty_labelset || K || extra || M) (mod q) */ +/* r = hash(k || K || noise || pad || M) (mod q) */ static void _crypto_sign_ed25519_synthetic_r_hv(crypto_hash_sha512_state *hs, - unsigned char Z[32], - const unsigned char sk[64]) + unsigned char tmp[64], + const unsigned char az[64]) { - static const unsigned char B[32] = { - 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - }; - static const unsigned char zeros[128] = { 0x00 }; - static const unsigned char empty_labelset[3] = { 0x02, 0x00, 0x00 }; - - crypto_hash_sha512_update(hs, B, 32); - crypto_hash_sha512_update(hs, empty_labelset, 3); - randombytes_buf(Z, 32); - crypto_hash_sha512_update(hs, Z, 32); - crypto_hash_sha512_update(hs, zeros, 128 - (32 + 3 + 32) % 128); - crypto_hash_sha512_update(hs, sk, 32); - crypto_hash_sha512_update(hs, zeros, 128 - 32 % 128); - crypto_hash_sha512_update(hs, empty_labelset, 3); - crypto_hash_sha512_update(hs, sk + 32, 32); - /* empty extra */ + crypto_hash_sha512_update(hs, az, 64); + randombytes_buf(tmp, 32); + memset(tmp + 32, 0, 32); + crypto_hash_sha512_update(hs, tmp, 64); } #endif @@ -76,7 +61,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 /* Z */, az); + _crypto_sign_ed25519_synthetic_r_hv(&hs, nonce /* tmp */, az); #else crypto_hash_sha512_update(&hs, az + 32, 32); #endif diff --git a/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c b/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c index 610005004..2bf2250b5 100644 --- a/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +++ b/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c @@ -11,11 +11,10 @@ #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") -# pragma GCC target("avx2") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1,avx2") # endif # include @@ -174,4 +173,8 @@ struct crypto_stream_chacha20_implementation SODIUM_C99(.stream_ietf_ext_xor_ic =) stream_ietf_ext_ref_xor_ic }; +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c b/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c index ad13c3af1..eb52bda62 100644 --- a/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +++ b/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c @@ -10,9 +10,10 @@ #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3") # endif # include @@ -168,4 +169,8 @@ struct crypto_stream_chacha20_implementation SODIUM_C99(.stream_ietf_ext_xor_ic =) stream_ietf_ext_ref_xor_ic }; +# ifdef __clang__ +# pragma clang attribute pop +# endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S index 6d9f354e1..51ac26ab9 100644 --- a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S +++ b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S @@ -1,5 +1,7 @@ #ifdef HAVE_AMD64_ASM +#include "private/asm_cet.h" + .text .p2align 5 @@ -15,6 +17,8 @@ ASM_HIDE_SYMBOL _stream_salsa20_xmm6 #endif stream_salsa20_xmm6: _stream_salsa20_xmm6: + +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $512,%r11 @@ -56,6 +60,7 @@ ASM_HIDE_SYMBOL _stream_salsa20_xmm6_xor_ic stream_salsa20_xmm6_xor_ic: _stream_salsa20_xmm6_xor_ic: +_CET_ENDBR mov %rsp,%r11 and $31,%r11 add $512,%r11 diff --git a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c index 507d7fed5..87789bb49 100644 --- a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c +++ b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c @@ -10,18 +10,17 @@ #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# pragma GCC target("ssse3") -# pragma GCC target("sse4.1") -# pragma GCC target("avx2") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2,ssse3,sse4.1,avx2"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("sse2,ssse3,sse4.1,avx2") # endif -#include -#include -#include -#include -#include "private/sse2_64_32.h" +# include +# include +# include +# include +# include "private/sse2_64_32.h" # include "../stream_salsa20.h" # include "salsa20_xmm6int-avx2.h" @@ -128,4 +127,8 @@ struct crypto_stream_salsa20_implementation SODIUM_C99(.stream_xor_ic =) stream_avx2_xor_ic }; +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c index 16cca0daf..32ef354de 100644 --- a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c +++ b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c @@ -9,7 +9,9 @@ #ifdef HAVE_EMMINTRIN_H -# ifdef __GNUC__ +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("sse2"))), apply_to = function) +# elif defined(__GNUC__) # pragma GCC target("sse2") # endif # include @@ -119,4 +121,8 @@ struct crypto_stream_salsa20_implementation SODIUM_C99(.stream_xor_ic =) stream_sse2_xor_ic }; +#ifdef __clang__ +# pragma clang attribute pop +#endif + #endif diff --git a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h index 830f70e81..2bc527d0a 100644 --- a/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h +++ b/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h @@ -5,7 +5,7 @@ if (bytes > 0) { __m128i diag3 = _mm_loadu_si128((const __m128i *) (x + 12)); __m128i a0, a1, a2, a3, a4, a5, a6, a7; __m128i b0, b1, b2, b3, b4, b5, b6, b7; - uint8_t partialblock[64]; + uint8_t partialblock[64] = { 0 }; unsigned int i; diff --git a/src/libsodium/src/libsodium/crypto_verify/sodium/verify.c b/src/libsodium/src/libsodium/crypto_verify/verify.c similarity index 97% rename from src/libsodium/src/libsodium/crypto_verify/sodium/verify.c rename to src/libsodium/src/libsodium/crypto_verify/verify.c index ffebf220a..0c3323a50 100644 --- a/src/libsodium/src/libsodium/crypto_verify/sodium/verify.c +++ b/src/libsodium/src/libsodium/crypto_verify/verify.c @@ -26,9 +26,6 @@ crypto_verify_64_bytes(void) #if defined(HAVE_EMMINTRIN_H) && defined(__SSE2__) -# ifdef __GNUC__ -# pragma GCC target("sse2") -# endif # include static inline int diff --git a/src/libsodium/src/libsodium/include/Makefile.am b/src/libsodium/src/libsodium/include/Makefile.am index 7476bd974..3146ec8e6 100644 --- a/src/libsodium/src/libsodium/include/Makefile.am +++ b/src/libsodium/src/libsodium/include/Makefile.am @@ -3,6 +3,8 @@ SODIUM_EXPORT = \ sodium.h \ sodium/core.h \ sodium/crypto_aead_aes256gcm.h \ + sodium/crypto_aead_aegis128l.h \ + sodium/crypto_aead_aegis256.h \ sodium/crypto_aead_chacha20poly1305.h \ sodium/crypto_aead_xchacha20poly1305.h \ sodium/crypto_auth.h \ @@ -25,6 +27,8 @@ SODIUM_EXPORT = \ sodium/crypto_hash_sha256.h \ sodium/crypto_hash_sha512.h \ sodium/crypto_kdf.h \ + sodium/crypto_kdf_hkdf_sha256.h \ + sodium/crypto_kdf_hkdf_sha512.h \ sodium/crypto_kdf_blake2b.h \ sodium/crypto_kx.h \ sodium/crypto_onetimeauth.h \ diff --git a/src/libsodium/src/libsodium/include/Makefile.in b/src/libsodium/src/libsodium/include/Makefile.in index ca6747842..118bcdd5f 100644 --- a/src/libsodium/src/libsodium/include/Makefile.in +++ b/src/libsodium/src/libsodium/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -175,8 +175,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -195,6 +193,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -207,6 +206,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -223,8 +224,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -347,6 +350,8 @@ SODIUM_EXPORT = \ sodium.h \ sodium/core.h \ sodium/crypto_aead_aes256gcm.h \ + sodium/crypto_aead_aegis128l.h \ + sodium/crypto_aead_aegis256.h \ sodium/crypto_aead_chacha20poly1305.h \ sodium/crypto_aead_xchacha20poly1305.h \ sodium/crypto_auth.h \ @@ -369,6 +374,8 @@ SODIUM_EXPORT = \ sodium/crypto_hash_sha256.h \ sodium/crypto_hash_sha512.h \ sodium/crypto_kdf.h \ + sodium/crypto_kdf_hkdf_sha256.h \ + sodium/crypto_kdf_hkdf_sha512.h \ sodium/crypto_kdf_blake2b.h \ sodium/crypto_kx.h \ sodium/crypto_onetimeauth.h \ @@ -552,7 +559,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/src/libsodium/include/sodium.h b/src/libsodium/src/libsodium/include/sodium.h index 295f911cf..86b7a4d2b 100644 --- a/src/libsodium/src/libsodium/include/sodium.h +++ b/src/libsodium/src/libsodium/include/sodium.h @@ -5,6 +5,8 @@ #include "sodium/version.h" #include "sodium/core.h" +#include "sodium/crypto_aead_aegis128l.h" +#include "sodium/crypto_aead_aegis256.h" #include "sodium/crypto_aead_aes256gcm.h" #include "sodium/crypto_aead_chacha20poly1305.h" #include "sodium/crypto_aead_xchacha20poly1305.h" @@ -14,8 +16,8 @@ #include "sodium/crypto_auth_hmacsha512256.h" #include "sodium/crypto_box.h" #include "sodium/crypto_box_curve25519xsalsa20poly1305.h" -#include "sodium/crypto_core_hsalsa20.h" #include "sodium/crypto_core_hchacha20.h" +#include "sodium/crypto_core_hsalsa20.h" #include "sodium/crypto_core_salsa20.h" #include "sodium/crypto_core_salsa2012.h" #include "sodium/crypto_core_salsa208.h" @@ -25,7 +27,11 @@ #include "sodium/crypto_hash_sha256.h" #include "sodium/crypto_hash_sha512.h" #include "sodium/crypto_kdf.h" +#include "sodium/crypto_kdf_hkdf_sha256.h" +#include "sodium/crypto_kdf_hkdf_sha512.h" #include "sodium/crypto_kdf_blake2b.h" +#include "sodium/crypto_kdf_hkdf_sha256.h" +#include "sodium/crypto_kdf_hkdf_sha512.h" #include "sodium/crypto_kx.h" #include "sodium/crypto_onetimeauth.h" #include "sodium/crypto_onetimeauth_poly1305.h" @@ -54,16 +60,16 @@ #include "sodium/utils.h" #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" -# include "sodium/crypto_stream_salsa208.h" -# include "sodium/crypto_stream_xchacha20.h" +#include "sodium/crypto_box_curve25519xchacha20poly1305.h" +#include "sodium/crypto_core_ed25519.h" +#include "sodium/crypto_core_ristretto255.h" +#include "sodium/crypto_pwhash_scryptsalsa208sha256.h" +#include "sodium/crypto_scalarmult_ed25519.h" +#include "sodium/crypto_scalarmult_ristretto255.h" +#include "sodium/crypto_secretbox_xchacha20poly1305.h" +#include "sodium/crypto_stream_salsa2012.h" +#include "sodium/crypto_stream_salsa208.h" +#include "sodium/crypto_stream_xchacha20.h" #endif #endif diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis128l.h b/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis128l.h new file mode 100644 index 000000000..0ad019fc9 --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis128l.h @@ -0,0 +1,92 @@ +#ifndef crypto_aead_aegis128l_H +#define crypto_aead_aegis128l_H + +#include + +#include "export.h" + +#ifdef __cplusplus +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wlong-long" +#endif +extern "C" { +#endif + +#define crypto_aead_aegis128l_KEYBYTES 16U +SODIUM_EXPORT +size_t crypto_aead_aegis128l_keybytes(void); + +#define crypto_aead_aegis128l_NSECBYTES 0U +SODIUM_EXPORT +size_t crypto_aead_aegis128l_nsecbytes(void); + +#define crypto_aead_aegis128l_NPUBBYTES 16U +SODIUM_EXPORT +size_t crypto_aead_aegis128l_npubbytes(void); + +#define crypto_aead_aegis128l_ABYTES 32U +SODIUM_EXPORT +size_t crypto_aead_aegis128l_abytes(void); + +#define crypto_aead_aegis128l_MESSAGEBYTES_MAX \ + SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aegis128l_ABYTES, (1ULL << 61) - 1) +SODIUM_EXPORT +size_t crypto_aead_aegis128l_messagebytes_max(void); + +SODIUM_EXPORT +int crypto_aead_aegis128l_encrypt(unsigned char *c, + unsigned long long *clen_p, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *nsec, + const unsigned char *npub, + const unsigned char *k) __attribute__((nonnull(1, 8, 9))); + +SODIUM_EXPORT +int crypto_aead_aegis128l_decrypt(unsigned char *m, + unsigned long long *mlen_p, + unsigned char *nsec, + const unsigned char *c, + unsigned long long clen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *npub, + const unsigned char *k) __attribute__((warn_unused_result)) +__attribute__((nonnull(4, 8, 9))); + +SODIUM_EXPORT +int crypto_aead_aegis128l_encrypt_detached(unsigned char *c, + unsigned char *mac, + unsigned long long *maclen_p, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *nsec, + const unsigned char *npub, + const unsigned char *k) + __attribute__((nonnull(1, 2, 9, 10))); + +SODIUM_EXPORT +int crypto_aead_aegis128l_decrypt_detached(unsigned char *m, + unsigned char *nsec, + const unsigned char *c, + unsigned long long clen, + const unsigned char *mac, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *npub, + const unsigned char *k) + __attribute__((warn_unused_result)) __attribute__((nonnull(3, 5, 8, 9))); + +SODIUM_EXPORT +void crypto_aead_aegis128l_keygen(unsigned char k[crypto_aead_aegis128l_KEYBYTES]) + __attribute__((nonnull)); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis256.h b/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis256.h new file mode 100644 index 000000000..26bd18ace --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis256.h @@ -0,0 +1,92 @@ +#ifndef crypto_aead_aegis256_H +#define crypto_aead_aegis256_H + +#include + +#include "export.h" + +#ifdef __cplusplus +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wlong-long" +#endif +extern "C" { +#endif + +#define crypto_aead_aegis256_KEYBYTES 32U +SODIUM_EXPORT +size_t crypto_aead_aegis256_keybytes(void); + +#define crypto_aead_aegis256_NSECBYTES 0U +SODIUM_EXPORT +size_t crypto_aead_aegis256_nsecbytes(void); + +#define crypto_aead_aegis256_NPUBBYTES 32U +SODIUM_EXPORT +size_t crypto_aead_aegis256_npubbytes(void); + +#define crypto_aead_aegis256_ABYTES 32U +SODIUM_EXPORT +size_t crypto_aead_aegis256_abytes(void); + +#define crypto_aead_aegis256_MESSAGEBYTES_MAX \ + SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aegis256_ABYTES, (1ULL << 61) - 1) +SODIUM_EXPORT +size_t crypto_aead_aegis256_messagebytes_max(void); + +SODIUM_EXPORT +int crypto_aead_aegis256_encrypt(unsigned char *c, + unsigned long long *clen_p, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *nsec, + const unsigned char *npub, + const unsigned char *k) __attribute__((nonnull(1, 8, 9))); + +SODIUM_EXPORT +int crypto_aead_aegis256_decrypt(unsigned char *m, + unsigned long long *mlen_p, + unsigned char *nsec, + const unsigned char *c, + unsigned long long clen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *npub, + const unsigned char *k) __attribute__((warn_unused_result)) +__attribute__((nonnull(4, 8, 9))); + +SODIUM_EXPORT +int crypto_aead_aegis256_encrypt_detached(unsigned char *c, + unsigned char *mac, + unsigned long long *maclen_p, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *nsec, + const unsigned char *npub, + const unsigned char *k) + __attribute__((nonnull(1, 2, 9, 10))); + +SODIUM_EXPORT +int crypto_aead_aegis256_decrypt_detached(unsigned char *m, + unsigned char *nsec, + const unsigned char *c, + unsigned long long clen, + const unsigned char *mac, + const unsigned char *ad, + unsigned long long adlen, + const unsigned char *npub, + const unsigned char *k) + __attribute__((warn_unused_result)) __attribute__((nonnull(3, 5, 8, 9))); + +SODIUM_EXPORT +void crypto_aead_aegis256_keygen(unsigned char k[crypto_aead_aegis256_KEYBYTES]) + __attribute__((nonnull)); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha256.h b/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha256.h new file mode 100644 index 000000000..e7e7f4db6 --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha256.h @@ -0,0 +1,74 @@ +#ifndef crypto_kdf_hkdf_sha256_H +#define crypto_kdf_hkdf_sha256_H + +#include +#include +#include + +#include "crypto_kdf.h" +#include "crypto_auth_hmacsha256.h" +#include "export.h" + +#ifdef __cplusplus +# ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +extern "C" { +#endif + +#define crypto_kdf_hkdf_sha256_KEYBYTES crypto_auth_hmacsha256_BYTES +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha256_keybytes(void); + +#define crypto_kdf_hkdf_sha256_BYTES_MIN 0U +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha256_bytes_min(void); + +#define crypto_kdf_hkdf_sha256_BYTES_MAX (0xff * crypto_auth_hmacsha256_BYTES) +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha256_bytes_max(void); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha256_extract(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES], + const unsigned char *salt, size_t salt_len, + const unsigned char *ikm, size_t ikm_len) + __attribute__ ((nonnull(4))); + +SODIUM_EXPORT +void crypto_kdf_hkdf_sha256_keygen(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len, + const char *ctx, size_t ctx_len, + const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]) + __attribute__ ((nonnull(1))); + +/* ------------------------------------------------------------------------- */ + +typedef struct crypto_kdf_hkdf_sha256_state { + crypto_auth_hmacsha256_state st; +} crypto_kdf_hkdf_sha256_state; + +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha256_statebytes(void); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha256_extract_init(crypto_kdf_hkdf_sha256_state *state, + const unsigned char *salt, size_t salt_len) + __attribute__ ((nonnull(1))); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha256_extract_update(crypto_kdf_hkdf_sha256_state *state, + const unsigned char *ikm, size_t ikm_len) + __attribute__ ((nonnull)); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha256_extract_final(crypto_kdf_hkdf_sha256_state *state, + unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]) + __attribute__ ((nonnull)); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha512.h b/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha512.h new file mode 100644 index 000000000..0ed205dfb --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha512.h @@ -0,0 +1,75 @@ +#ifndef crypto_kdf_hkdf_sha512_H +#define crypto_kdf_hkdf_sha512_H + +#include +#include +#include + +#include "crypto_kdf.h" +#include "crypto_auth_hmacsha512.h" +#include "export.h" + +#ifdef __cplusplus +# ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +extern "C" { +#endif + +#define crypto_kdf_hkdf_sha512_KEYBYTES crypto_auth_hmacsha512_BYTES +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha512_keybytes(void); + +#define crypto_kdf_hkdf_sha512_BYTES_MIN 0U +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha512_bytes_min(void); + +#define crypto_kdf_hkdf_sha512_BYTES_MAX (0xff * crypto_auth_hmacsha512_BYTES) +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha512_bytes_max(void); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha512_extract(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES], + const unsigned char *salt, size_t salt_len, + const unsigned char *ikm, size_t ikm_len) + __attribute__ ((nonnull(1))); + +SODIUM_EXPORT +void crypto_kdf_hkdf_sha512_keygen(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) + __attribute__ ((nonnull)); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len, + const char *ctx, size_t ctx_len, + const unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) + __attribute__ ((nonnull(1))); + +/* ------------------------------------------------------------------------- */ + +typedef struct crypto_kdf_hkdf_sha512_state { + crypto_auth_hmacsha512_state st; +} crypto_kdf_hkdf_sha512_state; + +SODIUM_EXPORT +size_t crypto_kdf_hkdf_sha512_statebytes(void); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha512_extract_init(crypto_kdf_hkdf_sha512_state *state, + const unsigned char *salt, size_t salt_len) + __attribute__ ((nonnull(1))); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha512_extract_update(crypto_kdf_hkdf_sha512_state *state, + const unsigned char *ikm, size_t ikm_len) + __attribute__ ((nonnull)); + +SODIUM_EXPORT +int crypto_kdf_hkdf_sha512_extract_final(crypto_kdf_hkdf_sha512_state *state, + unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]) + __attribute__ ((nonnull)); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h index f3e34d86d..1565d37ab 100644 --- a/src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +++ b/src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h @@ -1,13 +1,6 @@ #ifndef crypto_onetimeauth_poly1305_H #define crypto_onetimeauth_poly1305_H -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - #include #include #include @@ -16,6 +9,13 @@ extern "C" { #include "export.h" +#ifdef __cplusplus +# ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +extern "C" { +#endif + typedef struct CRYPTO_ALIGN(16) crypto_onetimeauth_poly1305_state { unsigned char opaque[256]; } crypto_onetimeauth_poly1305_state; diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash.h index 585a993ef..9683192bf 100644 --- a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash.h @@ -125,17 +125,17 @@ int crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], +int crypto_pwhash_str_verify(const char *str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES], +int crypto_pwhash_str_needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); -#define crypto_pwhash_PRIMITIVE "argon2i" +#define crypto_pwhash_PRIMITIVE "argon2id,argon2i" SODIUM_EXPORT const char *crypto_pwhash_primitive(void) __attribute__ ((warn_unused_result)); diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h index 88ff6221d..63abdf4ab 100644 --- a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +++ b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h @@ -105,13 +105,13 @@ int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], +int crypto_pwhash_argon2i_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES], +int crypto_pwhash_argon2i_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h index 7183abd18..98bc83e07 100644 --- a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +++ b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h @@ -105,13 +105,13 @@ int crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES], +int crypto_pwhash_argon2id_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES], +int crypto_pwhash_argon2id_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h index 5c0bf7d39..8956dfbf7 100644 --- a/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +++ b/src/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h @@ -95,7 +95,7 @@ int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], +int crypto_pwhash_scryptsalsa208sha256_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); @@ -108,7 +108,7 @@ int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdl __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], +int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/src/libsodium/include/sodium/private/asm_cet.h b/src/libsodium/src/libsodium/include/sodium/private/asm_cet.h new file mode 100644 index 000000000..4428c97f3 --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/private/asm_cet.h @@ -0,0 +1,11 @@ +#ifndef asm_cet_H +#define asm_cet_H 1 + +#if HAVE_CET_H +# include +#endif +#ifndef _CET_ENDBR +# define _CET_ENDBR +#endif + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/private/common.h b/src/libsodium/src/libsodium/include/sodium/private/common.h index 339e725ba..63f0d2b2d 100644 --- a/src/libsodium/src/libsodium/include/sodium/private/common.h +++ b/src/libsodium/src/libsodium/include/sodium/private/common.h @@ -226,24 +226,40 @@ xor_buf(unsigned char *out, const unsigned char *in, size_t n) # endif #endif -#if defined(_MSC_VER) && \ - (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)) +#ifdef _MSC_VER -# include +# if defined(_M_X64) || defined(_M_IX86) +# include + +# define HAVE_INTRIN_H 1 +# define HAVE_MMINTRIN_H 1 +# define HAVE_EMMINTRIN_H 1 +# define HAVE_PMMINTRIN_H 1 +# define HAVE_TMMINTRIN_H 1 +# define HAVE_SMMINTRIN_H 1 +# define HAVE_AVXINTRIN_H 1 +# if _MSC_VER >= 1600 +# define HAVE_WMMINTRIN_H 1 +# endif +# if _MSC_VER >= 1700 && defined(_M_X64) +# define HAVE_AVX2INTRIN_H 1 +# endif +# if _MSC_VER >= 1910 && defined(_M_X64) +# define HAVE_AVX512FINTRIN_H 1 +# endif + +# elif defined(_M_ARM64) + +# ifndef __ARM_ARCH +# define __ARM_ARCH 1 +# endif +# ifndef __ARM_NEON +# define __ARM_NEON 1 +# endif +# define HAVE_ARMCRYPTO 1 + +# endif /* _MSC_VER */ -# define HAVE_INTRIN_H 1 -# define HAVE_MMINTRIN_H 1 -# define HAVE_EMMINTRIN_H 1 -# define HAVE_PMMINTRIN_H 1 -# define HAVE_TMMINTRIN_H 1 -# define HAVE_SMMINTRIN_H 1 -# define HAVE_AVXINTRIN_H 1 -# if _MSC_VER >= 1600 -# define HAVE_WMMINTRIN_H 1 -# endif -# if _MSC_VER >= 1700 && defined(_M_X64) -# define HAVE_AVX2INTRIN_H 1 -# endif #elif defined(HAVE_INTRIN_H) # include #endif @@ -258,4 +274,12 @@ extern void ct_unpoison(const void *, size_t); # define UNPOISON(X, L) (void) 0 #endif +#ifdef HAVE_GCC_MEMORY_FENCES +# define ACQUIRE_FENCE __atomic_thread_fence(__ATOMIC_ACQUIRE) +#elif defined(HAVE_C11_MEMORY_FENCES) +# define ACQUIRE_FENCE atomic_thread_fence(memory_order_acquire) +#else +# define ACQUIRE_FENCE (void) 0 +#endif + #endif diff --git a/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h b/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h index f2782d9d2..4652f0db5 100644 --- a/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h +++ b/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h @@ -273,27 +273,7 @@ fe25519_cswap(fe25519 f, fe25519 g, unsigned int b) static inline void fe25519_copy(fe25519 h, const fe25519 f) { - int32_t f0 = f[0]; - int32_t f1 = f[1]; - int32_t f2 = f[2]; - int32_t f3 = f[3]; - int32_t f4 = f[4]; - int32_t f5 = f[5]; - int32_t f6 = f[6]; - int32_t f7 = f[7]; - int32_t f8 = f[8]; - int32_t f9 = f[9]; - - h[0] = f0; - h[1] = f1; - h[2] = f2; - h[3] = f3; - h[4] = f4; - h[5] = f5; - h[6] = f6; - h[7] = f7; - h[8] = f8; - h[9] = f9; + memcpy(h, f, 10 * sizeof h[0]); } /* @@ -978,7 +958,7 @@ fe25519_sq2(fe25519 h, const fe25519 f) h[9] = (int32_t) h9; } -static void +static inline void fe25519_mul32(fe25519 h, const fe25519 f, uint32_t n) { int64_t sn = (int64_t) n; diff --git a/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h b/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h index 6c0d775ba..ac4321be5 100644 --- a/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h +++ b/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h @@ -191,17 +191,7 @@ fe25519_cswap(fe25519 f, fe25519 g, unsigned int b) static inline void fe25519_copy(fe25519 h, const fe25519 f) { - uint64_t f0 = f[0]; - uint64_t f1 = f[1]; - uint64_t f2 = f[2]; - uint64_t f3 = f[3]; - uint64_t f4 = f[4]; - - h[0] = f0; - h[1] = f1; - h[2] = f2; - h[3] = f3; - h[4] = f4; + memcpy(h, f, 5 * sizeof h[0]); } /* @@ -489,7 +479,7 @@ fe25519_sq2(fe25519 h, const fe25519 f) h[4] = r04; } -static void +static inline void fe25519_mul32(fe25519 h, const fe25519 f, uint32_t n) { const uint64_t mask = 0x7ffffffffffffULL; diff --git a/src/libsodium/src/libsodium/include/sodium/private/implementations.h b/src/libsodium/src/libsodium/include/sodium/private/implementations.h index c7237f851..edbb2b8bc 100644 --- a/src/libsodium/src/libsodium/include/sodium/private/implementations.h +++ b/src/libsodium/src/libsodium/include/sodium/private/implementations.h @@ -7,5 +7,7 @@ int _crypto_pwhash_argon2_pick_best_implementation(void); int _crypto_scalarmult_curve25519_pick_best_implementation(void); int _crypto_stream_chacha20_pick_best_implementation(void); int _crypto_stream_salsa20_pick_best_implementation(void); +int _crypto_aead_aegis128l_pick_best_implementation(void); +int _crypto_aead_aegis256_pick_best_implementation(void); #endif diff --git a/src/libsodium/src/libsodium/include/sodium/private/softaes.h b/src/libsodium/src/libsodium/include/sodium/private/softaes.h new file mode 100644 index 000000000..f7a2bd24e --- /dev/null +++ b/src/libsodium/src/libsodium/include/sodium/private/softaes.h @@ -0,0 +1,56 @@ +#ifndef softaes_H +#define softaes_H 1 + +#include + +#include "private/common.h" + +typedef struct SoftAesBlock { + uint32_t w0; + uint32_t w1; + uint32_t w2; + uint32_t w3; +} SoftAesBlock; + +SoftAesBlock softaes_block_encrypt(const SoftAesBlock block, const SoftAesBlock rk); + +static inline SoftAesBlock +softaes_block_load(const uint8_t in[16]) +{ + const SoftAesBlock out = { LOAD32_LE(in + 0), LOAD32_LE(in + 4), LOAD32_LE(in + 8), + LOAD32_LE(in + 12) }; + return out; +} + +static inline SoftAesBlock +softaes_block_load64x2(const uint64_t a, const uint64_t b) +{ + const SoftAesBlock out = { (uint32_t) b, (uint32_t) (b >> 32), (uint32_t) a, + (uint32_t) (a >> 32) }; + return out; +} + +static inline void +softaes_block_store(uint8_t out[16], const SoftAesBlock in) +{ + STORE32_LE(out + 0, in.w0); + STORE32_LE(out + 4, in.w1); + STORE32_LE(out + 8, in.w2); + STORE32_LE(out + 12, in.w3); +} + +static inline SoftAesBlock +softaes_block_xor(const SoftAesBlock a, const SoftAesBlock b) +{ + const SoftAesBlock out = { a.w0 ^ b.w0, a.w1 ^ b.w1, a.w2 ^ b.w2, a.w3 ^ b.w3 }; + return out; +} + +static inline SoftAesBlock +softaes_block_and(const SoftAesBlock a, const SoftAesBlock b) +{ + const SoftAesBlock out = { a.w0 & b.w0, a.w1 & b.w1, a.w2 & b.w2, a.w3 & b.w3 }; + return out; +} + +#endif diff --git a/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h b/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h index fc994bd1a..b0b66038e 100644 --- a/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h +++ b/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h @@ -9,7 +9,7 @@ #if defined(HAVE_EMMINTRIN_H) && \ !(defined(__amd64) || defined(__amd64__) || defined(__x86_64__) || \ - defined(_M_X64) || defined(_M_AMD64)) + defined(_M_X64)) # include # include diff --git a/src/libsodium/src/libsodium/include/sodium/randombytes.h b/src/libsodium/src/libsodium/include/sodium/randombytes.h index a03cc6572..c83a4df50 100644 --- a/src/libsodium/src/libsodium/include/sodium/randombytes.h +++ b/src/libsodium/src/libsodium/include/sodium/randombytes.h @@ -53,7 +53,7 @@ SODIUM_EXPORT int randombytes_close(void); SODIUM_EXPORT -int randombytes_set_implementation(randombytes_implementation *impl) +int randombytes_set_implementation(const randombytes_implementation *impl) __attribute__ ((nonnull)); SODIUM_EXPORT diff --git a/src/libsodium/src/libsodium/include/sodium/runtime.h b/src/libsodium/src/libsodium/include/sodium/runtime.h index 7f15d58e7..c1cec853e 100644 --- a/src/libsodium/src/libsodium/include/sodium/runtime.h +++ b/src/libsodium/src/libsodium/include/sodium/runtime.h @@ -11,6 +11,9 @@ extern "C" { SODIUM_EXPORT_WEAK int sodium_runtime_has_neon(void); +SODIUM_EXPORT_WEAK +int sodium_runtime_has_armcrypto(void); + SODIUM_EXPORT_WEAK int sodium_runtime_has_sse2(void); diff --git a/src/libsodium/src/libsodium/randombytes/internal/randombytes_internal_random.c b/src/libsodium/src/libsodium/randombytes/internal/randombytes_internal_random.c index f0794f80a..d39063c5b 100644 --- a/src/libsodium/src/libsodium/randombytes/internal/randombytes_internal_random.c +++ b/src/libsodium/src/libsodium/randombytes/internal/randombytes_internal_random.c @@ -45,7 +45,11 @@ # include #endif #ifdef HAVE_RDRAND -# pragma GCC target("rdrnd") +# ifdef __clang__ +# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function) +# elif defined(__GNUC__) +# pragma GCC target("rdrnd") +# endif # include #endif @@ -93,6 +97,10 @@ BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength); # endif #endif +#if !defined(TLS) && !defined(__STDC_NO_THREADS__) && \ + defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define TLS _Thread_local +#endif #ifndef TLS # ifdef _WIN32 # define TLS __declspec(thread) @@ -629,3 +637,9 @@ struct randombytes_implementation randombytes_internal_implementation = { SODIUM_C99(.buf =) randombytes_internal_random_buf, SODIUM_C99(.close =) randombytes_internal_random_close }; + +#ifdef HAVE_RDRAND +# ifdef __clang__ +# pragma clang attribute pop +# endif +#endif diff --git a/src/libsodium/src/libsodium/randombytes/randombytes.c b/src/libsodium/src/libsodium/randombytes/randombytes.c index 8ac085fc1..2aa2762a3 100644 --- a/src/libsodium/src/libsodium/randombytes/randombytes.c +++ b/src/libsodium/src/libsodium/randombytes/randombytes.c @@ -44,7 +44,7 @@ randombytes_init_if_needed(void) } int -randombytes_set_implementation(randombytes_implementation *impl) +randombytes_set_implementation(const randombytes_implementation *impl) { implementation = impl; diff --git a/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c b/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c index 38f04f0a1..ed1ebee05 100644 --- a/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +++ b/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c @@ -1,4 +1,3 @@ - #include #include #include diff --git a/src/libsodium/src/libsodium/sodium/codecs.c b/src/libsodium/src/libsodium/sodium/codecs.c index 77fa464cc..36508089c 100644 --- a/src/libsodium/src/libsodium/sodium/codecs.c +++ b/src/libsodium/src/libsodium/sodium/codecs.c @@ -7,6 +7,7 @@ #include #include "core.h" +#include "private/common.h" #include "utils.h" /* Derived from original code by CodesInChaos */ @@ -250,6 +251,7 @@ _sodium_base642bin_skip_padding(const char * const b64, const size_t b64_len, errno = ERANGE; return -1; } + ACQUIRE_FENCE; c = b64[*b64_pos_p]; if (c == '=') { padding_len--; diff --git a/src/libsodium/src/libsodium/sodium/core.c b/src/libsodium/src/libsodium/sodium/core.c index bad32174a..214ef5f8e 100644 --- a/src/libsodium/src/libsodium/sodium/core.c +++ b/src/libsodium/src/libsodium/sodium/core.c @@ -45,6 +45,8 @@ sodium_init(void) _crypto_scalarmult_curve25519_pick_best_implementation(); _crypto_stream_chacha20_pick_best_implementation(); _crypto_stream_salsa20_pick_best_implementation(); + _crypto_aead_aegis128l_pick_best_implementation(); + _crypto_aead_aegis256_pick_best_implementation(); initialized = 1; if (sodium_crit_leave() != 0) { return -1; /* LCOV_EXCL_LINE */ diff --git a/src/libsodium/src/libsodium/sodium/runtime.c b/src/libsodium/src/libsodium/sodium/runtime.c index 9dfe54f84..bd3cf5fc4 100644 --- a/src/libsodium/src/libsodium/sodium/runtime.c +++ b/src/libsodium/src/libsodium/sodium/runtime.c @@ -3,6 +3,14 @@ #ifdef HAVE_ANDROID_GETCPUFEATURES # include #endif +#ifdef __APPLE__ +# include +# include +# include +#endif +#ifdef HAVE_SYS_AUXV_H +# include +#endif #include "private/common.h" #include "runtime.h" @@ -10,6 +18,7 @@ typedef struct CPUFeatures_ { int initialized; int has_neon; + int has_armcrypto; int has_sse2; int has_sse3; int has_ssse3; @@ -48,32 +57,100 @@ static CPUFeatures _cpu_features; static int _sodium_runtime_arm_cpu_features(CPUFeatures * const cpu_features) { -#ifndef __arm__ cpu_features->has_neon = 0; - return -1; -#else -# ifdef __APPLE__ -# ifdef __ARM_NEON__ + cpu_features->has_armcrypto = 0; + +#ifndef __ARM_ARCH + return -1; /* LCOV_EXCL_LINE */ +#endif + +#if defined(__ARM_NEON) || defined(__aarch64__) || defined(_M_ARM64) cpu_features->has_neon = 1; -# else - cpu_features->has_neon = 0; -# endif -# elif defined(HAVE_ANDROID_GETCPUFEATURES) && \ - defined(ANDROID_CPU_ARM_FEATURE_NEON) +#elif defined(HAVE_ANDROID_GETCPUFEATURES) cpu_features->has_neon = - (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0x0; -# else - cpu_features->has_neon = 0; + (android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD) != 0x0; +#elif (defined(__aarch64__) || defined(_M_ARM64)) && defined(AT_HWCAP) +# ifdef HAVE_GETAUXVAL + cpu_features->has_neon = (getauxval(AT_HWCAP) & (1L << 1)) != 0; +# elif defined(HAVE_ELF_AUX_INFO) + { + unsigned long buf; + if (elf_aux_info(AT_HWCAP, (void *) &buf, (int) sizeof buf) == 0) { + cpu_features->has_neon = (buf & (1L << 1)) != 0; + } + } +# endif +#elif defined(__arm__) && defined(AT_HWCAP) +# ifdef HAVE_GETAUXVAL + cpu_features->has_neon = (getauxval(AT_HWCAP) & (1L << 12)) != 0; +# elif defined(HAVE_ELF_AUX_INFO) + { + unsigned long buf; + if (elf_aux_info(AT_HWCAP, (void *) &buf, (int) sizeof buf) == 0) { + cpu_features->has_neon = (buf & (1L << 12)) != 0; + } + } # endif - return 0; #endif + + if (cpu_features->has_neon == 0) { + return 0; + } + +#if defined(__ARM_FEATURE_CRYPTO) && defined(__ARM_FEATURE_AES) + cpu_features->has_armcrypto = 1; +#elif defined(_M_ARM64) + cpu_features->has_armcrypto = 1; /* assuming all CPUs supported by ARM Windows have the crypto extensions */ +#elif defined(__APPLE__) && defined(CPU_TYPE_ARM64) && defined(CPU_SUBTYPE_ARM64E) + { + cpu_type_t cpu_type; + cpu_subtype_t cpu_subtype; + size_t cpu_type_len = sizeof cpu_type; + size_t cpu_subtype_len = sizeof cpu_subtype; + + if (sysctlbyname("hw.cputype", &cpu_type, &cpu_type_len, + NULL, 0) == 0 && cpu_type == CPU_TYPE_ARM64 && + sysctlbyname("hw.cpusubtype", &cpu_subtype, &cpu_subtype_len, + NULL, 0) == 0 && + (cpu_subtype == CPU_SUBTYPE_ARM64E || + cpu_subtype == CPU_SUBTYPE_ARM64_V8)) { + cpu_features->has_armcrypto = 1; + } + } +#elif defined(HAVE_ANDROID_GETCPUFEATURES) + cpu_features->has_armcrypto = + (android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES) != 0x0; +#elif (defined(__aarch64__) || defined(_M_ARM64)) && defined(AT_HWCAP) +# ifdef HAVE_GETAUXVAL + cpu_features->has_armcrypto = (getauxval(AT_HWCAP) & (1L << 3)) != 0; +# elif defined(HAVE_ELF_AUX_INFO) + { + unsigned long buf; + if (elf_aux_info(AT_HWCAP, (void *) &buf, (int) sizeof buf) == 0) { + cpu_features->has_armcrypto = (buf & (1L << 3)) != 0; + } + } +# endif +#elif defined(__arm__) && defined(AT_HWCAP2) +# ifdef HAVE_GETAUXVAL + cpu_features->has_armcrypto = (getauxval(AT_HWCAP2) & (1L << 0)) != 0; +# elif defined(HAVE_ELF_AUX_INFO) + { + unsigned long buf; + if (elf_aux_info(AT_HWCAP2, (void *) &buf, (int) sizeof buf) == 0) { + cpu_features->has_armcrypto = (buf & (1L << 0)) != 0; + } + } +# endif +#endif + + return 0; } static void _cpuid(unsigned int cpu_info[4U], const unsigned int cpu_info_type) { -#if defined(_MSC_VER) && \ - (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)) +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) __cpuid((int *) cpu_info, cpu_info_type); #elif defined(HAVE_CPUID) cpu_info[0] = cpu_info[1] = cpu_info[2] = cpu_info[3] = 0; @@ -116,11 +193,10 @@ static int _sodium_runtime_intel_cpu_features(CPUFeatures * const cpu_features) { unsigned int cpu_info[4]; - unsigned int id; uint32_t xcr0 = 0U; _cpuid(cpu_info, 0x0); - if ((id = cpu_info[0]) == 0U) { + if (cpu_info[0] == 0U) { return -1; /* LCOV_EXCL_LINE */ } _cpuid(cpu_info, 0x00000001); @@ -248,6 +324,12 @@ sodium_runtime_has_neon(void) return _cpu_features.has_neon; } +int +sodium_runtime_has_armcrypto(void) +{ + return _cpu_features.has_armcrypto; +} + int sodium_runtime_has_sse2(void) { diff --git a/src/libsodium/src/libsodium/sodium/utils.c b/src/libsodium/src/libsodium/sodium/utils.c index cdaff9d06..994b835d7 100644 --- a/src/libsodium/src/libsodium/sodium/utils.c +++ b/src/libsodium/src/libsodium/sodium/utils.c @@ -9,7 +9,7 @@ #include #include -#ifndef __wasm__ +#if defined(HAVE_RAISE) && !defined(__wasm__) # include #endif @@ -17,6 +17,10 @@ # include #endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif + #ifdef _WIN32 # include # include @@ -75,6 +79,7 @@ void *alloca (size_t); defined(HAVE_POSIX_MEMALIGN) # define HAVE_ALIGNED_MALLOC #endif + #if defined(HAVE_MPROTECT) && \ !(defined(PROT_NONE) && defined(PROT_READ) && defined(PROT_WRITE)) # undef HAVE_MPROTECT @@ -117,7 +122,7 @@ _sodium_dummy_symbol_to_prevent_memzero_lto(void *const pnt, void sodium_memzero(void * const pnt, const size_t len) { -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CRT_INLINE) SecureZeroMemory(pnt, len); #elif defined(HAVE_MEMSET_S) if (len > 0U && memset_s(pnt, (rsize_t) len, 0, (rsize_t) len) != 0) { @@ -125,6 +130,8 @@ sodium_memzero(void * const pnt, const size_t len) } #elif defined(HAVE_EXPLICIT_BZERO) explicit_bzero(pnt, len); +#elif defined(HAVE_MEMSET_EXPLICIT) + memset_explicit(pnt, 0, len); #elif defined(HAVE_EXPLICIT_MEMSET) explicit_memset(pnt, 0, len); #elif HAVE_WEAK_SYMBOLS @@ -238,8 +245,8 @@ sodium_compare(const unsigned char *b1_, const unsigned char *b2_, size_t len) i--; x1 = b1[i]; x2 = b2[i]; - gt |= ((x2 - x1) >> 8) & eq; - eq &= ((x2 ^ x1) - 1) >> 8; + gt |= (((unsigned int) x2 - (unsigned int) x1) >> 8) & eq; + eq &= (((unsigned int) (x2 ^ x1)) - 1) >> 8; } return (int) (gt + gt + eq) - 1; } @@ -399,7 +406,7 @@ int _sodium_alloc_init(void) { #ifdef HAVE_ALIGNED_MALLOC -# if defined(_SC_PAGESIZE) +# if defined(_SC_PAGESIZE) && defined(HAVE_SYSCONF) long page_size_ = sysconf(_SC_PAGESIZE); if (page_size_ > 0L) { page_size = (size_t) page_size_; @@ -408,7 +415,7 @@ _sodium_alloc_init(void) SYSTEM_INFO si; GetSystemInfo(&si); page_size = (size_t) si.dwPageSize; -# else +# elif !defined(PAGE_SIZE) # warning Unknown page size # endif if (page_size < CANARY_SIZE || page_size < sizeof(size_t)) { @@ -500,8 +507,10 @@ _mprotect_readwrite(void *ptr, size_t size) __attribute__((noreturn)) static void _out_of_bounds(void) { -# ifndef __wasm__ -# ifdef SIGSEGV +# if defined(HAVE_RAISE) && !defined(__wasm__) +# ifdef SIGPROT + raise(SIGPROT); +# elif defined(SIGSEGV) raise(SIGSEGV); # elif defined(SIGKILL) raise(SIGKILL); @@ -610,7 +619,7 @@ _sodium_malloc(const size_t size) memcpy(unprotected_ptr + unprotected_size, canary, sizeof canary); # endif _mprotect_noaccess(unprotected_ptr + unprotected_size, page_size); - sodium_mlock(unprotected_ptr, unprotected_size); + (void) sodium_mlock(unprotected_ptr, unprotected_size); /* not a hard error in the context of sodium_malloc() */ canary_ptr = unprotected_ptr + _page_round(size_with_canary) - size_with_canary; user_ptr = canary_ptr + sizeof canary; @@ -680,7 +689,7 @@ sodium_free(void *ptr) _out_of_bounds(); } # endif - sodium_munlock(unprotected_ptr, unprotected_size); + (void) sodium_munlock(unprotected_ptr, unprotected_size); _free_aligned(base_ptr, total_size); } #endif /* HAVE_ALIGNED_MALLOC */ diff --git a/src/libsodium/test/Makefile.in b/src/libsodium/test/Makefile.in index 6a3a90d1a..a03365f8d 100644 --- a/src/libsodium/test/Makefile.in +++ b/src/libsodium/test/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -160,8 +160,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -206,6 +204,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -218,6 +217,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -234,8 +235,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -497,7 +500,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/src/libsodium/test/constcheck.sh b/src/libsodium/test/constcheck.sh index 994c16426..ad4bf53e2 100755 --- a/src/libsodium/test/constcheck.sh +++ b/src/libsodium/test/constcheck.sh @@ -5,7 +5,7 @@ CT='ct.c' echo '#include ' > "$CT" echo '#include ' >> "$CT" echo 'int main(void) {' >> "$CT" -for macro in $(egrep -r '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/include | \ +for macro in $(grep -Er '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/include | \ cut -d: -f2- | cut -d' ' -f2 | \ fgrep -v edwards25519sha512batch | sort -u); do func=$(echo "$macro" | tr A-Z a-z) @@ -14,6 +14,8 @@ done echo "return 0; }" >> "$CT" CPPFLAGS="${CPPFLAGS} -Wno-deprecated-declarations" +CPPFLAGS="${CPPFLAGS} -I/opt/homebrew/include" +LDFLAGS="${LDFLAGS} -L/opt/homebrew/lib" ${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1 ./a.out || exit 1 rm -f a.out "$CT" diff --git a/src/libsodium/test/default/Makefile.am b/src/libsodium/test/default/Makefile.am index 12aa7eb4b..ad9da78bc 100644 --- a/src/libsodium/test/default/Makefile.am +++ b/src/libsodium/test/default/Makefile.am @@ -1,9 +1,12 @@ EXTRA_DIST = \ + run.sh \ cmptest.h \ wasi-test-wrapper.sh \ wintest.bat \ pre.js.inc \ + aead_aegis128l.exp \ + aead_aegis256.exp \ aead_aes256gcm.exp \ aead_aes256gcm2.exp \ aead_chacha20poly1305.exp \ @@ -40,6 +43,7 @@ EXTRA_DIST = \ hash.exp \ hash3.exp \ kdf.exp \ + kdf_hkdf.exp \ keygen.exp \ kx.exp \ metamorphic.exp \ @@ -66,7 +70,7 @@ EXTRA_DIST = \ secretbox8.exp \ secretbox_easy.exp \ secretbox_easy2.exp \ - secretstream.exp \ + secretstream_xchacha20poly1305.exp \ shorthash.exp \ sign.exp \ siphashx24.exp \ @@ -83,6 +87,8 @@ EXTRA_DIST = \ xchacha20.exp DISTCLEANFILES = \ + aead_aegis128l.res \ + aead_aegis256.res \ aead_aes256gcm.res \ aead_aes256gcm2.res \ aead_chacha20poly1305.res \ @@ -120,6 +126,7 @@ DISTCLEANFILES = \ hash2.res \ hash3.res \ kdf.res \ + kdf_hkdf.res \ keygen.res \ kx.res \ metamorphic.res \ @@ -146,7 +153,7 @@ DISTCLEANFILES = \ secretbox8.res \ secretbox_easy.res \ secretbox_easy2.res \ - secretstream.res \ + secretstream_xchacha20poly1305.res \ shorthash.res \ sign.res \ siphashx24.res \ @@ -173,6 +180,8 @@ AM_CPPFLAGS = \ AM_LDFLAGS = @TEST_LDFLAGS@ TESTS_TARGETS = \ + aead_aegis128l \ + aead_aegis256 \ aead_aes256gcm \ aead_aes256gcm2 \ aead_chacha20poly1305 \ @@ -229,7 +238,7 @@ TESTS_TARGETS = \ secretbox8 \ secretbox_easy \ secretbox_easy2 \ - secretstream \ + secretstream_xchacha20poly1305 \ shorthash \ sign \ sodium_core \ @@ -254,6 +263,12 @@ TESTS = $(TESTS_TARGETS) TESTS_LDADD = \ ${top_builddir}/src/libsodium/libsodium.la +aead_aegis128l_SOURCE = cmptest.h aead_aegis128l.c +aead_aegis128l_LDADD = $(TESTS_LDADD) + +aead_aegis256_SOURCE = cmptest.h aead_aegis256.c +aead_aegis256_LDADD = $(TESTS_LDADD) + aead_aes256gcm_SOURCE = cmptest.h aead_aes256gcm.c aead_aes256gcm_LDADD = $(TESTS_LDADD) @@ -362,6 +377,9 @@ hash3_LDADD = $(TESTS_LDADD) kdf_SOURCE = cmptest.h kdf.c kdf_LDADD = $(TESTS_LDADD) +kdf_hkdf_SOURCE = cmptest.h kdf_hkdf.c +kdf_hkdf_LDADD = $(TESTS_LDADD) + keygen_SOURCE = cmptest.h keygen.c keygen_LDADD = $(TESTS_LDADD) @@ -440,8 +458,8 @@ secretbox_easy_LDADD = $(TESTS_LDADD) secretbox_easy2_SOURCE = cmptest.h secretbox_easy2.c secretbox_easy2_LDADD = $(TESTS_LDADD) -secretstream_SOURCE = cmptest.h secretstream.c -secretstream_LDADD = $(TESTS_LDADD) +secretstream_xchacha20poly1305_SOURCE = cmptest.h secretstream_xchacha20poly1305.c +secretstream_xchacha20poly1305_LDADD = $(TESTS_LDADD) shorthash_SOURCE = cmptest.h shorthash.c shorthash_LDADD = $(TESTS_LDADD) @@ -489,6 +507,7 @@ if !MINIMAL TESTS_TARGETS += \ core_ed25519 \ core_ristretto255 \ + kdf_hkdf \ pwhash_scrypt \ pwhash_scrypt_ll \ scalarmult_ed25519 \ diff --git a/src/libsodium/test/default/Makefile.in b/src/libsodium/test/default/Makefile.in index 4ca0b1b41..cc98c05bd 100644 --- a/src/libsodium/test/default/Makefile.in +++ b/src/libsodium/test/default/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -97,6 +97,7 @@ TESTS = $(am__EXEEXT_3) @MINIMAL_FALSE@am__append_2 = \ @MINIMAL_FALSE@ core_ed25519 \ @MINIMAL_FALSE@ core_ristretto255 \ +@MINIMAL_FALSE@ kdf_hkdf \ @MINIMAL_FALSE@ pwhash_scrypt \ @MINIMAL_FALSE@ pwhash_scrypt_ll \ @MINIMAL_FALSE@ scalarmult_ed25519 \ @@ -127,13 +128,14 @@ CONFIG_CLEAN_VPATH_FILES = @EMSCRIPTEN_FALSE@am__EXEEXT_1 = sodium_utils2$(EXEEXT) \ @EMSCRIPTEN_FALSE@ sodium_utils3$(EXEEXT) @MINIMAL_FALSE@am__EXEEXT_2 = core_ed25519$(EXEEXT) \ -@MINIMAL_FALSE@ core_ristretto255$(EXEEXT) \ +@MINIMAL_FALSE@ core_ristretto255$(EXEEXT) kdf_hkdf$(EXEEXT) \ @MINIMAL_FALSE@ pwhash_scrypt$(EXEEXT) \ @MINIMAL_FALSE@ pwhash_scrypt_ll$(EXEEXT) \ @MINIMAL_FALSE@ scalarmult_ed25519$(EXEEXT) \ @MINIMAL_FALSE@ scalarmult_ristretto255$(EXEEXT) \ @MINIMAL_FALSE@ siphashx24$(EXEEXT) xchacha20$(EXEEXT) -am__EXEEXT_3 = aead_aes256gcm$(EXEEXT) aead_aes256gcm2$(EXEEXT) \ +am__EXEEXT_3 = aead_aegis128l$(EXEEXT) aead_aegis256$(EXEEXT) \ + aead_aes256gcm$(EXEEXT) aead_aes256gcm2$(EXEEXT) \ aead_chacha20poly1305$(EXEEXT) aead_chacha20poly13052$(EXEEXT) \ aead_xchacha20poly1305$(EXEEXT) auth$(EXEEXT) auth2$(EXEEXT) \ auth3$(EXEEXT) auth5$(EXEEXT) auth6$(EXEEXT) auth7$(EXEEXT) \ @@ -152,18 +154,25 @@ am__EXEEXT_3 = aead_aes256gcm$(EXEEXT) aead_aes256gcm2$(EXEEXT) \ scalarmult6$(EXEEXT) scalarmult7$(EXEEXT) scalarmult8$(EXEEXT) \ secretbox$(EXEEXT) secretbox2$(EXEEXT) secretbox7$(EXEEXT) \ secretbox8$(EXEEXT) secretbox_easy$(EXEEXT) \ - secretbox_easy2$(EXEEXT) secretstream$(EXEEXT) \ - shorthash$(EXEEXT) sign$(EXEEXT) sodium_core$(EXEEXT) \ - sodium_utils$(EXEEXT) sodium_version$(EXEEXT) stream$(EXEEXT) \ - stream2$(EXEEXT) stream3$(EXEEXT) stream4$(EXEEXT) \ - verify1$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) -aead_aes256gcm_SOURCES = aead_aes256gcm.c -aead_aes256gcm_OBJECTS = aead_aes256gcm.$(OBJEXT) -aead_aes256gcm_DEPENDENCIES = $(TESTS_LDADD) + secretbox_easy2$(EXEEXT) \ + secretstream_xchacha20poly1305$(EXEEXT) shorthash$(EXEEXT) \ + sign$(EXEEXT) sodium_core$(EXEEXT) sodium_utils$(EXEEXT) \ + sodium_version$(EXEEXT) stream$(EXEEXT) stream2$(EXEEXT) \ + stream3$(EXEEXT) stream4$(EXEEXT) verify1$(EXEEXT) \ + $(am__EXEEXT_1) $(am__EXEEXT_2) +aead_aegis128l_SOURCES = aead_aegis128l.c +aead_aegis128l_OBJECTS = aead_aegis128l.$(OBJEXT) +aead_aegis128l_DEPENDENCIES = $(TESTS_LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +aead_aegis256_SOURCES = aead_aegis256.c +aead_aegis256_OBJECTS = aead_aegis256.$(OBJEXT) +aead_aegis256_DEPENDENCIES = $(TESTS_LDADD) +aead_aes256gcm_SOURCES = aead_aes256gcm.c +aead_aes256gcm_OBJECTS = aead_aes256gcm.$(OBJEXT) +aead_aes256gcm_DEPENDENCIES = $(TESTS_LDADD) aead_aes256gcm2_SOURCES = aead_aes256gcm2.c aead_aes256gcm2_OBJECTS = aead_aes256gcm2.$(OBJEXT) aead_aes256gcm2_DEPENDENCIES = $(TESTS_LDADD) @@ -269,6 +278,9 @@ hash3_DEPENDENCIES = $(TESTS_LDADD) kdf_SOURCES = kdf.c kdf_OBJECTS = kdf.$(OBJEXT) kdf_DEPENDENCIES = $(TESTS_LDADD) +kdf_hkdf_SOURCES = kdf_hkdf.c +kdf_hkdf_OBJECTS = kdf_hkdf.$(OBJEXT) +kdf_hkdf_DEPENDENCIES = $(TESTS_LDADD) keygen_SOURCES = keygen.c keygen_OBJECTS = keygen.$(OBJEXT) keygen_DEPENDENCIES = $(TESTS_LDADD) @@ -347,9 +359,11 @@ secretbox_easy_DEPENDENCIES = $(TESTS_LDADD) secretbox_easy2_SOURCES = secretbox_easy2.c secretbox_easy2_OBJECTS = secretbox_easy2.$(OBJEXT) secretbox_easy2_DEPENDENCIES = $(TESTS_LDADD) -secretstream_SOURCES = secretstream.c -secretstream_OBJECTS = secretstream.$(OBJEXT) -secretstream_DEPENDENCIES = $(TESTS_LDADD) +secretstream_xchacha20poly1305_SOURCES = \ + secretstream_xchacha20poly1305.c +secretstream_xchacha20poly1305_OBJECTS = \ + secretstream_xchacha20poly1305.$(OBJEXT) +secretstream_xchacha20poly1305_DEPENDENCIES = $(TESTS_LDADD) shorthash_SOURCES = shorthash.c shorthash_OBJECTS = shorthash.$(OBJEXT) shorthash_DEPENDENCIES = $(TESTS_LDADD) @@ -407,7 +421,8 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/aead_aes256gcm.Po \ +am__depfiles_remade = ./$(DEPDIR)/aead_aegis128l.Po \ + ./$(DEPDIR)/aead_aegis256.Po ./$(DEPDIR)/aead_aes256gcm.Po \ ./$(DEPDIR)/aead_aes256gcm2.Po \ ./$(DEPDIR)/aead_chacha20poly1305.Po \ ./$(DEPDIR)/aead_chacha20poly13052.Po \ @@ -424,28 +439,28 @@ am__depfiles_remade = ./$(DEPDIR)/aead_aes256gcm.Po \ ./$(DEPDIR)/ed25519_convert.Po ./$(DEPDIR)/generichash.Po \ ./$(DEPDIR)/generichash2.Po ./$(DEPDIR)/generichash3.Po \ ./$(DEPDIR)/hash.Po ./$(DEPDIR)/hash3.Po ./$(DEPDIR)/kdf.Po \ - ./$(DEPDIR)/keygen.Po ./$(DEPDIR)/kx.Po \ - ./$(DEPDIR)/metamorphic.Po ./$(DEPDIR)/misuse.Po \ - ./$(DEPDIR)/onetimeauth.Po ./$(DEPDIR)/onetimeauth2.Po \ - ./$(DEPDIR)/onetimeauth7.Po ./$(DEPDIR)/pwhash_argon2i.Po \ - ./$(DEPDIR)/pwhash_argon2id.Po ./$(DEPDIR)/pwhash_scrypt.Po \ - ./$(DEPDIR)/pwhash_scrypt_ll.Po ./$(DEPDIR)/randombytes.Po \ - ./$(DEPDIR)/scalarmult.Po ./$(DEPDIR)/scalarmult2.Po \ - ./$(DEPDIR)/scalarmult5.Po ./$(DEPDIR)/scalarmult6.Po \ - ./$(DEPDIR)/scalarmult7.Po ./$(DEPDIR)/scalarmult8.Po \ - ./$(DEPDIR)/scalarmult_ed25519.Po \ + ./$(DEPDIR)/kdf_hkdf.Po ./$(DEPDIR)/keygen.Po \ + ./$(DEPDIR)/kx.Po ./$(DEPDIR)/metamorphic.Po \ + ./$(DEPDIR)/misuse.Po ./$(DEPDIR)/onetimeauth.Po \ + ./$(DEPDIR)/onetimeauth2.Po ./$(DEPDIR)/onetimeauth7.Po \ + ./$(DEPDIR)/pwhash_argon2i.Po ./$(DEPDIR)/pwhash_argon2id.Po \ + ./$(DEPDIR)/pwhash_scrypt.Po ./$(DEPDIR)/pwhash_scrypt_ll.Po \ + ./$(DEPDIR)/randombytes.Po ./$(DEPDIR)/scalarmult.Po \ + ./$(DEPDIR)/scalarmult2.Po ./$(DEPDIR)/scalarmult5.Po \ + ./$(DEPDIR)/scalarmult6.Po ./$(DEPDIR)/scalarmult7.Po \ + ./$(DEPDIR)/scalarmult8.Po ./$(DEPDIR)/scalarmult_ed25519.Po \ ./$(DEPDIR)/scalarmult_ristretto255.Po \ ./$(DEPDIR)/secretbox.Po ./$(DEPDIR)/secretbox2.Po \ ./$(DEPDIR)/secretbox7.Po ./$(DEPDIR)/secretbox8.Po \ ./$(DEPDIR)/secretbox_easy.Po ./$(DEPDIR)/secretbox_easy2.Po \ - ./$(DEPDIR)/secretstream.Po ./$(DEPDIR)/shorthash.Po \ - ./$(DEPDIR)/sign.Po ./$(DEPDIR)/siphashx24.Po \ - ./$(DEPDIR)/sodium_core.Po ./$(DEPDIR)/sodium_utils.Po \ - ./$(DEPDIR)/sodium_utils2.Po ./$(DEPDIR)/sodium_utils3.Po \ - ./$(DEPDIR)/sodium_version.Po ./$(DEPDIR)/stream.Po \ - ./$(DEPDIR)/stream2.Po ./$(DEPDIR)/stream3.Po \ - ./$(DEPDIR)/stream4.Po ./$(DEPDIR)/verify1.Po \ - ./$(DEPDIR)/xchacha20.Po + ./$(DEPDIR)/secretstream_xchacha20poly1305.Po \ + ./$(DEPDIR)/shorthash.Po ./$(DEPDIR)/sign.Po \ + ./$(DEPDIR)/siphashx24.Po ./$(DEPDIR)/sodium_core.Po \ + ./$(DEPDIR)/sodium_utils.Po ./$(DEPDIR)/sodium_utils2.Po \ + ./$(DEPDIR)/sodium_utils3.Po ./$(DEPDIR)/sodium_version.Po \ + ./$(DEPDIR)/stream.Po ./$(DEPDIR)/stream2.Po \ + ./$(DEPDIR)/stream3.Po ./$(DEPDIR)/stream4.Po \ + ./$(DEPDIR)/verify1.Po ./$(DEPDIR)/xchacha20.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -465,42 +480,44 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = aead_aes256gcm.c aead_aes256gcm2.c aead_chacha20poly1305.c \ +SOURCES = aead_aegis128l.c aead_aegis256.c aead_aes256gcm.c \ + aead_aes256gcm2.c aead_chacha20poly1305.c \ + aead_chacha20poly13052.c aead_xchacha20poly1305.c auth.c \ + auth2.c auth3.c auth5.c auth6.c auth7.c box.c box2.c box7.c \ + box8.c box_easy.c box_easy2.c box_seal.c box_seed.c chacha20.c \ + codecs.c core1.c core2.c core3.c core4.c core5.c core6.c \ + core_ed25519.c core_ristretto255.c ed25519_convert.c \ + generichash.c generichash2.c generichash3.c hash.c hash3.c \ + kdf.c kdf_hkdf.c keygen.c kx.c metamorphic.c misuse.c \ + onetimeauth.c onetimeauth2.c onetimeauth7.c pwhash_argon2i.c \ + pwhash_argon2id.c pwhash_scrypt.c pwhash_scrypt_ll.c \ + randombytes.c scalarmult.c scalarmult2.c scalarmult5.c \ + scalarmult6.c scalarmult7.c scalarmult8.c scalarmult_ed25519.c \ + scalarmult_ristretto255.c secretbox.c secretbox2.c \ + secretbox7.c secretbox8.c secretbox_easy.c secretbox_easy2.c \ + secretstream_xchacha20poly1305.c shorthash.c sign.c \ + siphashx24.c sodium_core.c sodium_utils.c sodium_utils2.c \ + sodium_utils3.c sodium_version.c stream.c stream2.c stream3.c \ + stream4.c verify1.c xchacha20.c +DIST_SOURCES = aead_aegis128l.c aead_aegis256.c aead_aes256gcm.c \ + aead_aes256gcm2.c aead_chacha20poly1305.c \ aead_chacha20poly13052.c aead_xchacha20poly1305.c auth.c \ auth2.c auth3.c auth5.c auth6.c auth7.c box.c box2.c box7.c \ box8.c box_easy.c box_easy2.c box_seal.c box_seed.c chacha20.c \ codecs.c core1.c core2.c core3.c core4.c core5.c core6.c \ core_ed25519.c core_ristretto255.c ed25519_convert.c \ generichash.c generichash2.c generichash3.c hash.c hash3.c \ - kdf.c keygen.c kx.c metamorphic.c misuse.c onetimeauth.c \ - onetimeauth2.c onetimeauth7.c pwhash_argon2i.c \ + kdf.c kdf_hkdf.c keygen.c kx.c metamorphic.c misuse.c \ + onetimeauth.c onetimeauth2.c onetimeauth7.c pwhash_argon2i.c \ pwhash_argon2id.c pwhash_scrypt.c pwhash_scrypt_ll.c \ randombytes.c scalarmult.c scalarmult2.c scalarmult5.c \ scalarmult6.c scalarmult7.c scalarmult8.c scalarmult_ed25519.c \ scalarmult_ristretto255.c secretbox.c secretbox2.c \ secretbox7.c secretbox8.c secretbox_easy.c secretbox_easy2.c \ - secretstream.c shorthash.c sign.c siphashx24.c sodium_core.c \ - sodium_utils.c sodium_utils2.c sodium_utils3.c \ - sodium_version.c stream.c stream2.c stream3.c stream4.c \ - verify1.c xchacha20.c -DIST_SOURCES = aead_aes256gcm.c aead_aes256gcm2.c \ - aead_chacha20poly1305.c aead_chacha20poly13052.c \ - aead_xchacha20poly1305.c auth.c auth2.c auth3.c auth5.c \ - auth6.c auth7.c box.c box2.c box7.c box8.c box_easy.c \ - box_easy2.c box_seal.c box_seed.c chacha20.c codecs.c core1.c \ - core2.c core3.c core4.c core5.c core6.c core_ed25519.c \ - core_ristretto255.c ed25519_convert.c generichash.c \ - generichash2.c generichash3.c hash.c hash3.c kdf.c keygen.c \ - kx.c metamorphic.c misuse.c onetimeauth.c onetimeauth2.c \ - onetimeauth7.c pwhash_argon2i.c pwhash_argon2id.c \ - pwhash_scrypt.c pwhash_scrypt_ll.c randombytes.c scalarmult.c \ - scalarmult2.c scalarmult5.c scalarmult6.c scalarmult7.c \ - scalarmult8.c scalarmult_ed25519.c scalarmult_ristretto255.c \ - secretbox.c secretbox2.c secretbox7.c secretbox8.c \ - secretbox_easy.c secretbox_easy2.c secretstream.c shorthash.c \ - sign.c siphashx24.c sodium_core.c sodium_utils.c \ - sodium_utils2.c sodium_utils3.c sodium_version.c stream.c \ - stream2.c stream3.c stream4.c verify1.c xchacha20.c + secretstream_xchacha20poly1305.c shorthash.c sign.c \ + siphashx24.c sodium_core.c sodium_utils.c sodium_utils2.c \ + sodium_utils3.c sodium_version.c stream.c stream2.c stream3.c \ + stream4.c verify1.c xchacha20.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -523,8 +540,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -750,6 +765,7 @@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ +CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ @@ -762,6 +778,8 @@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -778,8 +796,10 @@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ @@ -899,10 +919,13 @@ top_srcdir = @top_srcdir@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ EXTRA_DIST = \ + run.sh \ cmptest.h \ wasi-test-wrapper.sh \ wintest.bat \ pre.js.inc \ + aead_aegis128l.exp \ + aead_aegis256.exp \ aead_aes256gcm.exp \ aead_aes256gcm2.exp \ aead_chacha20poly1305.exp \ @@ -939,6 +962,7 @@ EXTRA_DIST = \ hash.exp \ hash3.exp \ kdf.exp \ + kdf_hkdf.exp \ keygen.exp \ kx.exp \ metamorphic.exp \ @@ -965,7 +989,7 @@ EXTRA_DIST = \ secretbox8.exp \ secretbox_easy.exp \ secretbox_easy2.exp \ - secretstream.exp \ + secretstream_xchacha20poly1305.exp \ shorthash.exp \ sign.exp \ siphashx24.exp \ @@ -982,6 +1006,8 @@ EXTRA_DIST = \ xchacha20.exp DISTCLEANFILES = \ + aead_aegis128l.res \ + aead_aegis256.res \ aead_aes256gcm.res \ aead_aes256gcm2.res \ aead_chacha20poly1305.res \ @@ -1019,6 +1045,7 @@ DISTCLEANFILES = \ hash2.res \ hash3.res \ kdf.res \ + kdf_hkdf.res \ keygen.res \ kx.res \ metamorphic.res \ @@ -1045,7 +1072,7 @@ DISTCLEANFILES = \ secretbox8.res \ secretbox_easy.res \ secretbox_easy2.res \ - secretstream.res \ + secretstream_xchacha20poly1305.res \ shorthash.res \ sign.res \ siphashx24.res \ @@ -1070,22 +1097,26 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/test/quirks AM_LDFLAGS = @TEST_LDFLAGS@ -TESTS_TARGETS = aead_aes256gcm aead_aes256gcm2 aead_chacha20poly1305 \ - aead_chacha20poly13052 aead_xchacha20poly1305 auth auth2 auth3 \ - auth5 auth6 auth7 box box2 box7 box8 box_easy box_easy2 \ - box_seal box_seed chacha20 codecs core1 core2 core3 core4 \ - core5 core6 ed25519_convert generichash generichash2 \ - generichash3 hash hash3 kdf keygen kx metamorphic misuse \ - onetimeauth onetimeauth2 onetimeauth7 pwhash_argon2i \ - pwhash_argon2id randombytes scalarmult scalarmult2 scalarmult5 \ - scalarmult6 scalarmult7 scalarmult8 secretbox secretbox2 \ - secretbox7 secretbox8 secretbox_easy secretbox_easy2 \ - secretstream shorthash sign sodium_core sodium_utils \ - sodium_version stream stream2 stream3 stream4 verify1 \ - $(am__append_1) $(am__append_2) +TESTS_TARGETS = aead_aegis128l aead_aegis256 aead_aes256gcm \ + aead_aes256gcm2 aead_chacha20poly1305 aead_chacha20poly13052 \ + aead_xchacha20poly1305 auth auth2 auth3 auth5 auth6 auth7 box \ + box2 box7 box8 box_easy box_easy2 box_seal box_seed chacha20 \ + codecs core1 core2 core3 core4 core5 core6 ed25519_convert \ + generichash generichash2 generichash3 hash hash3 kdf keygen kx \ + metamorphic misuse onetimeauth onetimeauth2 onetimeauth7 \ + pwhash_argon2i pwhash_argon2id randombytes scalarmult \ + scalarmult2 scalarmult5 scalarmult6 scalarmult7 scalarmult8 \ + secretbox secretbox2 secretbox7 secretbox8 secretbox_easy \ + secretbox_easy2 secretstream_xchacha20poly1305 shorthash sign \ + sodium_core sodium_utils sodium_version stream stream2 stream3 \ + stream4 verify1 $(am__append_1) $(am__append_2) TESTS_LDADD = \ ${top_builddir}/src/libsodium/libsodium.la +aead_aegis128l_SOURCE = cmptest.h aead_aegis128l.c +aead_aegis128l_LDADD = $(TESTS_LDADD) +aead_aegis256_SOURCE = cmptest.h aead_aegis256.c +aead_aegis256_LDADD = $(TESTS_LDADD) aead_aes256gcm_SOURCE = cmptest.h aead_aes256gcm.c aead_aes256gcm_LDADD = $(TESTS_LDADD) aead_aes256gcm2_SOURCE = cmptest.h aead_aes256gcm2.c @@ -1158,6 +1189,8 @@ hash3_SOURCE = cmptest.h hash3.c hash3_LDADD = $(TESTS_LDADD) kdf_SOURCE = cmptest.h kdf.c kdf_LDADD = $(TESTS_LDADD) +kdf_hkdf_SOURCE = cmptest.h kdf_hkdf.c +kdf_hkdf_LDADD = $(TESTS_LDADD) keygen_SOURCE = cmptest.h keygen.c keygen_LDADD = $(TESTS_LDADD) kx_SOURCE = cmptest.h kx.c @@ -1210,8 +1243,8 @@ secretbox_easy_SOURCE = cmptest.h secretbox_easy.c secretbox_easy_LDADD = $(TESTS_LDADD) secretbox_easy2_SOURCE = cmptest.h secretbox_easy2.c secretbox_easy2_LDADD = $(TESTS_LDADD) -secretstream_SOURCE = cmptest.h secretstream.c -secretstream_LDADD = $(TESTS_LDADD) +secretstream_xchacha20poly1305_SOURCE = cmptest.h secretstream_xchacha20poly1305.c +secretstream_xchacha20poly1305_LDADD = $(TESTS_LDADD) shorthash_SOURCE = cmptest.h shorthash.c shorthash_LDADD = $(TESTS_LDADD) sign_SOURCE = cmptest.h sign.c @@ -1284,6 +1317,14 @@ clean-checkPROGRAMS: echo " rm -f" $$list; \ rm -f $$list +aead_aegis128l$(EXEEXT): $(aead_aegis128l_OBJECTS) $(aead_aegis128l_DEPENDENCIES) $(EXTRA_aead_aegis128l_DEPENDENCIES) + @rm -f aead_aegis128l$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aead_aegis128l_OBJECTS) $(aead_aegis128l_LDADD) $(LIBS) + +aead_aegis256$(EXEEXT): $(aead_aegis256_OBJECTS) $(aead_aegis256_DEPENDENCIES) $(EXTRA_aead_aegis256_DEPENDENCIES) + @rm -f aead_aegis256$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aead_aegis256_OBJECTS) $(aead_aegis256_LDADD) $(LIBS) + aead_aes256gcm$(EXEEXT): $(aead_aes256gcm_OBJECTS) $(aead_aes256gcm_DEPENDENCIES) $(EXTRA_aead_aes256gcm_DEPENDENCIES) @rm -f aead_aes256gcm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aead_aes256gcm_OBJECTS) $(aead_aes256gcm_LDADD) $(LIBS) @@ -1428,6 +1469,10 @@ kdf$(EXEEXT): $(kdf_OBJECTS) $(kdf_DEPENDENCIES) $(EXTRA_kdf_DEPENDENCIES) @rm -f kdf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kdf_OBJECTS) $(kdf_LDADD) $(LIBS) +kdf_hkdf$(EXEEXT): $(kdf_hkdf_OBJECTS) $(kdf_hkdf_DEPENDENCIES) $(EXTRA_kdf_hkdf_DEPENDENCIES) + @rm -f kdf_hkdf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kdf_hkdf_OBJECTS) $(kdf_hkdf_LDADD) $(LIBS) + keygen$(EXEEXT): $(keygen_OBJECTS) $(keygen_DEPENDENCIES) $(EXTRA_keygen_DEPENDENCIES) @rm -f keygen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(keygen_OBJECTS) $(keygen_LDADD) $(LIBS) @@ -1532,9 +1577,9 @@ secretbox_easy2$(EXEEXT): $(secretbox_easy2_OBJECTS) $(secretbox_easy2_DEPENDENC @rm -f secretbox_easy2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(secretbox_easy2_OBJECTS) $(secretbox_easy2_LDADD) $(LIBS) -secretstream$(EXEEXT): $(secretstream_OBJECTS) $(secretstream_DEPENDENCIES) $(EXTRA_secretstream_DEPENDENCIES) - @rm -f secretstream$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(secretstream_OBJECTS) $(secretstream_LDADD) $(LIBS) +secretstream_xchacha20poly1305$(EXEEXT): $(secretstream_xchacha20poly1305_OBJECTS) $(secretstream_xchacha20poly1305_DEPENDENCIES) $(EXTRA_secretstream_xchacha20poly1305_DEPENDENCIES) + @rm -f secretstream_xchacha20poly1305$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(secretstream_xchacha20poly1305_OBJECTS) $(secretstream_xchacha20poly1305_LDADD) $(LIBS) shorthash$(EXEEXT): $(shorthash_OBJECTS) $(shorthash_DEPENDENCIES) $(EXTRA_shorthash_DEPENDENCIES) @rm -f shorthash$(EXEEXT) @@ -1598,6 +1643,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aead_aegis128l.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aead_aegis256.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aead_aes256gcm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aead_aes256gcm2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aead_chacha20poly1305.Po@am__quote@ # am--include-marker @@ -1634,6 +1681,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash3.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kdf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kdf_hkdf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keygen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metamorphic.Po@am__quote@ # am--include-marker @@ -1660,7 +1708,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretbox8.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretbox_easy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretbox_easy2.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretstream.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secretstream_xchacha20poly1305.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shorthash.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siphashx24.Po@am__quote@ # am--include-marker @@ -1905,6 +1953,20 @@ recheck: all $(check_PROGRAMS) am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? +aead_aegis128l.log: aead_aegis128l$(EXEEXT) + @p='aead_aegis128l$(EXEEXT)'; \ + b='aead_aegis128l'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +aead_aegis256.log: aead_aegis256$(EXEEXT) + @p='aead_aegis256$(EXEEXT)'; \ + b='aead_aegis256'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) aead_aes256gcm.log: aead_aes256gcm$(EXEEXT) @p='aead_aes256gcm$(EXEEXT)'; \ b='aead_aes256gcm'; \ @@ -2297,9 +2359,9 @@ secretbox_easy2.log: secretbox_easy2$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) -secretstream.log: secretstream$(EXEEXT) - @p='secretstream$(EXEEXT)'; \ - b='secretstream'; \ +secretstream_xchacha20poly1305.log: secretstream_xchacha20poly1305$(EXEEXT) + @p='secretstream_xchacha20poly1305$(EXEEXT)'; \ + b='secretstream_xchacha20poly1305'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ @@ -2402,6 +2464,13 @@ core_ristretto255.log: core_ristretto255$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +kdf_hkdf.log: kdf_hkdf$(EXEEXT) + @p='kdf_hkdf$(EXEEXT)'; \ + b='kdf_hkdf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) pwhash_scrypt.log: pwhash_scrypt$(EXEEXT) @p='pwhash_scrypt$(EXEEXT)'; \ b='pwhash_scrypt'; \ @@ -2458,7 +2527,6 @@ xchacha20.log: xchacha20$(EXEEXT) @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -2538,7 +2606,9 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/aead_aes256gcm.Po + -rm -f ./$(DEPDIR)/aead_aegis128l.Po + -rm -f ./$(DEPDIR)/aead_aegis256.Po + -rm -f ./$(DEPDIR)/aead_aes256gcm.Po -rm -f ./$(DEPDIR)/aead_aes256gcm2.Po -rm -f ./$(DEPDIR)/aead_chacha20poly1305.Po -rm -f ./$(DEPDIR)/aead_chacha20poly13052.Po @@ -2574,6 +2644,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/hash.Po -rm -f ./$(DEPDIR)/hash3.Po -rm -f ./$(DEPDIR)/kdf.Po + -rm -f ./$(DEPDIR)/kdf_hkdf.Po -rm -f ./$(DEPDIR)/keygen.Po -rm -f ./$(DEPDIR)/kx.Po -rm -f ./$(DEPDIR)/metamorphic.Po @@ -2600,7 +2671,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/secretbox8.Po -rm -f ./$(DEPDIR)/secretbox_easy.Po -rm -f ./$(DEPDIR)/secretbox_easy2.Po - -rm -f ./$(DEPDIR)/secretstream.Po + -rm -f ./$(DEPDIR)/secretstream_xchacha20poly1305.Po -rm -f ./$(DEPDIR)/shorthash.Po -rm -f ./$(DEPDIR)/sign.Po -rm -f ./$(DEPDIR)/siphashx24.Po @@ -2660,7 +2731,9 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/aead_aes256gcm.Po + -rm -f ./$(DEPDIR)/aead_aegis128l.Po + -rm -f ./$(DEPDIR)/aead_aegis256.Po + -rm -f ./$(DEPDIR)/aead_aes256gcm.Po -rm -f ./$(DEPDIR)/aead_aes256gcm2.Po -rm -f ./$(DEPDIR)/aead_chacha20poly1305.Po -rm -f ./$(DEPDIR)/aead_chacha20poly13052.Po @@ -2696,6 +2769,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/hash.Po -rm -f ./$(DEPDIR)/hash3.Po -rm -f ./$(DEPDIR)/kdf.Po + -rm -f ./$(DEPDIR)/kdf_hkdf.Po -rm -f ./$(DEPDIR)/keygen.Po -rm -f ./$(DEPDIR)/kx.Po -rm -f ./$(DEPDIR)/metamorphic.Po @@ -2722,7 +2796,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/secretbox8.Po -rm -f ./$(DEPDIR)/secretbox_easy.Po -rm -f ./$(DEPDIR)/secretbox_easy2.Po - -rm -f ./$(DEPDIR)/secretstream.Po + -rm -f ./$(DEPDIR)/secretstream_xchacha20poly1305.Po -rm -f ./$(DEPDIR)/shorthash.Po -rm -f ./$(DEPDIR)/sign.Po -rm -f ./$(DEPDIR)/siphashx24.Po diff --git a/src/libsodium/test/default/aead_aegis128l.c b/src/libsodium/test/default/aead_aegis128l.c new file mode 100644 index 000000000..b8d85aa3a --- /dev/null +++ b/src/libsodium/test/default/aead_aegis128l.c @@ -0,0 +1,642 @@ +#define TEST_NAME "aead_aegis128l" +#include "cmptest.h" + +static struct { + const char *key_hex; + const char *nonce_hex; + const char *message_hex; + const char *ad_hex; + const char *ciphertext_hex; + const char *mac_hex; +} tests[] = { + { "54662e55bb4771f9711fe5301d7412fe", "e51d417ab10a2931d8d22a9fffb98e3a", + "04f672f8cdb3e71d032d52c064bc33ecf8aad3d40c41d5806cc306766c057c50b500af5c550d076d34cc3a74a2b4" + "bed195ffa3e8eddf953aefe9aed2bc14349c700ab7e4cb974fb31615a9ff70fb44307055523ab378b133fefc8830" + "13ce23bb01b23aeda15f85e65cdf02a291a0454900cb261872d5205737fd7410", + "3b762e3ab5d06cb2896b852ea70303f289f2775401b7808e30272f", + "d6736371f35eb067244dd7963ad2e0cd3949452cbd4c220be55082498ed3b230f579d78844311652a9958e82f172" + "bb8072c4b1114ec531a6ccb340ddd86caf32a0d4c9c45738e9ec9c0d9154612f7d90465f3a277bebd667c0af0edb" + "6935d8dffbdee96c1a96e4c4318f5d3bc90c1c8d5729e1a402f765bdc9b26b08", + "ee9595bb3f1b32000578ffb751b508655b3cae8fecaf44f40d740fa0347e283a" }, + { "46a5c72e03d900b48f829df00ecb88b9", "b25187e4b77b6770c35c7a962584597d", + "fc8083311b38a80c04e57d069661b273264310906781eb7e4e44c6416f7336267674a44a7c54ed6361b43ef95005" + "14e5d9e71f8b5c33aece756b64f3ed011922facbec7c3ffd27d01a853435bde551372806bd0c", + "b73c81239e01cd81b0de13247ca4e3528b87f3078e2b674a667430b1dbdc3e93657131e654a4182b4c4ab01a33b3" + "6e946f1fcc55aab06fc6f56d", + "51189448af53ae3630c06a167ceefe6b9b5eba746fb9b53f4b3104d2b15b6020fa8998e182eb9c9d6b6463939e50" + "723780f983733206ae6f11b986d95abe83555e64f8d3242d7e8055fcb8e2df8e41d318f06728", + "caf8957f9ebc9a88469c04089962487a3c77040b82661616c5d5c83e974eae1e" }, + { "e343d75de99e6d73543968437d3dcf6a", "317a5808ed5debf6f527a780e0896b2d", + "247045cb40dea9c514a885444c526ac867b1b80e4728a23b63f596", "323094c01e", + "18cb5d2fc5e27bdda5ba16f1320da42049759368548e5bd96f2dbc", + "5d3e88816daf20f11018456b58b2614050b93b222f03be079b39a9bb2de49f47" }, + { "7db9c2721a03931c880f9e714bbf2211", "27f642398299ada7fdda1895ee4589f0", + "dc5180954df0c3391a60b44cbf70aee72b7dbb2addc90a0bf2ceac6113287eb501fe1ea9f4c51822664b82fe0279" + "b039f4", + "6dd5e43033fa6f021059a353edaf1f870387693054d0a2360fd1f6941a68f48ba972a1bc0816a446a6186e4a9a2f" + "9df556bf709470137b8e60d9daa2", + "c8a7d9131cebfa5388003cc30deac523aa9b09d148affff06ba40400e09ca900db770e07cedf5cd0647f6723c810" + "ffcb59", + "2c17a7022f6500450e86c8afdd60d3da535c2322fdf84f3dc67429e6ad92673f" }, + { "bef8a47bbf0ffc4ab56ad5d9899f42b6", "3a2195a5196a0d785e04b38dd62f056d", + "5aa0dc37e4db1de35789398b25dc656d05cdc6737de4e30ce944b304ec752bbd10ebfa51feff99dfcfe26b8526cc" + "9b0cf1ba3d1685fb26cfc0c8888fd3cdf55577a516328b289eebda2e14f15eeb1d0f4207efebe3803618d43d9968" + "8e6c", + "a4a290a0d719b1aaf58f24152402b2f36957f44ea8a2d76b045390f5e0a3559a8ec5b2f871fc6095152183b7be75" + "65d4953b593f854b8477e29ce0cdddce5cf8739ab56288c26c81921f1fbae38b90b287b4622ca8b5b6c0b4b02196" + "e73ee56af6ae427ca7ae3ca0", + "0ead975179d64f2b927440bf9ef666ab921e7a3b0832949f31315c2931451c5ddf810c17ad0330073922c07a18eb" + "665aca01c05de58f7d159a74884f9d90cc10dc8c017ab61b820fc3dd32be52f3f7265e3a7a912a230b2a7ed19992" + "e693", + "f61ace25382fc3f88ec63eab23a6f9f6d1be65d149428bbb778a77428f909863" }, + { "01f1cea5b7e20db64a67502bb4715033", "7336701bbc2d766167b57c452d010f02", + "b3669d31ef8040dd6f462624977d69cfd1869fb19946595759b7265eb98b51f579fddce4bd38452fe3", + "d007e9ce654ec9a8b44e3655dcac889176fbf8012b133c4effe70b716eff43264d67d84a3d8504858c01002957ca" + "c6eb75d94635fb708343a18e20615e4ecb963bd98a8e7bee66520fba5c2991541c1e7863c1c97ae7ba6c3c34f116" + "1518097b6e75dcfb3aa3e93995eb39", + "4e643f7a1b8c0d595c8ff2b00c0145deb5bfa13d8a1b75d7a731f2258b690e1a3b2ce2cbacc6d05c42", + "8f33c6494f971462bcf82a508f341905b8febf9a9d25363ce853d59230d5e60b" }, + { "76d53860e1c45cf60d76d8336948e337", "579c0f0993f13470fa301cd4c6fbe99a", + "d0f5d2b3b824fe01ca36d00d47434519b2112195093a06d9d07d7f4f9c5b8f2a4c68668265c40d6edd6e12b5a350" + "e4af11f1ee6226bf307a1a6c25318c0d3aa0421edf565ad42d524f69d0fef06c236c1f0d0e50261e205f381c3e11" + "96dd8827b9990d674288f8250596", + "a7a77cc847afdfb9dc8ceccc621462302f31233a830b3827ca68618e604c95ba8615f6ebb5ff1c2c66727e70c038" + "554619f96f79d08902fc70111f853766a2db04e51d", + "def4fcb75110820298f08a8a4941434deccb952dec01215f5e7f5a2509fcb9e2a994a77d5eaa617da9cf2f03483f" + "aff5831506e5617707b88e08195b6a993219898c3ead769ebaa002934d3c80023833d7ce4a7a989596de6fe78eb0" + "237e8caab0a9fcd2625af80caad6", + "a4a60bf81cb2ce55df3c5864eac4c93d7748010a1adb6e5110d389e0501d7004" }, + { "cd05e08e14686623fd334780439c4ae3", "d05ba5a655bf7b1be7500f205c9c80b9", + "021c20518825c167a746a728578a0f470b2035c7b39c75f3e492bcc2e6e96035c4fff65dfbfa93cbc7a37828a0cd" + "62bf1b20b3bb89425ae647e021cde586f652eb98c98b1ac1018c6fe3e046f41545bbfdbf94dca48e465aaed8efb7" + "eab5ea143e5b95b72a078f8fb58d8ecfdd9a3a968e2468b6", + "be9255f750498ce672c877285e649318bd5bf07cdc5902b7de61a8415b6fbf20b1e432ebc9f8f9c8e3094ff6dffd" + "1b1e0c3cc5", + "faa851ddfe54b01cf1a3caf34815c6db0145ddebd1f34ca9edd479bd4a3bb4bac21c2b5d365ff4d389a764bcc143" + "6e51267ed3e4f225b7cda1fbf25d221d91b59aed0b4d20f71859f41e85e15a02e2bcd59913d8ae019d1f01ede317" + "b4ff94ed2b05650259a705c3b2be2c2a9c82a4809dab7b03", + "83b60061bc457578effce5462091e0a2b1f8ee35dbdb6a6b17e4e6179df6eb18" }, + { "6870a5652199e2f17407185bd7cf18eb", "942988922482351c317244b26587c560", + "49b2f6765f7f552f8704671271d703b3b02157f71ed84e64481be8bbd4f3493bfd3f313ac62ba4e9a7d86288533a" + "7bc7a4257cad5db04bb80d6574e473519eccd15cd2", + "6cc34a81ee984b436947b31574473e0a849a341db0ebc67f64efb39c9e118f65cfb25d1d898b4ee8052f700cb43c" + "be744d70b71d2086a89ad12dd67feceacb092a861ba80e41808c625fbdce017d51916e1fb5b38b0beebb27478d83" + "90ec79b3f3902a4ac22d79", + "82d3ae3aea3870e40fa48da698adcb596eb43fb063866f6231bb744b687e32e72117a03da08a635e4ed0f255f28f" + "3db6f0b8a7238d0244994a507fe75ddd17138b0605", + "a3feae07a737428751dc2c92301bc012b0d5c9c41a7543d248d6213a90343565" }, + { "15a87aee858f5723beb477b2cc039d14", "6ce71c763784e59fba852ae39b25de3a", + "25d1d38a8e9e8c34564abbfcba69035ce2f78df8626543e7639f2f23d742853e34880e7bc6d684ed3075abdfb91e" + "36076242dc53d60513333f59d139e680aa246b0e7e6092e8d4e6ab471459068c2a83b07e8b7969c911e3bff7558c" + "af02b3f3e6de7ae9122d533558868d993b8242b2328834a88cd656a941", + "26fde5885fd22bdcba8b5c1b5f66d09c7da7bfef2790e6dd2a98a351056044495fe4", + "2e241f3f96e8bde7d2b5cfad94461d6c7282405c77918a2a8731711175211814e20e72ce01139643f58a2336c05c" + "c27458f042ff063bc73fbee2ca8c099ff1f3fbe8517fce6cd3d54567220218cc67b4ef52767f75fe514e8ec49013" + "d9fa787685a5a81efe550248f342eaade9cd61fb5037634f2bf621c944", + "694a5b5ae2081becf4d38b2958d3557438b9f04dbefbe649baa91924e17e4d88" }, + { "23e2250df6b870b6eebbce928cd1a80f", "279f73beda18846d7170c29414590029", + "9cdd4e34495b4a03ca2c5bef9074c1", + "f306eb122b1907b4b6bccc77984ea7be4a28f9ca3615135d4c84ad74d7469efefbbff997bb495806a3d9ab274b42" + "28cb894fceeb24c4905e121efbd3ce8be668dfee4f9e38584ba6c3374337d3c884cdaddcd96f63df225ddc879e0b" + "a4bce0125dd0", + "8821c6d2c36ae97bef1b9d78c1afba", + "155b5b0c92176ed1a2248bc86b04570620e97a2a601a3d730d53236f43696c28" }, + { "82f02cd289d07f40acf9a1d2b1cf7f06", "09162f09c3893bd2c5e4f2c8f6ec9930", + "29f1d0e8aef96c9936eb5bcb32b0f751b25a7a46d4cc5a33d5f96dcaea757b2b", + "4ccb0ba7f1b2eecbe3dc3ba47f797201ca656ab04e5b38df9b95ef24ba02a5ef04a9a8122f954048581d275e", + "6b8f329fa3e905b7c0df490f18a13ab3b6be6701cba59a1ee7c12d054c500e58", + "8c97a1010a25a9e9047d4dded0235450f488d3c18b460316e5ef5517edc82e3b" }, + { "a28c7a79d3d7d7b372c5cb4eb66201ba", "3c27d1ca6e8fd19cbf2dbd81c87d2ac0", + "0ff33640432edcf34a2df2527ca13a0340d5adcae1d10589edbc89701f5093efeaf6d7d3f97a778052a76a6efe7b" + "37021a4fbc8205f26f17dbd0c68b60c6403c4160985255aeac23c3bc88b1d8c11fd4197ba366962c", + "96bec6c8014708e9142a8ea0fd496f89f5a2414f4296ae0a185b13f362f2", + "f20be34587afaa4300683655ea16a292bfc7f2779cb771e520c6b0952e41a2b89e45f6c4b571779d573f1383b5e3" + "11f71ca89379b8a3eb9d9cde72b16e0f782058e9bb4df4731cbd7c67af1c459061ccff149da3bcdc", + "d9dd91cdfc19da4a95fca7229f296a74aafc0d78b2b398e7dc089cfc6309d281" }, + { "24d66092958836e491cf974f34ee7ca9", "1c04e8166ef37a2a5d34b4462a7ca8bd", + "01a77fb558d8d94c16eccc82b49f53823597272de8e6df070fefd202042665ef5788bab86c70dc3e571e3b372654" + "494e552ef00462bf0f7fdeca8efbaa51f3da63e6f18fd13a4668b7fb1a89464a09a17d9ce709b0b8f079d6bf93ed" + "4871c0", + "3c082dae68ee1cd6b8d1ef79593132e68e373eec746d13583f28d42730bfa18ed77ee83ad6c3db24bcda6d5e2925" + "970dc01d1968b744cf3753e597ef831dcab728ce66ef3da0ab872cb0dedf77922a57abfb", + "47ec41abfe34c4ece7ff8f3ba179238f38f3e527d97d7f3f6ada79a9609e715cd0acec31f0a0df25c7ac0bb894fe" + "791cc467a098710e92af75a14e68d9241c160d4587f7da279deaa9cc9d9c5a6e97b231021ab2ba9c63473cf269ef" + "294d1b", + "807d350484ead90c1470efc0c6e334999b204444034151c3b80961faa4b821d3" }, + { "78f67aada609c94a7c79f2fe9bf9c82e", "9ad46b00946c799b17b683ed3d920896", + "3fc884334f762cede042a56b4a89ad9eaf474459371f2daf7c157a352cd5ae6d45662593bd3eaba7bf59ed569429" + "c52153599f02e3263b2784be00e52e30d0347553fe8aa70a071c3f2e34593d1e78692f9a194800571eaaeedcf297" + "0784426959e0", + "80bb105971fd223f89efae15ae1b5e252c7e1c761b6abd5509d8354adbbb5007928763e715aad67b2109ac60afc7" + "3e386a75084c77a5af1021ddb4bc636c32a70ee95c6ef5eea9cba0d1c944754f328208ff78f7b0718899bacdf5d6" + "e603e1b098acbffc83a86a0e122078338e0bd5", + "325ce1b0bb065488f9f74f779bdc433da58412b3834005b4661491e7d9d6c2a371560ca7d649093a7ab2475548ed" + "b37b425c23f75eb1bf79b972714469174fc85665dbe2af774719d803c2426f067ae68da1ae0783ae376970055cc2" + "8d484ecae2e3", + "5f755de0d9a033967a9d23e3357332ad9640983fc121cc9104c8e79b37a9ea6d" }, + { "ba4c7e6a36e4684631fa5ede07b678cf", "ed722d3769b33d82626ce89bb4d212d9", + "ae106ad8029d73ff984de16db70772ca9adec5f2bffb1d92e12412b6f76f855463f47f1739d6e9a1fab5a9b7ff3e" + "ad419efd7fd7b31a0c5b9b992aa8d0ad754cb5ba371adfc60a5cdbcae37c4653b9cf5f46b015d31a03e10e288256" + "7d2c44255c30f1", + "1955a221ff4b3f271876a4bc04cfb41449881f6ff3a7e9aacaa1e992a5218af3294027709c1ec594bf863000ddb7" + "d561ca4c3f42340ee932e71eb8efd1b7dbd19f6ef0de28d437355b2b4cd1527cee849a315fc9a35ecb6e458e4af4" + "df07a9e108a0", + "aa24653b20af5925a19e486d0b28e3bafdb240aa984c8b365792443a5411c8385c8197d0a13f1a8a7686c02cc0f7" + "adbe1230736362afeb3c0ada988dec6d35fd298768866f64aac8dd560250e27bb1007a3fd4c312a8ce3af4af9ed2" + "7d5859ae56a3ac", + "b06f562123bfc9c4e36e2299da0d6987c2c191c2486ac2ff9e2baa156ce6cb81" }, + { "639668e0b0fbb192b83f870048d29c1c", "48ed7de6da13ba38a1e748eb9ea57529", "1ceca7", + "604b7b904ba56e1f2d17556236150e5bd19ba125f92e9adef0f75b38356fc9a1851ba34105805cae7e99dc7bdcf8" + "744c44f06e709c345cadcffde348d2d55c5c36cf5ee1f288509e7a878dc00daa3d9593afafd7a0d94fa78960b3ca" + "9fdb2b7d5746d1f4702080fadaf0cd6785373a16ceed056641aa4afe725e", + "0f5286", "b6b24c01ae14d452da68d75693fe772340ee1310d329281370c6c54231372be2" }, + { "94b94725497880ff10d89572b62d1029", "bbdb56d8112d298fd5686b93787e0011", + "f062bbe085b5f49ae4064f9ffd", "de189cbb1821775cb97888f25d4781ddb82d4664634f41", + "d317f2a31eaa3f23e84fc3eaa9", + "5098967201169e8ab8242b8e09322165127ef2155795f62fc1e55e6a72363fac" }, + { "8e6f1217eaf84aee8e5897f5860f184c", "a4e099068ad0b67f28b6902a40921dca", + "53c939f8d167e49980f8fd3ccc4a2ae3", + "4bb7fccecf15f0b32be37860507fc53812713194e2844855894ef916abbf9b5d", + "92e47292a4f02cc22d3392d1b6a089ce", + "a3eb3e03808499409b00f0bb635c6fbf12062469edb45f5bb252c08748e131ed" }, + { "6968acc00e83184e6024167672c5df8a", "2d5b193c93e8aa5302fb5bb20cd59504", "bd6b6830", + "7f4e725f4b0f84454e823b8193f1d8b39d78a8b12f1a2250beb0def895dd0aef8960652c071a82d9ad89910d9728" + "7e72848fba1623f441d4955a019f5c1a955b054db858722b1f15210c3a752fdbd2bd631620cc56c2c30d78ccb162" + "72eeeea1", + "c01c9b02", "9910104c7d6d91e99c167d027c4190701a21c2fcadc9874b1744cfda7b75b8c6" }, + { "1e7e0ef737799bb1e00ccd4e31da5ff9", "9d1111da7d3d329ab5d824404e4bdd60", + "76cbec797c2364c6ed70901db527c6a3471a84f8d297c64c9dbffd7c3204503ca6e51c8c88757500ed503ba86d73" + "67baf6b9f3f5f2b69308bef97232e67698ae10896ed70a66a7c40115770f3192b9168f66a359270c753bfffc5496" + "58fc7aba3d3943221e125a6f88e025cc024b753693", + "7e6c97d0fee9f249c7510c2a0abf9530ac49cecfffe2ae37c9d38ba60cd012d3e00b696ee54591", + "b04070df9cc5d032d1914eb69f9afeda61559ed98c7e5fbeb81930b242cd30cf097e4130b0cc45b3e3178ba5ff25" + "98493e1d1fe22fd14f3cc2de08fd8cbb3539d4c71c606adb7826c2a9e05ac36a6795293cdfab6d07fcfdedac099f" + "1ab9bfec63a32f7633e424e684ca8744b4ad2288ed", + "a0b933e1a706046c38967971e50c0ce9ececaabd188092313c654e9f297cf18a" }, + { "6dbf15415dae57093e6774f4a1b7e4d8", "bba38b490d740d7b3df0c9283d4a530c", + "fafe1562e69a0f5149e0ee65d14b42098a8a53a58d2cf07fd86f6c64cc4e67d9b5cf3655b5ed7f722d2073a3e9cc" + "8372efd9620a32d6443a328436dd5ae394700ddc171bef8cb0674b1fab87b3e93aa426aee92c7ff733c33f9e4e49" + "f614043a7fb42cf657e4e3c2", + "c742a929d2a766dde0fb0ce2d0faf790bd6c5feb63cb3126402aac7ef7c9ddfd408cd22bc6928a9b67426e20c3d9" + "b340cd7231f87ffbc29a8e6c23602b9dc434f5ab06bb8c049803b45cf088b919e8584091ecfca7259e0d130ddf4c" + "a45d44291024446f58f1271f", + "d8dda53eeb8b375930698379836e64014c22bd885b5b5cafb4dc65ed00aa947acb2792c46dfed8ecd155b21cfc98" + "ff163b403e3a9961805436678fd34942354094bc47663165341ed0b949c0ecb4da5499c1c8c87eab99ddfd0fc2d8" + "0a9a520461e3dc402c3d4b4f", + "f8e4c1f827d4c5dbe00e7794effc567089b8128a5b11e3c6c2e5e36414b4618a" }, + { "a6d38f5cebee041a0afe035caad48443", "cb7e7813c7018b25782f77e0ae7c84c7", + "6ef6c5d92f3acf78b3e2c8334038f364a51193e4e559b1458dd74c44269e69a7a6af22f531680c63270b22ee7154" + "7d72abc9b87bc5639a1b3a13f8613ad4d1742e8209ab", + "d536bed277bbb5a9", + "457fff7d0e1b61def59fbe99e81c08bc370bcac0240c9cec6d6a0de2c37f9950f5b2d12b8b21126af18d757c743a" + "2a9bf451ebcba235f9f48c31a63674f0e8a1c5af5094", + "269ee12821b981d794399bb759d233db2d60c1dcbc3a9a87dbb068551b032f1d" }, + { "753eb1d49c102d1e3a9bcfbcb1cfa369", "0e0cc4395844d363ceccc8a07a92a2d8", + "5166ac0bdba2b660af164fc847e4ad300675cda9f0acda47567f7952eea7084832f6dbfa0aae9f403a5bbbe307ad" + "40845cb08347588063ad3f1df766790c023f160ce21bdf372fb48e0f7e2ced50cb3f86c2fb257ad7863fadc5fe69" + "92bf1c4508308b259480007a628aacee94c258c91cd847f3d05251dadb96", + "5f590a65034eba433e57a9d089b2924f5f8482db6a467ea435478afc", + "f2fa7ed4fccf0388b7bb291977d2214d03dd30c4f81bab2df8f2c1cfaa46ff2fd14733cd7b8fefb6dd020ecab3eb" + "478d1fe0b849e057512fe7b897b171771a2b68d7fe6d9b70dcfbb6307dacba5409b7fdafc49752e4392111474388" + "afb6d79ed21a60c59234bafad676f88f7653765b4dc758c9fd930b2632a0", + "352c935b482696f9a4f40de117ac4efe5c38952c8a45e23242a86c66e79f7f4d" }, + { "711a437629429db2e14058e2a826dcbf", "eb036d6e483a212ff6ee25d970fe1ac3", + "29937c0efb36ed27fe7709d7179b4f38a2fc191b5e8d9616b58f6dc9ba2ab74e13bbdcd233e8726d90f7ded06c38" + "61582f27158732f997df9091446befe75855ab05b348d68f96e45445f44c31e9ba3e4d7be96d9c8e806535e79079" + "139c71fcc599fea8701e0c2edf606986eff1535afdfa51d1be2dfdee", + "", + "4a61f5d6b8e746bf6fb49ca2b16c22f4e9ffcdc89a3137b39bf5445fb6b989d5200f0c8d5538891a5e8979b5cd8c" + "734128b4e4ad98b0cd598c40ec9be74725dbca84c65a52f17ac983330b0b74e4193540f6357c3bcde4e8d8fc6942" + "314ba68115bf2a682756e3c42008803a81532708a0e7b5e3b8436145", + "4af113e2b6165247c2760ab445c6985306c81fb9ccebb8df0e57b0b044c52736" }, + { "a26d6028473bf7de23851d00d514455b", "05b87c16ebee8bb62365d265ac6818a2", + "baeef99e6d4d15be9ff68a5d94aee7afa3d898cf42f94ad572b089659708658534d198dd3fba47a48611e8d78da" + "d", + "5d77dd8066d3cea3b0762602ba6ae3d1ae1c27d1ebe70bfcdc068912def545362a5bd2", + "e4365eac2e7b5d02e7fc6c110895bcf193a0ebe28e81d0f6128a95e3e9183582ebb964d666972bd7fff8cd3870c" + "a", + "515045f7ad90ab569a6c8b90808d64346334e71d03db18d07d19f40b2b94fc7d" }, + { "9bb0e363275374f1771ababb7b96851c", "08cf3a6355ffbe621ea874e917729d4e", + "b380355f794d31e6e85fc81a49fdc2af2104471609692f94c994a710be5cabdc9c9a61b94fc3f76927c1cd5c9a53" + "55a0e8ec55a69ef114b3963ec95137b9ff84240c2a71d3b3459056d1a183eae21cc5a7c109e937faf8f61b6232fa" + "30951f030047d7555b60f85a318833afcea80ee4d88a98", + "a7fc199cb07b6e5e498dbe590af4a4d95d35b043a97d52e11cc1092c70250112e070e49fcb8a3e7bbfca3d0c4467" + "ba332c0dad277a997f2a603fd2d016979c24b3870a", + "f8ec2722a9aa97d0cab77f7833e6bddc9570bb79a159feec2dac9d2366e7eabeb9d74ab53a846fd8ad052a740dba" + "39801b681e4da903939387ac3578eec4547dc97c43a8824db11cdae4e7ca8330c9a2d4249853a7285c54498e59d6" + "45546a5bb5858b8ddfe37a14242d9750b02ccb41b92bbf", + "1f6822430a2fea84595ad870c833951814a0792cce0cd414bf9f744bfa7c9f72" }, + { "7458fcb1fa1a886924a044eccab9c5b2", "30565643aa9bae844b87bd459628d093", + "4227dc17d3e0ec8363c84b989f72d235d3991e57ebe8a6fcbcab1053edf3b323cbf5f5f45aa142494ab0afe78c", + "d07afef73f3cabbed475b69fa30aac8af674b74448cfd4d6ecb0c5c1b5b58d0c7173eaee440be65715d780d61d34" + "6dede7c52724bd76207ada9a3707c1326dffefd04fb29321db617d12b4a607452a5b197460bc524a40672628e5b9" + "d45f821a5b", + "50c568868de4b49df40d33e6b25abd6b2dfd2f22bdc12a18ee2407dfe82cd3bfa2fc344c91ba6544e079446073", + "5d9f885ee5dafd1ef4a2d0a951941f1d03acf8adc3652ec34e5b6ca4bf7ed18b" }, + { "68df4e697e83c55c822bb3637bb52d54", "1b0df23e69aa907856ccb9ca4d6c51b5", + "59242d6e2d7e612d2aee7e8c08f53f172e0f93d57b0c08e7cffda90da5b2703eed8192511f6f1bd59e9ae781b4f1" + "156ae06ec38b5bc1f5dddefee49f561d692f832030f7a1b506c0ebe26447b3eab68172e7e7810b13d425f6c78e1d" + "6591cb4a24a61c5f9554a083283485175c18cf5df4ecf2f87c98615de9ccb3", + "fe9643236be4e7aa3998f44b4336a4c1f8fec28e17", + "46e15eda413037249e584ea1e3007166d70bf9c998ca2a8386bdb8efde70f3bd35a9b0877e333451f7789f4d8b4e" + "797170445eef5f818bd321574e66b7881cdb546eb5528dce75cdd1683e715b2ac7ad259954bca62d8f0f0066fa6a" + "df50f9e13dbe3ca1e503957cb5f8a2dfce0ca7377ca51989e3d8e5275893ab", + "6afa564c9f5a650cdd7284589134c6c1379fb798af9330bec354ab1221539e86" }, + { "a4b06bbf87393d2b921dcba697274f07", "5c14d51c52d95ac040e1060a0ffa21eb", + "8c85ddd8d3f446608e656052062f0cd58e6d58", + "847d3b95895426225d08865cc9a329f6f14e63bc5a66fb6f2a05bf8eb9bc8166e6fef29e1d573acdb4c3bc699dae" + "adff7df5d6e8dbe2ef713008afcf9b6e97ce6cab4d90594fa4430ecba5bb62a7938f03d57869", + "cf6c47fec422ee29226b6cbc5092bf670b5434", + "0d57758c68a9524557fd6f6742d24a00467846456a5bbb1271e2a5e8c3ccbea3" }, + { "50034800a878a3e570364540fc862b77", "bc92f50c2630f7fe354399fa9a6fc48f", + "23a93e636d1924a60f3461de1020b73ba18fc3854c9dc9f166d7d4d1912503bdf1", + "23d5009057b76a00d92db6b280a3a30ba08ba3afec6312197f06ee01dc4a22d73ea010e02b65af7968d8977f9762" + "ff5a6dde278d8b351d3b8efb32cf7cc8a70a7a8b3d79", + "2cf9f00b66c63518354ea59510c178d75499866218eb5a031a0dc4d743ac8c05c9", + "7681550d340ca003acb18bde30e7a26b23022f9e71dc0d7801ea6e9e569784f3" }, + { "d68448b73ae9bd161c9f1f36dbf6163d", "3345d820331958c63dd7a129d3ea0de1", + "ffa236070dc5b464eb034a9332041a014cd7852b498be2dc498dcdab4151d71f47c7a6b17a176c5999a7574fab5f" + "f469cd02226492a38693eb2296a4a7cc2857b28b5b61", + "c790bb04036883e6e4a6912a9b0afc36607e12b0d457d4b5f6c120cf0c009caa087fc2710439", + "1474d60067d082706bb0cd823b22582ddc0fd68412ea0e399b03988e616ac5ca0a7a8da6e6fe29292b57046c289a" + "d8a52360ecd19655bb801c6eaa2ccd66ccb14c4c3748", + "a1d80340487279787a1dcfd1082fe04d557c072f9b558cc78c956c1b06a0683b" }, + { "519fee7049473c7c41f3bcf7b2f63a69", "be227d2bb97f2eef62d5fd9203cb63a9", + "0c121fbcfb4f4f8f150281140e49d71dc5ed82ac4a30263a6b2d92c55ac6fe4f43f64c0f526d3df642c04a5c51e5" + "8703c381701b1f4618cf66e27c60dd5e6558b48028d5fb11339c4f2547a3aefd8100", + "9ebb3c33eda54164b54bf95d4fbe113333edb0fdd62c24532fbd4cb91b11e08b1e74487dbb0f3daaa08c566e759d" + "53ea3974cc3685ec460e608f7d01fd2dc23d9bc283c73ab492bc9fa2ff458d268667504cd47e585826", + "c0e22cc3aa610bda350a2ebe8f530c05cafa19e7060b064c276a06f0bb430b79839c51e6b22aabf429616480382c" + "86f8c04ea397c976bb08caf8f35c38208e476787ce229a7a300c5411471548b15d9a", + "7891d41aa7d6f935761dc0454a7919d511f629fdc3f38f4932eb0148d870a24f" }, + { "58bd2c73aedb31baca592e42d614c68a", "bbf76585731b6334fd314e771d9e404f", + "d238c5f0677c86c001e66691ea9eb8aee429fc490d38abccfed3a546b5f05398288e7232880fa3d485fe3862c546" + "9f980d9ff4caced1cbbe7f97adc15b6919876b8cbdd35320a20eda8a1ad6e853164b0e0ffb2f702e1d6a0eae8b27" + "577bdd4e5a17e6d8", + "86147d2debc30111b82c1ccc41a13dab1aff144bf2810695a40d02bdeaf519669a1b81864edf", + "94fccab0dce48d5aaf42ef59764cba95b42410e2d6b2c87c95d8dbc15421c45d7a556e25296df9167cd46def7d10" + "602aeebd0e7e909c52ab7a22f833e976fb76b9b39b1c2889587582d44ad8f484f0382804d7481f1a8d6c903b1319" + "0c213102ae273378", + "67a012ae5452dc293645179c0fbe23d2f79ecf435e4fa09208ddf8bbd8bf8b37" }, + { "a27d07b0976574c43edba5619b3c1f27", "879f4114bf61f1d7b487bcdff6c90778", + "302994dba80c2268f5b1c77bfad0b780a9be6437a07dcf1fee61e8e72f7fd3ceac24a01be486a2eddc901a19a0f1" + "0eaa94cf46b604f98a90c0f62fa6476d27a338bd046fffc26570", + "b97a43027c5dcb8a95", + "633c76783dcb88ff677a6f567685ada02d787eb9aa3a527a45fd415180f1fc19cfddcb90583621c2609558703c7c" + "5ed548650c98e591fac7a692b1f921284ebd8b86d3a1f26f1ad2", + "1f54a298784b2ad47bdbe5c982b51b2eb5f8c96bc4b46a57dd703dbd7e1b199a" }, + { "d55658dd1f27af02885d0f431fb2ebb2", "0aba0b9dfc9831aef0203bc61a601176", + "05805491b667d9ff38147d96493db29441e188243f72668c7ba61b", + "df403489e3bb67eeae8440569f6fbc1ae072305f5047c5105a7e4e5349d3732d75572298253f60e3821c721941c0" + "2dd761edfb081d09b3c7528a0e786a6fcbab709727e7d614ecc604def19c78fe061040bd636d842b16e96158db07" + "d6c2521ad54778acc78f12b450db0474ef700dfd547f9c5b", + "2e8adbea0e9ef5068fc3abb39ccef59616420d4fa038e2f35b560c", + "d1f27edf1046f8ad30e9900c43a317744dadc934e6ceeb63184e0663ba80df77" }, + { "adff46e4d7d78b3db5c74c712534db37", "c54185637dd281ebf672393cf9bad28f", + "b3850ad942e221753e4bf30140eb5569cfd9972246b9a6a35f7a8512db333aec59d380973d6a6505d99cb004dd47" + "b33e32f4f238b1342e6756d3619414c31bde45", + "59bc7a834189b930c8cbff769ef63b5e1a08c352ed779853b36bcd3d0ca7b4e35bd6cdaf2538ebf0e3a0d7cbcf3b" + "cd2b66b910967c226a1da42f84c4a8f81e19161c6593e2c0a0fdddd3c6ab3a864037fbf976e8aebd33d4450be989" + "3da2e37e728916b663944e3fa6ba543d1010", + "5cc93a30fd8f71befd87fc50112c156b53abfc97466f36e3315915a7d4147f0b3641177b9d08ec13e7315957d078" + "ec73eb0a93a3b7a51e3db63a396e6ea2adfba7", + "9c14e5bcf26a00fa0bb04256cc32736d0f2300ea93a51f8e4ba69d15ff11121a" }, + { "4a5d7c201ddae018edc9783413dd0329", "eb7e038948d3bf61d2cd29d2fe722603", + "3e6a17d47db58690b895619128645a2782d17e9a3735c1450a7c8e13a9f212208fcf256f", + "65b8cebd83d3197118fe81dddce22b3947653e04a48d05b4a2dbc42a89e62b0d6b61d5f31487af", + "a1a858d13540281e1d0a9a82e3caef64ff742e51b1f7476d318729508a68840b371fd300", + "62b25795c2cfc4d7f8c1058256ed2d0e73374f8e33a106319a67778387150217" }, + { "83190fd90c68cf63648dbc5daa442e3e", "3c3683fb5d3f1446f8c0d0127fc59d5f", + "a5136deb0a795dccc18889c23e9bb21640864981a4ecd903e8fb62", + "13066ef4f97501fe1854da6e2d57ed43e4c074ad45b7218536e7dd8368a4ee8c6f2b63199fc0a9a679e2b198bd3a" + "43e6e8bbd6", + "0c8cc3bde1f4933729293718686301b1ce50f5e7521655016f8432", + "cbfa761976091ca1ffaadb4278f141f83bd6b5270f78cbcdf61018a744ae2fe4" }, + { "05bed4c00afcb8ecacda8daba02585a1", "ed014d4e9eb504c70d5d3153473dc146", + "6fab5ff04c5a74a0a96948501de9167597a42fde4c50ab27719dd1e2b0e0fc0fe6e48e97c79d2a71fcb5e7ef60c6" + "7a32bf865decb39bf5ac17969177b2fac849a38e08bbaa3be0d6dcee9ff685ba97e9b54514624d51c270065508c0" + "3e96f28667e3c79f6a68859a85048301779da7e2254b1bd1662ae3ea15e0332c", + "ebb614315ba4b7d69632656d5a4d2810112862ea3e443148100bf2e89d059bc9e2d9563bf34b823c57108ca9a88e" + "4b07441f0ceca4713e2af56f40f35d6f2223d37e9eeb61739a65933712763104a67488d2022a5e033e240969a4d3" + "3966b4527035eef0970c69660ab3ee5c00ac815a9ee52d767b0a937b", + "6edcebf7ac2cd10be8a9a595a00e68e2d3127f5de640323791229141caded658e99fa59539077027ed7b7a433a79" + "4bd523ec59f504978964d3e17eb388956e43395ec89b252a93b317c64580426d1ab0b633a972524084be5d488645" + "8718ed42f47967eddabdf7b2f440818e0aab9d932c10a4c7283d05b84ef74a6b", + "7be2b003c341d5a7d1a7fbbefd6170d8be25e785230bb6adb70785416eabb281" }, + { "53e1b8de6176c05e04f5a4787e733b3e", "574de8c0f914115c9267f7852280fbe8", + "0ef099d6995b41d4e9227c3aa59da313160afaa32e1753422c1eb45bf102e806aa996a54606c78320e85da74deb3" + "9e8b0059bffe32780ec784abf6bd540d3c01e9f13c4209bec2", + "3d9ca3718f31b4f37f988ec676fc3b5492a44792d1a4f8fd7cc4726fae899f102841e7f5c04b2ae2c5f9eb204c5b" + "74222d89c2bd36b1500b2dd81e9643142becec1b88aa7a0d7ea4c81fb7e8fb37ec1a58e0383e", + "5cf9292077dbcc9557a1cef51de815facf02a89c9e29ac62098c8e4d0cb49c4f55ed55dd9dc9c36a634ceb8f4dd4" + "75837582b9be1c17030c0546b335be95fded1c416e4599851e", + "782baaaec2b50b6bcb07d00c6eacb7fa8ac084113bad5a1d6dbe8c80340443e8" }, + { "81118e9376e515a93dbdda15e58ff387", "75a0f02a8e78a0d2d0097cee863aa576", + "f30c353db4dcb2320ba5fba118e50526800fda7ebabef05bdf15aee5d9b70f2ab697937d77a01bb4bb460fcc4233" + "acc3b970f4f434e9ea85f30aed7d247115fc5db1c333ac6a008dfe65ee02b930ea097d046f2923bf84785d47f382" + "b19651948d69a6e4b861a7112c4e1804f6435f70", + "6f75857a795e6aff71994dacae41c2b2d9d6d7e67fbaed6d2e20bf89da461f509ef3d284341a8a2059ef1b97e9e6" + "820f1a72ad703e71999be36fd7156d3e3f35663eb4db44a858e08bceb154af51360feadf3bca8f20", + "0376339c7324168426dbc1f36ee91603f844352817b575ffb25ca6a75e2d0f0d77d853230b7e5a4823195c406298" + "bc3781b40df001d9cfdff16de970df4ffd0aa652fc7732c6311e2665daad93bb2576d43e1a58837513c62a8b74cd" + "e75901f9520a29a10e4dad9e4aa981c5e72d6cc0", + "d5db09ad858cbf4f860e527aac44bafedcfb01653818baeabfc8efeec0e3a9e5" }, + { "2d60824c89bbeb4e2b72434aa0356587", "20ad2c51679a7246ca6d0a47ba7292e8", + "17aa9ed83ff674f959085ecde2a6c5026325265a143d2c772337056a3c66abb5d742f33be39697194fb1", + "283fa29dc399d07116e43c85eec0adc8a76221669a9bba6554f8e828b680", + "40fddfe3b15925fe189b25aeb6616538958d43f0c64806f6286a5efc8a4faee98d02314eace7619bd2a3", + "4d9f99a5248b8c7ed7ecac6397969bb92799a3e206239bcfbca54ca2b2325f9a" }, + { "e2e2a29db958c6a3f68a52825b844c2a", "3210fe0cede911318435fefee1d921d9", "45f5fc3a", + "91209d1202574e", "2067b789", + "8869621138c4b08670fd8b6ede57933e4036e9c2a635e367f12a4dd7b19e1d73" }, + { "24affb4e364dfcb9be823bda04cdf045", "d7db8f0fd20b87ea4ad5e85e026b4b42", + "296e2b8040a3907fbd8789f660f85f3b49c6050092029a2b", + "42f31798f0016547fc9126a6919c14fdee91bc68f839dabb24d2249ff5e001b6a2308b57bfa6baa84e635123e8c2" + "110c", + "3af391d72e60751b10d3f009814673d64cb86a0dc998cbf5", + "388f9d6b3b3765f7361cf130f3418f1d81f3c4220b37046d82ba47ba252424d6" }, + { "e8d14e976fed8be59625b034419fde86", "1d3a06b7b80217caa5a4e237c2b94549", + "fa2d4f764e7399bd346f60f1cee797a9624809373daa3803cdb12717fb48503263b21ab1d99dfde20d588458993d" + "8c33384e897973a9dd74bb7e308c8fdd6a46a9", + "8c0c2e14cf2ed5c7147d8c50b4c28b232a80247344f21a61dfe4065fdc559200b7a0046e58606e3a3615ff54bb60" + "5e7a5f001d215de255ba75366f6be3dd1fd4858aa9e8904ca99647387b1a17c7ff", + "9427f3a18a22e801a3d7d863cccf4fc8dfc23a51bffab61235e2bdbae311ecc321db38128730818cec04f51ba5f0" + "c3e6b7327402a2a63c95c184f7946756f2c94e", + "70a800b87eeed41887887449465656d777659f183f9cb335d2a253fe09816cfe" }, + { "73e9b0ca8fb59181dac10130454e3a7c", "81c9a08c95fb942c42003aff680b11ea", + "971adb65be3d885bc115724cc33a0f53aa47606e7bd5", + "03cc2f305af325f4fa14de7ae8e89a03d040e812f0f4a7f82d72441d83b85a424f3ebc34ad", + "18ff36eaf9e6f49530db6f886fd85a77d55289d85fcd", + "0bde31d7323ac029d9900c897aca4b0d42f33d46bab1974affe35a4095139184" }, + { "59f15a1479f5dbd9c1b879475de9d2e7", "060ac95c956235bcc003dfdc92da5d89", + "a17b5ffce4cc08b23a8b8cd7735e11822f9672691b4dac380835729694f39da377e4d3fd23ef7b8b40a355e271bb" + "fbb8cd632481c7cdb67d99d314609174b10cf370fd9b9ab872346c631127f873573ef61776bb8e154b55bab6d845" + "44cd8fe5f7611840a057", + "9faf2f97e14d2be029", + "3a4986b25ac4ebbdf8c62e74790e79f860c5c131f68b540a7a9f0504cbbc36b7484fe76713a53f354f4970613a97" + "6a4cc55ed7480d5c5acf876977b74e622926c8309b65a5edd3ea2ad7c2805f2859ce1e2805577d409760b2cf8e84" + "cda7097478491bab3fd9", + "81ab6e4c949f5f8552f8a5f067073a0563a4ea6a9ae83810d76937e1a370cda1" }, + { "5dc5206e6145ce81ffbce717cb425955", "a7a6fda319439a67cb679b3cc6076dd7", + "4244fc95829a69089920", + "92f48b403ce97f87118605d24314981ec34b958ca0036f0b6acef5e20bfddee370e13bb2cc676dd8d4547668aacc" + "7dfde6af12727789f6ef811e63b391cfa9c4a68ca89e6bd978f38f9228dd9c24e968c4e59e3d34963d6ee942f788" + "e0b5625ad95bd3eb6ae67ffcaf2e4ee9a9cbbd15c40385ae", + "adc2915b7813f367bd80", "30cff01d2431cc61bacb6445d7e3e604de19ea532a2db3adcc1a978d9cdf3dcf" }, + { "8d88268afada2ee19bdc754147d6b04f", "119588763bcbdec984a226e9dff179ce", + "04deb10354489349a273c5cd5d02ee1d71cbda2a20743bdc2cbc48788b9da779ad2f3f1dec4cceb3132b2e4a1c43" + "02c8f9ecd1d37fef", + "0f32a44fb0edff2f0d2334029e59715f5fe2b8e896068b8488f43b567c0d6fa3de5bfa99c6c8f055e3889309e088" + "22eea3a683d6907675b6f0072438be", + "bda6c7381492f48849c00a86ba72c8162c09981f593547682b88b7bc6e051a9ab9fa1602e879b8f1e5145bb61925" + "30e7faa76be34dc2", + "dac7ad31ca2f77427665d8255bb24e7604403434770869ee202598e649950dae" }, + { "0049493db4ab12f83fe50f0fb2a88961", "fd0dd2556a03ebe50b41446250d56e52", + "1d3139deaf1046e234189942c2249a7aee9d644f934e6a203a8a69e7683557551dfade301cef8abb29d7308c5a28" + "93a52ce6b1493bf2232606e79c0ae51b0a55cfc0434f2e669cbc56fe7176fd04a1278918c14791e00f88de41d563" + "d3", + "4c92be6ed0634323014b9ae5c9401f751c5b710c12df357a694c1c25d906ab3beb5bbaa002208e787f448dd0cef8" + "4d3d", + "dc3bb7e4baadeb7c32f70cef3144d04ad199ec429ca6b695f87f997c6e5db58e9d60b34d89ccfe49d5e62c267a87" + "1ab7818137f523cde68036ad1d8f7db0b80286ceda9734b32ad73f7f0eaf8d19c80fe74866c1cf785f44513b918a" + "24", + "51a9d0fb861eca8a334632ade9f37e319a283d7b33cf0894b2e4e545d01afe75" }, + { "b6279f439261d1dfa4b85151caa60e75", "d0b003ce641633d48413bf3bbcde6b5c", + "39ee6f13a66b4ee74cda034a3bfed3fcf36f101f1e5b646d1c93e019174e4bd850417fcd5755264476124a5ee8e6" + "8cf2fcb9fba50f872fb1d33a025f8c572b4b5ff034d9ad77ecd33981bdfe3e9554253522", + "c635cbbf8eace8f911d093544536f38fcfa14b78b1e1eb069c42a351cbc70b7d1f5e93bceacadaf0c9198d3b2ffe" + "54db45cfac70c05d4aecb0c801194642cc070ed223a9e3b65b735af796373db7fb6e3285ee3fd3579dd74be0cd29" + "37f6f825dc3bd77ff7674b06a9ac", + "9787ff29777e12f86c7281c57c5a345278fa96d8fc6ed949be284bb79f97b34da9f256a6be673ab93829492159e7" + "ba1a19dc727e16ec57e388447c6616626c6af3412cc70432c3dbeafa35b044e7e53456c1", + "9fb598560f6e1085c32baaeb48e643f0ae1b5a2c3a8ffbc0a9d88821c893330f" }, + { "81d8c7bf41cb0e54fa51899660637877", "044d29eb40264aa36b976a766108ac88", + "4712680db09039894cd72e86db111d63c4bcb62058f84f83ef419cc21e36f2169ca340375ff69f9280fa60c99d86" + "a03dec4673901a7029784be2cdae3f63590da312a448d24eef063304545e553fd01ce6ee088e43c8b02c51b155ba" + "da983ea1aca4bad804406aad3c92ac75ce4c", + "897f0ea8d69b962913a9a59ca36b65aa7aefe39d3a", + "1d5cff8679946302451dc9aed1c601ce46a6f31ef17a53af6ab130605cc2a41da08c932a13b72983ba8cc5837604" + "0cc17e3182993dd593f4fc8f2965825173656325942e97db98c584ff0bc913633888a0812ea7675d130d690f9fe8" + "d6eb7f1655de1938fa0163b02c50c8a122df", + "96887b58e80e7c7716cfc5ef37c2b5a6bffb401733b82a0bd31510613f033a05" }, + { "8d35dc035a1039af8f3dc653857cef8c", "a0df1b717a186cfe86a0ac8343e80217", + "572bf5295915e7b2f817bd137a6608e09fcb7bad29887b9209eb29e944f2d3231717f9a112e68756948c1fc71dcf" + "6245a0130bbffeef74ccf3ff3860ca5a23753f7539b7a268fb08434b73ba9adc385e6f9ccbfd213f812d7b64d8d6" + "d7bfce1e236c5fd857", + "94714396e2dc4bc13a6d628563b0db14e189695810a4925a90826de63327942db0508e7453", + "6f2364c357e257e9b412018a1c702f0d0c1170751393b1f73999f77927d4ec1454e78eda131af56b1b46e348f877" + "5e6a022a746b31ee135651bb2a14e21cbc3f333c13df02a3de6d5128ff1145514605d98e984c28dfa89cbfd2f0d8" + "bc41af3e4c73e7ddc0", + "8df601cc113253733da78d2f06eaba71d45d2026e77c30918ff8c176b54f75a5" }, + { "4666ffed66ee2dc3ed18e6345384e828", "8c5c38610ee79b818c18e95ed2baf026", + "dd2baf24c168f99d1868712a43dfda4717650c26c36378127800d8cf", + "196a5357a0d6c588acc29f85cf38b78b61e0810feefb965d", + "a58828aa09a6f25e7d4775ba7a2b303085bd5fb43cd61bcd19c8bb8a", + "3f54d97c03f05417d44d62925d9a0e2c457fcc8befd1c388499c3e38bf89e163" }, + { "2d5464646342ceb3039a9d2fa406b90a", "8f045fec196343f938902e1bf706e34b", + "260ab30c42d3356dc39837b28f6f387accc2527aa853dd58f54426d52cdb9ffc0a5ca5a5c00761a7299e72d48874" + "b46ffe18dfaf38f19cfad76d7c9cb4a4cd7784cfb125a58673972b4bb8c894da2a8969f68cb27fab746f8d62fef6" + "0664900833dfca7e0be03eb5908f12e74bacda9d35b06e", + "d4aa5263a31fcc8ccc9e1127f7ba6ea2d3ccc72cd7e98e442890ad3f8763856d90e362", + "51ede001d1e4ca8a3de43186651a011cd14f4bf93e9375e910a8974ea411343b68e8f6ce80cfc945ae7d9c5adf76" + "e1c0f93de8f5dc48f36b82b65886776f1298b36a2f012140da048da77e09e4d57426abe2b894c425aeb2050b0eea" + "2d8f8255b733bb814abf3ef3d530d87dd7e1504bd683f4", + "890d5d33a9dfa3807e5e20e4824d13fdce5f7ccaeee1f3448a4b21a085277370" }, + { "723efa25ce1bf1748d86d9da611be9b1", "aff260690905ed2e8618c20963e4b7c9", + "f7e3eb593d3966c015d63ea0e9211beceb8fa6d9a202bb4fd4128c3177c5", + "3950b62147fc16429392d41cc4188d5c82537204e93edc7abfe7ce3404f9aa1474ebc4acd8e18aa652a87ee99c24" + "15f9214963becd44720684f67aa814903cde", + "9d7ee643a2cec28c467d2cc88aa539341dfbc82f72b5d940feecd11d4a7d", + "eadd8931af484ec1f3c3e18f7acc0dacec73dd80836e03957b595b2022c8ac21" }, + { "784197d89800aad00105ff7487b6e5df", "fdded94dfbb72c77ad81b2ccaaa2de2e", + "b14ad4fc08d08cb0601289a7ff9127f26c4036606a50bdd2921baadffbc75749b8ca33ddf7b6ac", + "b82cbea4eaf532d52046bf0bfaf22ec2", + "a625b4da553686296d5c6f5ce526c4f84c4af779c67cd328c16a7985c9a28737130da855b1f3aa", + "1807d55856630efb2794c74810522703b71bed188d5d918b8d265fb12a8bdc9b" }, + { "4dda1ff559520020513e0a8e554da28e", "8b183c7e23130aade134ff8e539d8053", + "e56d6364a87fb7f40af02b672fd337705ab8a02a5fbf2c2a639a872da16895774d90658269437160cd22d7370ab0" + "fd3e81d746", + "675b6d9e6c4c479798038b06561f1ac0dba2ce54988efa3393cb6265d901df1f815937a6e42db8c64c76dae0c8ab" + "a0ee20", + "0b2f31b8b15ec535c7e8c732e91f4e119bca192b1fe2eaabdac037dd1568e4a8d786c7048c16ebd4c513324b18ac" + "9ee0281fac", + "4809fc5e0e21e6344364f0dd59d380740c36c1b1d22e22de5c1190c0044a98fa" }, + { "66dbe969ec0adfbe1b99874de53417d8", "13ee71e9dc02d592700c04ca0bcc6344", + "fb420a6751909185796656a952759b4b794bd4eb98c82456af4f596093f5615962e62a9ce3fd9c4e0cb31a649cb5" + "c17d30f66ad3d52e16589b174102cb5ad9973ce03f44cd3776e0d9c538d255ffe81ddff81e06cff8e4d8adef4f08" + "cca416d52ee3aade52341e5cfb5de80c71", + "db499d6cf13840accc40e3d14733662885768f7541b2615138c498b087e51b20f1c0c373a589b510de546d372a40" + "cad0f92ac3f6f7bc1b85290c4553c83b", + "7a7786b03d18c1f2edb2d9015da13a327f364895751c32b8ab840079b08e47870b4ecb49474d2da2bc0a53977aeb" + "4d63f3b4e56f6a3d22ccd64fbe098fb9b27eb5e5b1f179ac69eb3d57175bf9ee37345e6f48161adcaa27bfb53638" + "89e38cf7297b3fb9b41a0d61e751ca5184", + "18d7dd7f471d491883ad31f046ff3451d02dbc85fe59f43c5b67c53c21cd9f19" }, + { "3a00ee1e8877248065cd26e3b9a857de", "950529b19697df5b0ce43a3f429e9509", + "d6fdd1746e8e7c7b84adef010951f60fd19b5aa74b1a8ab1ef2dbd5487318fdf7844b436dd1063f10e609bc58604" + "ada5c41ae2ea1b5303f84c", + "30a5f3a4e4543dca2b4d53a59a6a11b97a7d", + "06ffcb4a0da10ae1a5a1c5b6205ccf4882a9c796370e7793d9b3ff3a857c156b3285e3dcc2181d8c0df26167ab4f" + "8709db6870c9e10e75b90f", + "6127c870f1aad279a83c79ce8226147782f709fe81f8c8740eb47bea34c2a558" }, + { "b611b23912f0c44c8f0a452e181016a3", "aa0321dae967b75f958a3949fa08fda2", + "16320a4eabdcbbb1e600058d308cd8aa650ec35985906489d1ed3210ad402589b33de4a68088cec878461e54ce60" + "ebac399457d4f4ffaea77fef304f9363817fd797afac854d0ca313321fbaca4b0f", + "d0b0ea43a3fcbcf70e5d4b21ad115e503ada6f43a74a0585481b249db3c00645f06005b1b3da91600a14a40ae5c0" + "45127cf8cb6bcb", + "39f3258b852471d9b9a289027f26c3a7e49fa8cb61983c429b3b306edb1f0d34d9718774005d71ef2e89212c6c53" + "8f647335d85a2d0b4c72b97a7eee96d5b6976a602d82a294bc2a4887b16aa327f6", + "411aac7435b623d80d284a1a6533dba99d7a44e4de22bbb22b09a4812c6f27e5" }, + { "2ed2ab0c5548c1e97879a6c3ec7ebadc", "3e15d94c7dd22593caa8be653b6d59d2", + "76b1d92662d472c87ba9b27e2756cf62513ec190f709996e", + "f1e64c14a92e952036305ceef2535f65295b2803f7396a5e88f2ac993e201782e2f1edba92011a1530278b6d3d1c" + "9a", + "8c9fe2da6b58f0a9d40609bfd9ac6855badaef814588ebc8", + "b212a9d7ef27a5228e1c02ba78cc92068c2251c162348e1d87da2afc53616571" }, + { "37263267c4f24129d9db09a2a96d7c14", "39e5c4f2b36c9ed5077765b89cea1bed", "3581b4424c", + "6ea6a9f99350a38601162f2e24928ee2", "9ace0569f7", + "746536436bc496acc8bab10e6ae17d5d1d6113b3fad96df462107c3b4b6bf96e" } +}; + +static int +tv(void) +{ + unsigned char *ad; + unsigned char *ciphertext; + unsigned char *decrypted; + unsigned char *detached_ciphertext; + unsigned char *expected_ciphertext; + unsigned char *key; + unsigned char *message; + unsigned char *mac; + unsigned char *nonce; + char *hex; + unsigned long long found_ciphertext_len; + unsigned long long found_mac_len; + unsigned long long found_message_len; + size_t ad_len; + size_t ciphertext_len; + size_t detached_ciphertext_len; + size_t i = 0U; + size_t message_len; + + key = (unsigned char *) sodium_malloc(crypto_aead_aegis128l_KEYBYTES); + nonce = (unsigned char *) sodium_malloc(crypto_aead_aegis128l_NPUBBYTES); + mac = (unsigned char *) sodium_malloc(crypto_aead_aegis128l_ABYTES); + + do { + assert(strlen(tests[i].key_hex) == 2 * crypto_aead_aegis128l_KEYBYTES); + sodium_hex2bin(key, crypto_aead_aegis128l_KEYBYTES, tests[i].key_hex, + strlen(tests[i].key_hex), NULL, NULL, NULL); + assert(strlen(tests[i].nonce_hex) == 2 * crypto_aead_aegis128l_NPUBBYTES); + sodium_hex2bin(nonce, crypto_aead_aegis128l_NPUBBYTES, tests[i].nonce_hex, + strlen(tests[i].nonce_hex), NULL, NULL, NULL); + message_len = strlen(tests[i].message_hex) / 2; + message = (unsigned char *) sodium_malloc(message_len); + sodium_hex2bin(message, message_len, tests[i].message_hex, strlen(tests[i].message_hex), + NULL, NULL, NULL); + ad_len = strlen(tests[i].ad_hex) / 2; + ad = (unsigned char *) sodium_malloc(ad_len); + sodium_hex2bin(ad, ad_len, tests[i].ad_hex, strlen(tests[i].ad_hex), NULL, NULL, NULL); + ciphertext_len = message_len + crypto_aead_aegis128l_ABYTES; + detached_ciphertext_len = message_len; + expected_ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); + assert(strlen(tests[i].ciphertext_hex) == 2 * message_len); + sodium_hex2bin(expected_ciphertext, message_len, tests[i].ciphertext_hex, + strlen(tests[i].ciphertext_hex), NULL, NULL, NULL); + assert(strlen(tests[i].mac_hex) == 2 * crypto_aead_aegis128l_ABYTES); + sodium_hex2bin(expected_ciphertext + message_len, crypto_aead_aegis128l_ABYTES, + tests[i].mac_hex, strlen(tests[i].mac_hex), NULL, NULL, NULL); + ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); + detached_ciphertext = (unsigned char *) sodium_malloc(detached_ciphertext_len); + + crypto_aead_aegis128l_encrypt_detached(detached_ciphertext, mac, &found_mac_len, message, + message_len, ad, ad_len, NULL, nonce, key); + assert(found_mac_len == crypto_aead_aegis128l_ABYTES); + if (memcmp(detached_ciphertext, expected_ciphertext, detached_ciphertext_len) != 0 || + memcmp(mac, expected_ciphertext + message_len, crypto_aead_aegis128l_ABYTES) != 0) { + printf("Detached encryption of test vector #%u failed\n", (unsigned int) i); + hex = (char *) sodium_malloc((size_t) ciphertext_len * 2 + 1); + sodium_bin2hex(hex, (size_t) ciphertext_len * 2 + 1, ciphertext, ciphertext_len); + printf("Computed: [%s]\n", hex); + sodium_free(hex); + } + + crypto_aead_aegis128l_encrypt(ciphertext, &found_ciphertext_len, message, message_len, ad, + ad_len, NULL, nonce, key); + + assert((size_t) found_ciphertext_len == ciphertext_len); + if (memcmp(ciphertext, expected_ciphertext, ciphertext_len) != 0) { + printf("Encryption of test vector #%u failed\n", (unsigned int) i); + hex = (char *) sodium_malloc((size_t) found_ciphertext_len * 2 + 1); + sodium_bin2hex(hex, (size_t) found_ciphertext_len * 2 + 1, ciphertext, ciphertext_len); + printf("Computed: [%s]\n", hex); + sodium_free(hex); + } + + decrypted = (unsigned char *) sodium_malloc(message_len); + found_message_len = 1; + if (crypto_aead_aegis128l_decrypt(decrypted, &found_message_len, NULL, ciphertext, + randombytes_uniform((uint32_t) ciphertext_len), ad, + ad_len, nonce, key) != -1) { + printf("Verification of test vector #%u after truncation succeeded\n", + (unsigned int) i); + } + if (found_message_len != 0) { + printf("Message length should have been set to zero after a failure\n"); + } + if (crypto_aead_aegis128l_decrypt(decrypted, &found_message_len, NULL, guard_page, + randombytes_uniform(crypto_aead_aegis128l_ABYTES), ad, + ad_len, nonce, key) != -1) { + printf("Verification of test vector #%u with a truncated tag failed\n", + (unsigned int) i); + } + if (i == 0 && crypto_aead_aegis128l_decrypt(NULL, NULL, NULL, ciphertext, ciphertext_len, + ad, ad_len, nonce, key) != 0) { + printf("Verification of test vector #%u's tag failed\n", (unsigned int) i); + } + if (crypto_aead_aegis128l_decrypt(decrypted, &found_message_len, NULL, ciphertext, + ciphertext_len, ad, ad_len, nonce, key) != 0) { + printf("Verification of test vector #%u failed\n", (unsigned int) i); + } + assert((size_t) found_message_len == message_len); + if (memcmp(decrypted, message, message_len) != 0) { + printf("Incorrect decryption of test vector #%u\n", (unsigned int) i); + } + memset(decrypted, 0xd0, message_len); + if (crypto_aead_aegis128l_decrypt_detached(decrypted, NULL, detached_ciphertext, + detached_ciphertext_len, mac, ad, ad_len, nonce, + key) != 0) { + printf("Detached verification of test vector #%u failed\n", (unsigned int) i); + } + if (memcmp(decrypted, message, message_len) != 0) { + printf("Incorrect decryption of test vector #%u\n", (unsigned int) i); + } + + sodium_free(message); + sodium_free(ad); + sodium_free(expected_ciphertext); + sodium_free(ciphertext); + sodium_free(decrypted); + sodium_free(detached_ciphertext); + } while (++i < (sizeof tests) / (sizeof tests[0])); + + sodium_free(key); + sodium_free(mac); + sodium_free(nonce); + + return 0; +} + +int +main(void) +{ + tv(); + assert(crypto_aead_aegis128l_keybytes() == crypto_aead_aegis128l_KEYBYTES); + assert(crypto_aead_aegis128l_nsecbytes() == crypto_aead_aegis128l_NSECBYTES); + assert(crypto_aead_aegis128l_npubbytes() == crypto_aead_aegis128l_NPUBBYTES); + assert(crypto_aead_aegis128l_abytes() == crypto_aead_aegis128l_ABYTES); + assert(crypto_aead_aegis128l_messagebytes_max() == crypto_aead_aegis128l_MESSAGEBYTES_MAX); + printf("OK\n"); + + return 0; +} diff --git a/src/libsodium/test/default/secretstream.exp b/src/libsodium/test/default/aead_aegis128l.exp similarity index 100% rename from src/libsodium/test/default/secretstream.exp rename to src/libsodium/test/default/aead_aegis128l.exp diff --git a/src/libsodium/test/default/aead_aegis256.c b/src/libsodium/test/default/aead_aegis256.c new file mode 100644 index 000000000..e7158c884 --- /dev/null +++ b/src/libsodium/test/default/aead_aegis256.c @@ -0,0 +1,723 @@ +#define TEST_NAME "aead_aegis256" +#include "cmptest.h" + +static struct { + const char *key_hex; + const char *nonce_hex; + const char *message_hex; + const char *ad_hex; + const char *ciphertext_hex; + const char *mac_hex; +} tests[] = { + { "7083505997f52fdf86548d86ee87c1429ed91f108cd56384dc840269ef7fdd73", + "18cd778e6f5b1d35d4ca975fd719a17aaf22c3eba01928b6a78bac5810c92c75", + "5d6691271eb1b2261d1b34fa7560e274b83373343c2e49b2b6a82bc0f20cee85cd608d195c1a16679d720441c95f" + "ae86631f3f2cd27f38f71cedc79aaca7fdddbd4da4eeb97632366db65ca21acd85b41fd1a9de688bddff433a4757" + "eb084e6816dbc8ff93f5995804", + "af5b16a480e6a1400be15c8e6b194c2aca175e3b5c3f3fbbeca865f9390a", + "0943a3e659b86e267ffea969ddd6d6d63aa35d1a1f31fb6f47205104b132da65799cc64cc9f66ffa5ec479550c2c" + "5dfa006f827ef02e3ab4dae3446bf93ccb5c17e1ec0393f161fca94f2944d041f162e9c964558b6b57d3bb393b97" + "43b1f8338ff878a154800fd16c", + "480091eb823480e8b29c7aa96ffd55a026ac3d7fa16787c36c25865131a639a4" }, + { "c88bb05b2aec1218e1a5026511e6d44de7bd502588e9e2a01591b39c5ead76ff", + "4a485f226a73f0c4e16242e8234841cdf6af1771eb278e7f35428d03eb5b4cf0", + "2a4c06941ec356390542d7d7833fd68fc85a00c0452281f87dee6f10180d02182791232c7007fde35dfd5a901afa" + "896296f9f344db717994d078fbd3a4cec8d782d2bdc205f3709827b776fd5c863a952fea97a14a6c2ee3f20432b8" + "baa084470179078bd6a83597478b2fd9ae00ecb424822cb0d61e9a55a4", + "38a9809dbdd2579010d38bf5314f255b", + "b8565db06c2fa493e09b6764f4d09296422095eb6e9890f606654713bfee6f362a123688b61f254f315f18b20bcc" + "5ed8b0b4f2224de9f498e3ef03532a8bcddb361f5ace8ff491bab8b3d06550496501264f9f48ebad277e74921467" + "89d0fc1a3b1e3e81598370a4183683d1fee25a9a1fe359c836932746b9", + "5d5d35e0299dea47956a2e2143cdace4de8d228784d6717ae5a6bf5ea6b3ed04" }, + { "77b473865175ebd5ddf9c382bac227029c25bdb836e683a138e4618cc964488b", + "f183d8de1e6dd4ccefa79fe22fabfda58e68dd29116d13408042f0713a4ee5f8", + "9888b8ee03c3217a777b7558a31e331909570ea196f02c8cffad2c8dc6499b8125363c06a71c057842666bfb5c6a" + "cc937d2eecd960330c2361abdd88a4b191557ddf5102de75ddc7e09aee9862f32e24f1db3847a5f5b379fb32e2ef" + "7ffb0d3a60", + "0679fd74a846965e33e558676115d843e440fa37092fbd5c57c82fd914210fcf948f911b04632d66be46248d772b" + "3eb9f55b537e54b1ec751b63f035c8", + "3464d835302583ade6ed99e23333e865d3308f31a6cb65bcefdc9a1b9b4d0e0f75513188480dac4a64922af44413" + "24ce7de74eb9f7f4e414f6177a4814edc96313694b99ff8dd36b2f7f79c7ecd70ec475abe1c1909238767f172fd6" + "b95e92c025", + "33527e829a3db1929cd643d5251ee19482aab7f2d74635cbf8370f1e1621ecdf" }, + { "b8c6e8cea59ca9fd2922530ee61911c1ed1c5af98be8fb03cbb449adcea0ed83", + "af5bc1abe7bafadee790390277874cdfcc1ac1955f249d1131555d345832f555", + "b6c15f560be043d06aa27e15d8c901af6b19db7a15e1", + "d899366a0b4e4d86cce5ba61aca2a84349c8de5757e008e94e7d7a3703", + "4c8496dfa6c419ef3c4867769a9014bd17118c22eef5", + "f81ceacaaae6263c33f836fa26d92b0f08eb0796135c7fe312c93add6a208e8a" }, + { "d4ed0fe94cda2be7e50d57833158c84180b4cb7dec95d5ba774b6b5e1b0597bd", + "cae41ba20bfd124270b76c13d61c1dffd7a42017731546d41aa071c22b9967cc", + "1cd4b85fa6c14d5adea84ed3167479c1cd18e77792cca73a540aa16a00e50ba62ddd12a62911b21d3ee108651693" + "7f33ed7756c7ec93b3", + "35564745c05bc961994ea03764eb02044f9e7b2f6130d6d1f041580d6b3ea7ade2b6e231dacc5e97db01", + "a1f64f45985a89303d1fdacf6f31ad745a8015350f1afe63d6ecc26677f661addd3c229ed76f4c627b1e902f8ce8" + "c42fd08baef481e86e", + "c706b2f13d4e76b4e024a2d72540637a8d9ff5e626d6bffeb7801c58ccab0c2e" }, + { "d755d9d980e8cb221955b63c19f3989eecce945f61307a0593bd7cbea6577e1d", + "9f83666d787e5ceb0e17fc1b084b3734dc3ea88dda73b1b7ed53be7491f4637f", + "d1093941fdb3d9710cfcbe504be2434c17296d0b7e0f4e4058e79062f2b2cf3cbe2007ae2e5d391ebf3fc1e07e4e" + "e7d1705044c9bc2bf08e97a4d8", + "f2a1432fba86dc01b3bfbf3206943bfa3dc66e9f54b576c57f61ad515555b0c371dcfcec45eaa58ca06654b6cd47" + "6aaaaf1b2602c03f9e41a2cefc265d10f19d42bda0b07aac8e86", + "58e044943cf3b73e48ce75c048464fedb0445b02bffc00c1998b212f48f48c93e89dbfbf36cfade1112629e8deb2" + "67c55118c10ab67b7ef2740fc2", + "0179f0edd217214881e90c1be3b513170d1292603c484a55499e1bc70970d5ed" }, + { "152f15933e4ae26192bd3aaecea29daf77e9b2bcd97e7eae7637025de8a3d3ac", + "e177be02348efb533fc2e9d5a259cef80aabeec97da50c937e8d5f7c6eeb32ce", + "ef86da6d5b0dab27a444a95ef5c237baa5819b863dcf0232d0162dceda8f180e1b9c6b9d94ccc0692eb52923783e" + "f9de17497f1da62d6524bbf432aa6c3bbc1e851310218a03ef97ac6676eb6ec30ba6ab131802b992a11417cd00e6" + "270ac73dec8dad88ecc3cba25734ef7de3b8e3cceb5d19778d6808", + "221b1875425844e48c2111fa59b6df729a924a43b3869ab64f8291dca8f12be34d62d11ac94f9f308e0744d5d5f4" + "564fe9fc1e014cefee3cf7706ace4643871d41f1ad5c616adbcc1e9701a3b4", + "dc48260eb047397f41c4d0a0ffe394557aaff8b149cf4b16e7c22754095f51b626ded66e3db9d4cbd98421ee9d8e" + "7c6eb72b607cd462f1fb3ab0c41b2cc84ad320c781ccda9aefa1a68ff5d280500a17c7959e869f45f97bf09cd0bf" + "2c4c068d2b9603710ca8f71f82acd47faefdebdd0abc9b45c83388", + "97191234839a54c00143463e8e8c863f5710e520ee9d9b9ce051076696bc8b52" }, + { "873edbe818233d0f51bcfc1d5340cc4712c909de36f963e6157f128b8a71e3a8", + "16e7637700a6fc10539c056663d12ec85bd529f1e6adb131a3853578f5d27c12", + "db38cdcecbd99003978832d29cf6a34acb4d0e6293e37d2795fcded538ba37d6a11ed41430dc9f4c0cfd27587d60" + "7846f42aa30682bcc295097053821b80b5869b4a0b852ba7ac1d7b784ea0e76b2d033678011889a5adbf7e091cdb" + "b9754f828b7519f1179e2426ca6bf80a509e34729c854a5052e61adf8d", + "0b0bd264fb5030f84da620f07099f42dfbad57c314102a1f7fc0b452ebb7966ad4b88ea773aa07", + "de67a4eb8821625d4451734993d93e0fafd2c55c761afb097bfccba898e6d634be975d5f2ce8d456785a089c9b40" + "724d8ea41095c1cc80f070c3ababc9258e5eea504831b034baccff61d8f73c220d5bdb1244c8a675f2d6081abea8" + "f59088b99583cae22f8bd37fa030f94d5bfe1c9e799aa71bb41874b17f", + "8665ecac1758be7eea0b5f482ce8024ce3c78b3f51af3ee4e0b440f24db2f451" }, + { "b04b735c74d2286302e5994e126a8a8f52af38d6cb094279ac883b560a52a6a6", + "6af57ad705792ac2f71a61bcea9ab38a9a5acc510de7995b66f3ae4cd2079aa4", + "1c052ab52a21894287fa7f763b12f49b2edd6a0cd266e93207573d08d75ec31b294d171f0098f804020cc12056c6" + "0f8d396ec94d97eae1c07a874849e39a3302e8c3b538de6c9e268fb922f6875ee5bbc264137035a76d9ceb269dc0" + "988517a302c2bace2fb6efc4ffaa2c1455a16b6cd0", + "52618046f112a5a35780e370c713987e24609c38157e5fd5d51ed36324359b0615af70f801b05a98ceb1", + "7183180c37ab14f38ed084bdd2aaa4e8d8e8442b526214f594054e0379a2aba6992804afa8c63bb1e580d7d905d0" + "c46536970e98bf7cb921e95db8faf388e7c98cc08496a7036b90a2e4efdfbcf79610edbc9f905067358b13934825" + "c0ed2e3c3d1f03f7ceb812945f77fcb7731f805b1c", + "483a6b3a7d5de797f0911d2a514350d5ae5af89aefe1245cb08cf8c7487eb99a" }, + { "5bd7cbff6b469c03643cabb99dc50f905091fc9cfcd6d8f28e74ac1a33fd0198", + "3b458a51fdb6b9d5a7071a22825a79f2844c5ac7ae91014ed7862499dcf10461", + "4eda7997fa3b9e12e39eb00b209b43af9949c017660e523e78d0e483f23e9113b662f42a164db3511d", + "808d8a8523a983a2afb2f9daed913efdc19a3c1ca3315382ffe757426e7ef65bc1d83d8e6af95191f3c30de29806" + "5be1e5d14d0dba8f82281aa2fde67684cf7eb6f32ca4de7a116caa796f2b27222f93b9275f4b95f08c4a4e8d6b13" + "cd326c16daf232c8", + "98959acc116ede75df052f4028783105408022ed6db9516e8a27f18c2b4d59f1bcaa7163e0811203a2", + "edff06bd132fd3031cfa5a47803d5169289a29d304f7091b20dec2b284a0e271" }, + { "1bc0dea26d8583e51cece0df7021522adb9336450929715fecb497c43cfba717", + "7cced62d655e703f54824f4e2ceb6e5af1507e2000f1bfec9e50eb87328c2218", + "edeb537b66dc39d20ef6ca5647e6f34df0f5dce2964d227b0c444613f951edbbc532b5576735e9dbf39177ccf807" + "1e5fe9fa011bf8ab7fe9f716acd50847f7a9ce35262b22f04486f1e956e09005249b5ed70e68ca9896802c4ff9b8" + "019fab057bbd5ecddaebb6a079e57cb6e39c95f6748b22cf3703e30a5e", + "36febc6e0763391b6b1031478fd485b54d427b88d06d3582c10263", + "5f75548b3bdc53e80c61fe8659f2b90350a59dff4477fad24764621dbc35ebbb6d71f80c556a825a2bba962561a9" + "db3360311438d4b3eb7452926dc5ec88d451be66eeaa491cc21837ec202b3e71b3ec2d0ed2f53ec59da253fc9920" + "482545f570e3b2e4ecb3629757f3c721fc462a380504aa8fa9fc8880fa", + "9e46a21c41a40101ca413017cadc2fed4fc3ff390a57fc0643784871af07492f" }, + { "230bf249a043d34effa31974328fce207daf3ce10b42e5b44073b70e9566b1bf", + "de67af72aa00fe1798e8b41be2528f36a45aeb3d957bbcc5c01490e4a786437d", + "12403a1905c9da8bd546946612e7d4ddab1c716a533cbd5898240b4c68c675c2f18b72dd40c218bc6f7599edb573" + "f89af867ab3c05fcef8c78b9bd0a267e8db3d9ab1dd04dd14a11f9c9e0", + "77fe28a72f7029da86bfbcddcb819f7068afc07a249e207ae80f0acb90", + "e9f1c7e28b1581f25448b1e21de4fe67c3ff432338b2f7364460b6b1f666a2ddb5b9cc896c3f410445d00c146952" + "180ad1a36944aad13956e6ff95449bcf8bb6cdb1b3e87112507663441c", + "7174e0d47bd83c1a8cf9cb14127d26bad67bf413e146bdfceab4e79b7ef13c70" }, + { "c9675c6e2c0d8cf9f45f17faff568943e4a9038df4472908dd631c5ba8a29c2f", + "bc07c8de4778d50f5dbf324e3f9e377b82e6defdb84163bc9447f156bb70beb7", + "d2c4c2773ac5fcbfe43869bafa8278709a32dc395be3df8360562184d47675133ff716c620fe4d18902dfb41d09b" + "205c87a9a2acd268f9d5662c9e4b12c50181d93ec7b676cb7afd0639f2b3c1154f7489cdf926a85f51c62eb16c47" + "b1bde2b46df56ffc9438b395", + "88a976fd2e7ab25e492f90a1901d7d3982b678217d4b248066c6d8e7a97af0aa93d04300eb0fc0be23a5db41b1c5" + "62efc21c6057c57cd723894d9735d3a651240c6c30e7afc2be2192081c4622ff1d7390e81182642a4d532dda34e2" + "ed45994ce50e1524ce", + "15f5a70290975933cbb70f830200fdd876732952577ef9c0bce0293e78c0525a1209eba2531d9c58cb742ecb4555" + "d4c9cb6bbe69c62a0910e633d14351d3b8f0c3c6734ed9adc384c294bc4935d0026fcd50d513750826da12ecb5f4" + "6b7c6595550547b963de030e", + "da44d1dc3de8523cb2dc0b3d5012f0920ef4665fb676bd4ff66fd6662db058ea" }, + { "c4de2cc53d61339da13f360f88ae40b1895067680a7a9d28b3d281bb2a7d2f34", + "29428c6b06edddd68e8f4973fc2a698fc49c71230bb97da4fbcdafb7f945c9de", + "e9d1f0438a405d57816cf8eb37d3bbada217837db578d7c8e26355ecffc3b497732a54ae509fe8402f30239dca95" + "9b0aa7bd436f23c31e2b9cec889f3bc82d4ad2d4af9c6f978a14b1a8dd325d8976368af2d3f04b83ee343a0bea47" + "0bf8d56913986121402a49ed4a68c6526cb53d41ac", + "74", + "f1bc93dc853b7989e79d34615742488c52221d9d277560406fae0dca1a086ec09ae034a37424556922cd6661bb01" + "a389aa00823fe3e2fb84e9811a078bdcbb4da5e949fefd45988131846259c64b45b279b7cce15ad2b1ba0b52db1d" + "e7d39b07458bba7b26a4a4081fa3b0b6aa53b73d6d", + "ff4527b7c136c8c92b151e0658ff456262fe74a07747f9437445d9336919939a" }, + { "0d0b70db983f4afeac46cb5e042ca51a6a85cdc500f2dfb2f97282d2f96d3235", + "a1280a20ba18cf8977c63450318ff1f6c4303b20c111fc733212e37e11cbd38e", + "d9db68a084a6aaacdbfa1cfd7ab1f9b4fde06f18ff093d9f5a04afb9f1a23a573125906fbe126e8fc0f51e65465a" + "09c1167bb6fbb623f311fe07f564ad4216a01b597d4d756acfc736b905a26dcbad3c6aae8bb7043039d06561ff59" + "7924d623767105024c170113b6", + "0a9d9525935e346ede23c3eee268c24f1070959d392d1aa1c4234cc19cce7807c477ac8e9062ff302015952aa910" + "6de9db40c8d20e022f3617", + "2f517ff86b32f3841fd9cfd34fbbf2bfb77b190dd2bdb74f438914d95809d52d20f07af6fa7a03913a517a6cf3dc" + "591045eb4fd7fa0b55d80ca54d48ee85d56841fd44db7585e5d0ad8f27264751157be2190b85f224623a40c4c821" + "cc8c7c680c548204e7f742d749", + "054df03cbd4f45572ecee0a8fe80b37eeca1f17881bd12c42ad6575a5ef304c5" }, + { "8011b1043674d753172302aa123478a121640daf4317957545749d0be6a91698", + "57bd1ac0f3db407989f88a762f60b3eabd03d3bc3bae577f3818b15c0974ae9c", + "be1833fd169fd745acaa7d8584c457657433e6a3237225a086d47806804120613d78344e097ecc6a5f869d07", + "", + "e34dff511e16bf12570a6828843c414b8fdced120db36ea0223e8700f57bea4c9dfbec5d3195caa633d52ee8", + "0ac3f0459608a7f38b5b77c3f38c73f9ebc48253b316830b9583bcd51ba5c995" }, + { "d4af433d4d7598a8bf02f3e34ba9014a85f92e7ff946d51ea7fa9a4f5cab09dc", + "4fa45413eca04bccc3c732e18fc6442646e5d809afc00e1e749a8b8f84d6926c", + "b867dea7593a03b7b7762052e58b18483163c0828f5ebecb8cbbe4d55c7f1a4ceadf55f4c3a979e619763377cfba" + "4f88e9e692c2794ee862b2aed63902879e11c5ee167ea4fc266a4556fbb54357ad243f92418a1d13c987f5b260e" + "d", + "ee4ff169ca", + "e2e12b2510c72d2d59ad8bf30235d14f3e85824e19b09f4e84eed629325b5a5368178dc94dac13b9aa262f12592f" + "8748bbed8581dad74895fe73dac4cc3a5f17ba480903ab86d349d68cfa0e4dcedea3321ffe1023b092cc77853a0" + "7", + "07a59bb7b8f5805195197a01bf6f628c689024dd64218f0a2a9b77aa5cd6b357" }, + { "2eb12f163119cd1262e0dbb26338486bc75c183026cbc71bed601f6cde324bb7", + "c59654bef68ff95760ce8fdd39f480a3655c650647d00e49620b9938f917535d", + "9cf103fd377ee14f1fd775530b5153eb31789755382697aef6008f59b0404bcf3fe34509835308cfac8cfed2678f" + "523815615423831317ad7770ef74145db7a72ca9462ecd50d7b19a0d50e894bdadbb0f63d6624c80c85836bfabf4" + "4359f700fe04b5e6bf1db1b4ded24fe9054e7318", + "a3fb893a7baf646371e92f3c34c6700e6a9306bd7e905a25be4bd7d6239416ca94a1a31b59068729", + "22139c2d9bedf4a0535c22de56fe441df6752a692a99c10c186b439fde9954e815d6e81d0bfa0a7c3caf60808343" + "3e9b8d32321392f41ae03e5b67cd7801362c371223a98989b00c79fb42d4b25cc222ef6a4fe415654030e67ec506" + "44bbc93fe83c20e1a30259a14ae1ec82ac4759d8", + "83b054697569ad69e55ee1b1491b9353255c4cef4c0f31a0db8090b7dd06ce0b" }, + { "553928dbf68b2dfdacd75bacda2cbb4fb33d81f55731f8ac6615631ed4169784", + "92e86bd57fafd57c88a090397a72f7af5967fb623eec8892b358abd1665f88ac", + "b305ac06529bc8483fdc6d765a535ccbc8125a27b8d72fa2450053ad4be45beede300f87e035a05538b3", + "1f80c2c7694a35f5653ab2fc2cc93614d959f2136bd4cf2918d2a20d6440e8ae73a652e08b7987d1df8c", + "4885419082270c83c03f5d4869adc63cd2f940bf527e8474c7c61a748fc883b74e5ffbd8b0cd3e780a92", + "ef4b2bbe41b9c4e58e207fe9fdbb0e9aed224989d9b9a77e78003b1c2fd7bc31" }, + { "4d6ffdfc693ab2d94d760163bb9b31728a2762c26236f04859b7b31b98c0e159", + "e412d9b3b1b40c740ce56cdc0bec430c0ba4f95f5d83124244cebae8295b31c5", + "ff03d03191d459d57a628a8d69d398214699bf88c2ce8694e2dcbe6d9c987056a50319ef387363b6266fb8d3e15a" + "fe3b2eeb964800799c0686c3d6f0b27d9523592690ba7d765e9a21d62e113788076267cb50193d64b43156b3683e" + "7ab0758e", + "78c96946f355a8153659dd06b41b75b8109b0c31c0d6ff2feb90c875a3b211f01061f73a88a9d42550c807676dd3" + "a405516da1d2639395cb4df526e046d621ec997c1c4fc858b60ff9051f2ee093fc8f032f367bf25b3f32361d8aec" + "5c0e239dbb129316411e96da198d6fb512", + "4c3083ed17c2de0981fcfd38bc244c6e6d0756fa3c23b22fe770c0c952159b6e112c6f4b6686aef4bbd0be98bcb2" + "c32c44af09425f70cbe031d08798ef258a820dcd3029d2b0a857615a939e2a008ef14b949f5bd4ccb4607c8a8a4f" + "c5f1236e", + "bfa101aea1676baa3b5205d45b572425ef7da415984796d2b76f01fe5e37e919" }, + { "c9bde00bad3334e5792b5c1e5a8fda8ea7f7eed152c0a3feceb565208017af73", + "2ee41bb5c473206ec00ec597548161573e8c2adf7387f88e4fcf64c84a2f5905", + "b7dac21337a4029b80ae0ce7578eb0eb45c76eb84d68c4dde73690162b377118237fd1f466ce1d7d7638945779e0" + "b148047c61b63c7e05c877f75f4a52865efe94fb65ee99e4b0d79242c69c3aad1c425d017a71eb26adc2594a6a52" + "16eb72b736f40a91001b13c91d13d5b057ff05ea883ccff3eb6033679b7b41a62f", + "26b1dbda8f99f9492955fab6891c3de81e4535ed525fdc6d98beebef67067fefb1674359525cacb2119d016876fe" + "b5dd", + "6249b44800c9d47ca20cfc1726563befbedf20639735d441917f52cbcc7ef72d5b095c6a15a7bf1239f8b93a62d9" + "bd5e7f47b05ab9f12b4da72392ab4ba093de150fb8b7b61ea92e6a3204b178e2e1c066102ea9aea6241749ebdfba" + "4b307ab0a5471d1d43fc930dc29a1ed5e687d41883c69d0de38ffdd25ce4d8ea33", + "53bf7cee58474076330dc64d1eeff748df909700dd942d8d59da2447b9f84fec" }, + { "6466a65e9fe920b026739645b446cafb70919a5d03a7e890537bf88c620c5bdf", + "db812442fcc36f2deb4b04a9c32354579abd8a57c185654dc8ce5af21f5e5463", + "39917090786a9532f0700bbdd94d960491d89b68b2b9b1425ef8db67b735ff08d73cb171d911eb94eda3354e252b" + "ee238408ced860a8c1657fdf8c9afea4f4bd041173ae22f236c238d38e469c89b2b2bc73d3ec88cda37530362939" + "34732295e29dda", + "34c8b124c1e26a893aeee4b228214ce840cd9e49f1ab7bbfbb4d90c808215be99c9da5d0d426d5933f6aaf9d1af5" + "78c1a6f2b56e6b4c2ef41f6fa67e7f2693f36b3e21223a5428a8a24d2db24d", + "e1d4206c53b1072c317a494b43323a65d4f17afd6f02f865d94c425f80153add9d611175e9f0bb45c51d7f469272" + "10bfeafdcbf29cf3e1de3c01f4fc3fa94848af52293e3f48be11d1efa5d6e2aefb62385c97ab1dc7aaa96bd0210b" + "af8a7c732386b8", + "bb406b111937304d1ede67719247747cb082efa5e8743364b763ef0e9af1059b" }, + { "be69e13f684ade9206fc567da10871fa4bface67e86e23b9bab7da87f5c2f39c", + "d8b143fd6fe42e1ddf4460592c2c3239e2dd97bad39066b86d121b658395bdce", + "4f7c016b4ad5d4822e125851ea3cff387ed83933c6e20965225c34e5da784ba36585e38293c6508eca322e9a9bfb" + "21b3d5b5b0866c2d32b850072abfebf5417f9cf7c1b3e995338b99cab418b9812863c051fd03131c82b999bfa107" + "bb987a83528931e75a5f4ca0de75f0", + "0d32bb65ce4936e3c9eed5cea33bec6cdc7c4e105c132a2dd663bb2cb0fa2ca62fa1fd55ee46ba39853c04655a84" + "fcb4eec40e5a810e8ecc01063420cae63259ed33cb3fac23b343cbfaa7d9bb30ea45f824d0eaff4d836845baf675" + "6564c66e3aef9457baa1c70e3a9b6cf4", + "4cb6bb6308675a9a03f72d1fbf1d2b7b092bb4743e6f8e6d4f8bc176e1778eb226efd8b33a14c3bf0a554d7cd648" + "80dff4adf7fe622d8b2a51d5a3becc06f77046eb98f6f8b7e4c9a9cbf24eb7a384f87912146662a065f22b984e9f" + "11bbba929183d4152c2dd607f87714", + "c06e27543c2dad50440824ab41013fa2fb34bc1c47222e5a157fe2a8d8324c18" }, + { "e365b446bd38e82eec6f10ef0ab21ee388ad485f08935ab5b27d812c77c8c2eb", + "b5d1efebc38b831ef46617bfc282e47e20a844c326c35981b0af5e97cf151cef", + "a04e8c9a01dcc73001fc6a53", "c6064f3f164594ab4bfe65c76c753d81e110a255d3cd9e512c3ef38d54", + "bca8a253d89f09d92b364671", + "4ef59bdf41cb393aada19b052ed31e568855c6edb37d286078ea3c8b8969061b" }, + { "f6c8e88d9e0da3770d3499977a5b9f9d071731244c6b0ccac921261ca799c4ca", + "de6b3d103cf9efc4cb7d60dd3458e7c5a348692ab63a87c8ff611a336f0bf63b", + "5eda6f7400227d5f0c4f8910c621dcd6ef0c4f9d2d9fb3feab68b3b162fc3db362acfb61c55b06febf04546a3bb0" + "02dd6f3b9e2f531cafb7a6b1d31c29483526b2958eddbc9f2eab5717e1", + "0dff4615b2084f8e01dce6ecf3edfc785f1cc51361f32f29b7e5c49c82f9666454f2143b9fffaac5ad9ef9fc0aab" + "e91245cc050d5e21dd3d31bb508072d8a23d3e289aede9e95bef1bc8c8dd6d1401409234237f7e4df6db44cf9290" + "ebca5ee8a69768eb6dc29dcc5aabde", + "50c1b3be72fed8b6feeeeac72b999bf7f24bec747d30dee62f91753e7a26fdb4666cbea2f437232e57edb331ef32" + "7119b8b41572e8a6198fd4377e6657520d6e833fac4b2b2b1ea4c01923", + "342804e54894f812c0879615dd7d4b8959d36f00b03c3e183148ebba41d34d88" }, + { "c9268f6053542789747187da6140b7566024b623dc9691a534bd730764b20a63", + "b0cd1ad38a01130f0b312be85a9dd570937c0fa1050ec7c3aa31befc400b8283", "60bf644abf31501722", + "3091f60cfb9fa8946e8a06b1a663e60b54a24f2e5f8eb5282d980a21878c794efaa2f6f699300e3facc64197c5", + "a3bdd452eecc7c431d", "32d6f160b3c802fc4a92344f6edd6bd47cc83630ac76b3f7d2d8ea38bf1d8886" }, + { "491c6c8be1926521f6abfdaff5f95c5fc6ee07a800fffb4715e36c5de167e8f3", + "747cf6c78d7462846364b00f21a26b18c49d7bc3878f478af38a7dedf86c9ab1", + "9ca6b63dce33c54e7122ef72a5bec5552b1cd8099596ed8917ff694390e970248f1ef672e985121c", + "3d545120992929ab79fbe41da239705bbd20ab461daeb3f13b74069b0797b02699abe360382669e6752564f6525c" + "349b0bf6a8833445d14ad99d2cfa1212e20874603760682769ec1abdf33186de04d33621d8", + "f5a2cf25a6e22b71786ebf2adeb78d0675d08711b0cc9f1bbc6b065f056f1948570ebf4dc8df1574", + "8c7250ec14c5e10239d1d8d275059a09dce220b496a4869f82718258f52d004f" }, + { "512cb5bfea47aa81a414e0e9c866daa1f2f7d7562a9ff7616ca182642695e9c2", + "39f87cc65699610a3a5b84abaf4d8333e1f83f640b7673ba630d53eb608f3c57", + "371b10a048dc329eadda98b1ab87a8fbcf817eac1fc0a40f5a8c3e34e1b735dd4bf2f185964a", + "96fdeb760af9a39b819676fbd7cf6e025de97d9a735012b0fc2aaf2f845b4d76e97220920b7beb1b7f920e0795cd" + "e96ff923865a5eec1a08fd88c837b2ac0b38e860b1ac5d5054e46c6538fd916f46e8bb17751cf152a3dd531762a8" + "abbafe38198dfbd35ce232ec1927b8f47d1833db9bdebf6f7d92eb029056835ae0", + "dfa26829a13b2383e59180b896920d0a8dc02d11ab91fcea5e004416517cbb465f951447237b", + "7325d446ad6af8023893386201dc1a8c7b3d603d13241a5bbc33f6248d42cd48" }, + { "f2ffec87944d3061075de87038cfed1797276d8c6857433c9458677f67e090b8", + "7aef11906a27ec49ace7193bf61183e4c67835c9c26b50381c7ec18b81e4bac4", + "1460c5acbb61d26d0af31b565d3696e50d6dc022c528f11569dde0ad691b32fb20538236028d51b98d441ba5ef52" + "7ace9a59ee9784c9ff14e8a1d03b2450bb75aba2a91ddf1827c14ef131", + "d95e3d49c922e70c4c34edbde880239eec5bad1c13158a07d6a13462a8978158cadb13ee5f2cc95a21673b6ce25d" + "7c30f0c8acdfa55c259c6d03a4b25d22fa65", + "bfb8d129ab8a3898eb71aa46e2d976c44d790803420ce1b6c77c399ac19842b1486339571b82d84a0461a946664a" + "68e6387b4bec56ee0acc08bec0100175d670ebdb6a9c36fcd13126762a", + "2956d57d9089e44a5c34400b411210dd35c261a9354f6ef1d07235224f2f3b85" }, + { "5c2b46c8c5e5a4661c26ad19be10a781cb845c824a403a6bb708c738e90d9c46", + "b80e79dc4b26bb75d284f0346697816efd98b0412549d4ab09e5453b14a1362f", + "ead1a7d4f2a4d5d5a979e16cdbd32005a5b5506968e18d68a598ba5c0fe2863839ecb029450b0b2d0966558a890c" + "af2b2c5ee750be7784f583b6d3e0bed0cb5d4fa6f7fd098dbe05ba8416c400faf2034c3074dc1ef7d7ee63ea1cfe" + "d18526d394c445848a959fee", + "9aa44ce6a70328ac8455e5648a34176e", + "09633b3761e956bca7602b876d9b5429e64e56c2b39ee00484ce92ffa7395751cfd43f6c46ac3b0552fbc2280404" + "df446cdd8632a41fc7989c4d603b3f6b7efbd075aaceeb3e01bbe60ef88b696ac22f41fec3d7b65b35c0c45d8bfb" + "0cc99d80316b913968089e28", + "2e1954215e5487ac78177f851a580067ff75de270b664e962240f38a42f67150" }, + { "05fead6fb5a0f2be62533e0a29377010bac0a25c753155d56de340a094e7c426", + "aa6663a20646cdcc620fcf23c31deac51ef80b68bc8c5df1f91197066763eb39", + "5e9162142770449251a541fcb7798ee6a59ef56c518a96742b4186f3d27e3a8ef9855dd5c0c586cf957725726a5d" + "9518919c54b07b87630c8f5079b49aa656d03b0a10ae7aa498c1eaf4bf0660ff999c8080524843ff8a8137d95921" + "b8425ff6a3cbac4f52c198f9932af067ef734ca00b682f6ad0ef0e", + "08fffcc594bc5d08a1f6473b604289aa885d9b199c2acbc56493cbd740a5127ed1e218a719076a310301954e54f3" + "8b682eb9f50cb05d2335e7d82bb88487f333", + "211957354e5bd50bc25009e2cdb0adbad870d25aa02c3759bebb29ea2de74afd194aa82edf530086b07569588e5f" + "bc3618f762712d63844c8177d7d24b2d9d5f6be5ff98cf7ea678ac7022a15c17430c20213ef276284ceb7f35e00f" + "2b33a124a88d9aa6ca5eb37afa4076b051f94e2c2018cd90bfb499", + "79edf8d61edd0c8d23e2337c3cc7db00a622215540796800dd4c01be03958587" }, + { "96cfab5f246dfcf8b33a9e80fb15f90a089a9078dabacbe767082da806cb4fc9", + "6a0ad0d16594d33730b03a7b40b86581fda3661264ea17f3a4327160a30f181d", + "61b0d79387c11ac4a87c37a9b3", "a62d02eac118d047cae4ebd58ce97a7c99ed90f4a4bee9a442", + "d0762aa4c8d20934e91a999ca5", + "c0dc96d5ad1cdff9445e163c0df739880bb4dd741f4ca70eef655b213b53773e" }, + { "4206ea8a06c8fdfa6aa47e76e317c3108169d142f6de50927345a2825767a7db", + "b9c7d7ce4503a4ca01b8762ff383f0c13c240d0c9ad691cabb61a73fb1ea7dd0", + "0915f9ff74e3b4cc4d9faedd463176e8b4d259aca80b64fedb9427394fc5950d1db2ee8a57", + "4b283f58f0938a62ba97144ac872b231bd93c8bc14c7bbe22f993598544d90991d713e289cc3", + "963202b6d18e7742621ccdefd04ba47457aa639ec78ea6ebc277d062117fcb7f7efbe926e7", + "33d965ed6fff8369f9e2173f784c19795ba93776e9de83fe0292830c0ad52dc5" }, + { "7729253efc6935859e8e7cbb15850aeb37e0e3fbc017754c9583d7b4353d37f6", + "8b66e8adf9bdc7907e2127485410c30bd8488901d0c75857b35c087eb9e21d18", + "ea7d864e9e1b537c409601fa7b35ed10e66b71ad6a81aae70ab07cc69123a459b9020034dd165a46035ce9ab29e7" + "01d3622a76947e7adbf6c6fecfb4316f35e24fb01a5f46cf57", + "a3788e4450cd6edc283dc66866a7d03b1250b8868364bdfa6017cd9a518046304c4e46f5203e547fbf9c5f416429" + "41b198ea1f640ae2f6431caf544fff17a09fb288904fc3f1686c496f7c3dd47f9fe013a9", + "01a5877237bc6b94f0597df25ff9482976a5ff545dd26759efa03b10280d5f9a058c7bb1c230be66977d463df1ae" + "3ddc3d7ab02c10313320b5dab74a22dc0a6d9158cd3900a184", + "7539465a447f836c3d2e6abfc53a8d9af7914d2fcb738735d64051f8f14d59c0" }, + { "d0c627cef866ebdab7a8030be47a9aae4e97311a3a1896de7971c78feba16dfa", + "505b133a1f82a9eb4c57c485d139197fd3e59dbb07b9c8a02a32438f6502fd90", + "206f537aac47c77eff924a9b3e74ea85623945e1c24490", + "636238aea904adc5f4582d48a00357c4aa57ff1f822fdbf49cadf780f5e346f0153d8ecd353073517fe4f080", + "c44ce4e69f32651596fc5fec1f9f59cfa62c7a44f7281f", + "36d1db8dfadc687ed88ccedc2796b8aa76337ed49e999091186659586295b6a8" }, + { "e13e72cd7f25a23b4f605050771ce73980ac37ea3c2104a17a6dccfae70b795f", + "3720f810b9d2fc0c01abe11477689b78ba6515488483b747fdf66f243f2bb387", + "f2468d65f0c10f82d7989e84b500178f011bc98c199f0bc299c882644373f554ef4a6eb8ff008bf005aa8b40da2" + "1", + "1041f65b724df64dd279659ade61cddf90672f490453aed4f019dd86fe5eee3c15c359b01d0f91a34a67bb67b4ac" + "f51e229ada29499a0503fcb6eff20be9f59b4ff57b73e173dcb1faddbb111e645149321883c02b7f2ec265009e1e" + "8331905cef72a24111fd80de344b420b51e4daa88e6b3b054dd96f4536f5", + "79e9eb1f7879d2c2b27e52f3f00fa7c0e813da9bd741f1a3955ea9de04703a8624f6b7b91b0d720c95432bb57fd" + "a", + "4071822c3d3d92142be2437266fba4701e5c28cab4c11e3ac32d245351b66135" }, + { "1caf2693aa463ae93d13f6b687d7a19fdf047c30d054c2fdb5e07e88b5ab5a08", + "86603e8c83f17abf6af5d8571e4f78955440c1aa97bb6a6e146d787fcc1d4e50", + "ea9eddcc4ac951c60afae654d012b307f21c823da4ca44b3276c7f7006ce82c07d8caefa665636d6f5031e31bc7" + "7", + "cfbaf3cac9237f19986571ec0e39ed09b1a5107cfde57bea24b3f5dba56bb7db7459c4fa82ade76f63ec59e9400f" + "4f51188734811bb563131f49c2e2d71841334b596a63470b2dfe3a421cc657129b449628e5c1ce39a57ff07f2130" + "643a725637014eeba27ff95146a99a06e2584cb9bb3f12", + "de9912a8bec65989ba4c82daaeebb14aa21246bdcd52d01ae5d4e1aa3d70a12277651c75d62569349e0e4cebd80" + "b", + "7af7d1875ed73bf8db71707992f07ffb5fcaa82f5a821c0d3a9000443db1bc45" }, + { "cb1a72f1752672a7fc0ccaf10c76257c047fb767f42c3f23cabc78d35a8cae4d", + "a48db1fa02317b85f1787ed869f1b13250d7f582304594fdf4a2899d50e22c3f", + "25f09554ecaab85e2d00c6e76e31222a9ac91b79fe9eccadb6fd38bdb948502849ea5ed30470d0d94335a64fbfe0" + "d01f5a5b6afb95a40c5406c43e022520c2c727d53f66846e35fa3fedb4c7efa44a16", + "72c88fc1764d922dcc6f3a61e444213e6f7877ef585c65a57ab9814813c9ae73b5a4619b316a6cec5e34241ed2f3" + "cc530d105de4e5ca356ad66cb95f2aef4cedff42a0522f5f7d9d7a9f2fa54901e914a5b733791ef5236b78d06533" + "5477a5eac9d626da94b36a76c3f702", + "ca4afd213fa1a13a18e6ec57488012451cb648902e367edf72902944422f3dddbfd4946f5b34292c39ddd84e5c76" + "91afa22f359cec4dd14afd210a5df66a5799aea2bb57c17f29fcf9c3aeb9c528c260", + "21ac240f5e13978f67a5a233e6ecadc5e555fa3c5637d29661ed9196556b231e" }, + { "34eeeed632897724c59cc20d82ec745af1a6b43665ac88290c11b9baeda6b80a", + "562c76d4ff6201116aa3ba82056b43d8106565553efa4f65be2776ec7346156c", + "485560e1c34a3f1068a77cfd144054f1add7ac802d013adf462fa1e112fef5ca2ee8b48c1a37f1d62c06", + "26f75dda69bd27835c891b9d556fb7312ed524c8f4fed9029ad963eae7a43f85a6dec0146b919e195bcbcf7eeac0" + "09ac5aac9ec784175e0d18a25693", + "4a7861fc50e5c17910876b4cc45b1249ca8b8ed3940e82f5f6bf6e0a161263c66005ce91edd32f876c4c", + "72b792ed7d8e1d5c044c452daab093029c63881044bfa97a819204f8fd87c499" }, + { "ffae6a920ea2fc5baea3c3278f8cbba1f1ab3f07f2499cc87eeb3df3858d67d4", + "81a53e4c40e507e2071b7f9464914a273065ec7f24c5e6e5d0bb77f6fce20b76", + "484672fe6dbd8223fa1cc097886e9b73e971a6120b9f909dec308cf1df8d02181216b35ca756025dc50f6bfe3d19" + "2cc5531ad9bb4dccbc1687afc507539b5fd6259c80f55fb55cee1708485f78d013a03851e4e6ce28c0", + "8bb27c47b62c7048b6117e0c631313d2e165c277742a2a1cdddd", + "8027f08446e70cb72e52679809488940fe1965ec18bf1c56882cc412e41f7727efc55acd6c2b996b5fac79bf13bf" + "ddc7e03b3900f57589215a37ff34241329ca7b5da9ee238ed7fdaf5b1bbbb172e040d1dccc6acbd8ae", + "d25734872533b137110dec26861bcb77fe062c0c41775a2a05ccb86365bcac09" }, + { "57f2386e011a547a48e5c8c170bdc2758e246d4fdb4b5f90f06945efb6bf6c9e", + "8647b48a6ac27f0b6b68f09d9a264963b0b62c8cc8b454ccef9c503e6d568b33", + "523120a8a391e743e7e2d60fa509345da8145db83631881bcf21c0c56b47990966ee08a36b361d2660268bfebaa2" + "2d4f5a8584c1c04a27693adfef76e910eeac0454c4c1aa3b", + "e7b43a9582ba177e97df8725092ae30620a9066c1cdfa627dda1042f5a325a46496c4b200baff0e0709c52ed0ed8" + "2ab11af1efec1e05d044f50d25a38eaf6da2fc2709e609df95f2dc6500d30caca60e421a169ac0f1f69b1d774f37" + "5b942edfc4151e0c78", + "a032008e9601e05f87694a001918c0389b66d13ea514f4c2d5c891591856a3e45472f74b14c409376060ecd90de7" + "b700b0048cd84bac232f5211768e4185086d7992103be87e", + "ce7174bc583746a5183676f5af292df91213a864bae6e6783cc51543cd18e80c" }, + { "29f1e4ad600bc24f64d2a99669f7317add8e61d5d3a3dcda1968b398e7ab3a8d", + "15190e8300313a59c0c6c4dcb0358cc88f7e856240091f1b1bc599a2ff3aca00", + "b01d68b18df703fa9d166efd6aa3ac15fd48dc99f4ac806194f0f500be971560b3135ae422095a", + "cf90cd99d137d5bb0203c0a97f5d4842f4c0ad975df8a5dd863269b37e94fbcd941f220736ea4987e9cfb73b17c9" + "39be601c40daa99133b9a0f98bdc4e4b77bc47d307354119a2fab2771285048a273aa859f99a4ceb6bcf5bae19d7" + "b9d766529d53e29a384304af8de07e", + "321523038cedbe3da195d701835cf62941e6260c3c4ce5466e1fe14b36bccfc0bfcf4955f1f061", + "75b72ea023300ea4fd27926d097e49d4955c6dd6747ea38d2c33bb21ca61e168" }, + { "4600adc836738547a6e1fb257d6a7c290d4895dcbff2e071dc38bac04f338a30", + "ab2f8f6a728f1bab52541407027c51a1619c1db32985120f5ab40cef22e08edd", "f8cbb1362eab78f7", + "7adb0527d13748950fc60a8f6879ec1116c73817e343958965359c8f7f7465b26fe5da1f43112465be72751de684" + "600456e97856aee757161f6157dafac3", + "26baa1fd39aa3c33", "147f674a8345d803d23714b057bf8c030ffb002b6f9dac1a1a7d7582dd89b746" }, + { "01f560d41c4dcdb3906e687c5fe23c070b9a8a9653987706f3357037d7d512d2", + "a47633929b3fbfafd2c29d25ab1e8e3b6402aeecff25d60761355ef44ace4cb0", + "6e085d40606a8042e71fc16b720cec34e47d9bd5e0676f74b6be17f7c78b53ab910980ed7b0622c248006c0ff9e9" + "4b66b8944acfe6857f3241d0abdd8d70a4a81eb0c0a86dde53849e34643b9f37e173ed218d88bea948a240", + "d7631a8eea17f31555b3d4abf16439f763501827180a1f5e58389f796f1c0b468f41ea3ff2e1c76cd02d180c9df1" + "e19f6524b2a8d006f2f954f340a2f0a5a97946d39c34b935f5da5b081f18ecf457b6f0b33a37185ea8af64aa0ade" + "40026580dafe1a5dfd2c4a7acfa8a8254897c7fd3b", + "c309272b71ffd6ee1ed80b91ad22fe88d0488fa7c2dc4539f3452d6d6d1508c162bb8df3ec1fa5ebbd8ab738387d" + "5b0e649cfd83e17b3e943ccedf4548171c82cb8f0b2ae39c48d78df07e282cc40c3068dc70f1fc080114c1", + "786061e81d76bc07550cab11bc1ba1765b41e2967bc8736e11029968cbd85ba4" }, + { "c440e9504cfb4544932adc72ff5fc1b657ba0aae703b1bff33805b7f9b81412d", + "df08a05337a532382953728ef1e921b772d435803e671a02e9cdba82522714a1", + "9dfa0945de0d4c2cb76aa55f8b55761911163b87993db7964760dc5e807f003b6875f74eb34cc160942f580bfba4" + "d96d967d50b1b20b0643ae1a2c73691b6bfb64403350272686fc8bb3a8e3a5674761c2204ca240e37005", + "0c9f5ad3e58b9bf021e09b83564c8d74b1b2bf7c8cba0dc8177084a4e1a07bb84c30c3566103f538", + "279ac5eb9bf6e01cd50a0eda161658f331226f4c8d43fdb793ae07f353e6fc2f2821a01a02be62f515af80633215" + "a908aad8e5199c4ff23a38277ff8f16f15058d69fca995718c0d837b6db3bbb5842dd21c07ca35b21bd4", + "16f09ea8657c053e907bdf8f822936f2cac056af25e0240633c80ae0baf7ade2" }, + { "ca81440758e13fe0b847ea81be8037b1be4cf995f805d4f40c1f421c9864ab9d", + "aed156910fd8af6af094c74c0ca0fba932b436bc282e0c5c910ffd3651777117", "fd83897f98974ac8", + "64ff6ab0506574c5020e14c45a009192a7a17ffbf6761393e17a86aaf339264a5c72e9e2b7fd22832a999076dbd4" + "9c75145228ba6d36b0372042e22435f34577a2c3e1c89e2e1846dbc393d57064f016d0487d591fc6b7f8499701f8" + "2568182041929386c821b74a53232dd596b300a13fa09949939967e58b2c0cf2de5b8b", + "cc1913d2e48750a0", "59db1143754b19f380fb1d1b9296fa992b7c2f5adc56f451349d1ff95cd2a1d9" }, + { "a657ee84d894bb98db137d57121d149eee96447353225f701b4c0c8bfc5d9497", + "1edcd529feb85cd69e484c0989a9b60776437dd4dcf988e3bfcce5bead13f331", + "4fd8a593ef021f81603e430e0c9eef2fa2e7cab56d86b13a9ecfee70fb96a7bb0cdc7b23df061ff73b96a289faf0" + "c0756f0c2e4692489e58391eae3574539f40189fb8735735deda0c8d71ff361155a0d3a574b193a31746f0272001" + "fbe8f840dbb4f16f522c90096ae5d76209af6eb2e423109d2bf0", + "fd167c49f8e588d06df1ac5d94d61538e399d0c531aa0ac0f9a1c030dbd3e8b649796917f4f8f8078b104352b156" + "4a042ccffd30c19340e067d4f17b0bacc47e121a8808d06b1ea6bcc06ffbc1bdaed0999dca79212c8df6ec", + "99f8a75bbaef042167ebfb927e6ff5bdc23e3a2084e539780ffbdc20d9be6d21e761381f23937f3179aeff80469b" + "a65b8d2169c5695ad2dc64e39d165eb7e57ded4ab07182ca59e516b41dc463c2093425d9dcf6a377312e4437d441" + "6d063324d24945f86c57a060cdb4c182fb3c9094e6c43af38a8d", + "977af18c47b4e1bf3f6ee45ae865d3e3dd6ebc953c4ee636c3e560beb433c5d6" }, + { "0cb4ac9b372daf29e69a698a434c67bf822f88eabe81c2fbd1869b151bec66ad", + "b34c3f1d39ac43e9a10ed22019b858a679fc4c629b7554e4b205ec3f31d601d7", + "40da148ae0cd9eb7d108fe5b04664e6369ac4f24465737a33f2a16164e67a84a403a66ea3f4166b4304f", + "1559e36d745dd40b60d8006bfa6ad62f9f1a8a7992de66bbc71d8ddf18fd68ce01e7910a972a028334f686c3b214" + "d725d3606eb3b762d69fb1460b95e949a724d09977c41b13fb094e16e186ddd429515e939e641cc38e5f6c492f3c" + "f7495cbe2b474c48f1890e214edfb8580d1de07855084d69ae241b421ae6", + "e2c7a3fcd1d66a1f71301dfcfc459ad8c3485f2586a4594a02e46d35dbc4e637e9562cee2e317adc7120", + "feae706283fea438eaa7c20641bb8446e9695cd9a0292f99b3b3ed4609a28dee" }, + { "b38e1805f202898c64975134d2369d065b808ca28ac8562bef3dd97b96650b3c", + "1bd55d1c60a6f84094c52906fb2f711aacb93831fee6dc27fb6a746f4c412012", + "d4817734cb56d6bd3321c7a3dc4e23d5481703d72075ae6127f1f366a0624bc1e2ac175db9ee2fe4a9c0a016d1d9" + "955c652970a05dbb4b16f7d2e7275b9a915bc39df5effea00190b77eeb6fd056cb2951cada1d8ef9c8e9ca0de03d" + "7b2d659c947c9a82ab512641ae734f82", + "1be672d193cec78c85db5636ebdfe4f087ab5a2fccff0885fb39b60f901e8d6921e4d285b5daa19dac9032d6b03a" + "2a81740ba4ffd833e90a942253e607a800c1ff92", + "5be3df33c976077a603612ee85cfdf388953e958e5ee0c53271058258dbcc1fa8e493e044467fd00229b64337644" + "8e9958dae478e59808839daa20c983159be864a905f97e7e00bf82ac97bfd9d005f3282886b7c1df0b505f75741c" + "518bedea91f800fcb135688940a38022", + "5fe7fac48f68d44c9c8d8be7ac95025fb4bf890650af092d1228c4858a8c1a9f" }, + { "bdeb596ed2056c8a78eb1f33340d2b8b0789cc456d6e8db9bb45516233900e29", + "7096012b1bf4f66f48c1f26ab48d8594d244be86426438993ed1cfad84376c90", + "5f3638865cb87188951620dfbcf77c6da914372635542fca218b74f5808090f8ff72919975744dff1a6693a759da" + "7579ee01c449246e12783546333d9201ddd0e9941acbedc6c1995b09", + "186d83c27e4831ef0c472840230860513d15b0f3df6a27ce2decb7a53c15e38c3b043c8a", + "399b4dbc243c979b481b18a29415fff5065c9da5367679a2bbe60b5864352fa096c65cc51c9d5054844b8f0cdacb" + "c638f8defdc81b7d80a9f5b1fa58201f0c513dbb192ea93a05dda87f", + "7f5644fb9adcbc68a86621c4d6d7b1b32a62cda6ccdbe2d5fa8e708a4de8a3f5" }, + { "42985b7c9c97ec16bba3c36bcf82e93205c35a57428262d9e45a7fd494a9020d", + "be4b2dd3dde2e7a773f7b85f0acb48d65bdbf4d8bfc103eee72697c8834a5058", + "6bfc05bc2457a43f50a7391a2c38627fb0429a446ac684e7552cd54c07b9608f716ceeb50d6bc0563247163213e6" + "2ca2bbb5067dd00b3d884795a11dab0c96e23419ce7779554bf39c50edd6ae225998cf96d1effe70c81d348a938b" + "116fcae5d402f35aa2900673376576", + "a7f9f0d4a1cdeb5abf1d927f6968beab9c6ead6995f484c016", + "985b208c4938d0fd9ac7b653e0d04445fd9666044e79a766c746354cf7c949e8724170dd76245f2af71ac34d379b" + "0be203bcb863f40081564ba161087605a9863f5b39c2c7d0f7876c84b02d9131f5284ce5d837662575efedcbb3b0" + "12053e2c4b15ef4ee0010840552759", + "ac55330373905d10205b0884596166370c6c9c52af6a358bbf09195b3e2f2626" }, + { "50034fdf7205a542055cf377ef546d1fe01ae8c7581806688c04279aeccf76de", + "215de8afdde0916097f91dda6fecbd18c5e65bc685e10488e99a225a5887d92b", + "dcd4b2ef9dd40e50adc8ce3fb674801d650e", + "6f1ce70899b24793fd8ad89784d62ebc43b750faa9bc63fa44e707cb6877dc400dbcb85500a386add1052bbf090c" + "637c8c618428040226209023a0db954ac26824ce40ba5021bb19d1a65ee3e3c4261c9801bd85b9c282753072", + "df3e9901518fa830aaacab9a5635c861aab5", + "b2a32c41c181a42175cd9108135f815663981c51f43af547e7942f77ebdc46aa" }, + { "782358a4bf3258130b1ab345e76184bd37eeff55c6efe7b8489626e5ba01741b", + "3ae5c450b1f426cedd3f5445ee785b6c2718d587f4239053cbad839e7e19f044", "454e", + "bc5971d3c8a7284f6218685581fc0e67572e5f124405136021536da07ec4d443015de3a708e72eaa943f5b5fb8f4" + "85472a3999e95dc3ab7cf72ecba533006681a49f39b5d5768e9ed22e3cfc7d20d3744308a6518d46a0", + "8a75", "d5cf51a52be53fc9b297efd9c0f3421e598143718f7f46fc3dd542f166a65e8f" }, + { "5958a371e26fff28efef8a6e71a0b81b4a14e3cf57ac75d215376e050468806b", + "1293abdd7b6c43483f8caa43836922fb3a92feb4eb1476f4fa5ec4f06a0431f7", + "06544eb4f4baafd8880df8a4e1da38d3111149aef41669b56ae2", "5f6cd8814bf4915f08cbf1", + "e4b718de939d6fbb41e32b57098b08fa16bd39ccc085625d0546", + "d1a48afe22b3c7d28e239f103b93b0a200428f4bb8e80fcb2e5110fd1ed780eb" }, + { "7bdcad0b011743f3dec12c999ac89b28f60e03564cd076fbf0183457846e606b", + "e008a14a3fb5e56e89e02d5fec31b37b3fb6357682bc3db3368f25987f6205c2", + "c2bc1a650114c6d522d2f928c6a65fb6abcca554336dfb70b51f61558a349387b35462bba19c3f8f13488fd4812f" + "9d6d58d04a6ca93e8dad62a5f695a0834dd99f876294", + "18066e9f8cdd274090f075f3047a455ca6be1ec4d1672acb013f328a1d981bece9b9c9f0f38dd25db8523b885b47" + "cfaba4844d5bb3972591bdc2b68062e7fb0e08773506e7851a18fbc6cd29c29358a347ea195a10f5a7d874010909" + "278395f2f9820ee8eb6655602b7b44c6c1642b9c157cc5c1a454e1b18b46", + "bcf887985dc0e45a156b522f02c4b2adbf90a2b30f4a30ee68505df9c61d3857a6216a827c98d1d7df6dc664a526" + "32b61361f4d86ca646c83f690015535b149c545efed3", + "bd2cbde77f6ef4955e956d440226534942f7a41a659eb826647b3a99a57efa87" }, + { "21505992872622190e47da3d4a985ceaf356b35e096429bdff8e4a21fcbeccac", + "8b4ab2427a4177cd205fda2b2b31f8f5ecc5ff591262791f88f54535f3054977", + "1ceea40aba4d9328718e9939eaba25f5b558ed0df855e743cc958506b4d0c5e44d0690b9637bf94a30e861ed9260" + "e254d602be895f173453a7977236846c4687d2b38470f074b07e16e67721646989421cf5081555fa7bef42a83066" + "6e6c2c9b61ba14932210", + "106f5b1fed2f5d3a102733ef6fbb7e190e508e7e8cb73766bf18fa4d50b87d6f83144f9b616dceef6c0b085f09e4" + "27f7f0985a535fd9edf3bc05aa8dbc0db601cb4f90761420164fba50a68c5a87322fecbe28c902b03035e88d499a" + "f758eb2049659f2561ee6c5210579f8c0c", + "1562c0d501518e478b0c5561b32a79bbf5249d0eb8db411190454b4f3a458bfc200f65af91a22eb0fce63c726cb2" + "b51023d294c9a35e0ff842da517d6f91b6126c0ecfccd72cfc35d7ef98f11ebbb4cd071c2eafeda598a5ccf4e09d" + "8cff52ed583d968525a7", + "1dfe935ef87488e515897c850bc899d4a9844d512969802e98be90c0343bc146" }, + { "337bd1641222ad96608b0928eb3e05fee02a6fb1e2f66cb4c9b698d1d96ee39b", + "b532f2e6485513a5b21a6326beded2b3a74bc49c74db3f7a23e440e5bc864e7d", + "9cdf9d6c42cff95ca0bf8d199962f55ce013348fb06d878b10a344ad5a7b2b2981b0e44ddb7dda1f74bcd24f3ff1" + "bb63da249bb02234edf123305759780e45ace82aac7a95adbd1c7e72741e374c82a4524146d13589ef28ee593678" + "9e65724b10406aff6d19d0fee8289033c094bed67df3fd45b0bdd52fccc25492cd335a", + "efa6fdd7e4c161a5cc2eb6d67b14d6d8f16ecd3c52e8c9720709c321de05973b51750a7286120a50b3039e54c4c5" + "e09785f815ddb5eb528b43e972bf4c60e41252", + "4616337212a9b1fb827ad8729cf40a8309330dcc958ac0d5f73c9e57279de69280065e13fd1309153243c1303cf1" + "16227392c9ce4b8ab505a580c06926587378c83f49c30021a1f4038180fedbe90259a9d468c87bdff827da1d01a1" + "23fbd5b091d62d3b17e3ce7f4e83cba4510dc1e41b420c2ffc7544464befe9eb5a898d", + "709914dea13632a2127159bf004a73349efc090a46bfecec911c63679a1540e6" }, + { "88f3c9cd7b2f27295c5defc7ba7071996ae5d558192c1a4788efe8a3bc3559d0", + "d1ec8bbec1bd039825009a00b35522ad81c8de7bbfb698551f880b05319330c6", + "5fc7d4fba7f9018c91533584a5e61be925559d1c8b1270621aaa2f0f51ec69ee7b14628841e2a234f3ed4279e589" + "bc40339928d600f79a051db41699a98a263864ae34909a7c37e9c833c106bc5e996c730879d7b94d18c87741a3e7" + "2bbbd30a5c7a", + "9c", + "efec904dfe14b42ca52b083ca46fc0ab80877b425e8cfbafdbcdf8600bcaa64afa05119ebbdd0f8db82ae71236c2" + "4cac6cc53b9e0ec701f94ae4a9217f9f63ad426394793cebb1f0af7ba4bf0dc8ac621c48e2a435955afc79f095ba" + "518e20bbe360", + "1ed588fb6966a006fccc5f5a6e57949f9389f89c3e346bd8851610a0b159e958" }, + { "db7c3c7c7e5aa8a1c5cd5173bfb0d25958db4038a3d8deb705c102935fea8f21", + "315686635d388d5b2ecf3b12a8450280d92555a6920f6ad3b48ba3b4f8ec5053", + "939b319d85880267f8be72b69d2a22ba2460bbd7ce68cfc9398afce09c4f0005cf510db2aa894dcbf08120f07640" + "255a9464056ec16765521f23d602b5af51cab7133cf01123b3038cd7dc47fdd7801c46fd628de0aa", + "b2da", + "783dbc7d88eb43f69d7330326e58555f58df2e75a019586beb5e4a303a3b3e4439677fd7e00a6826372cb2bc15c2" + "5ab445bb0dfa8aae1f4d9b5d6ded219e69037c161c7fd5911bf08e3179419dbef05d37df75fb19c2", + "b96409a14cdac61218fcc2ece389e570ac6c665856f36d98fa01be4d767b960c" }, + { "cf1f1538739072f57ebf0fa4090a63c72cf8f5bb904effb6051073596ed1dd19", + "41e11d23771626febef2435eaefddf0c93a484ea6c4c7fa0bfd48f93e50b646d", + "a22ba67dac88efd1988863f8991bfc9dbb9dc1a34e3866b0a51e088671971225fed3bc0369b0bccb436249d6fa30" + "e7", + "80d7f1fc70203411f8827cd7eec9888f26e39e055d8fd1c2876e1e252b3b14363f493100f157d8246c29b973a490" + "338dfa0bcb52221d260875a65e22a56f655a55330933b35e2937c53a625a55bf40564fc58f742ecf54aed0536ca3" + "f7c59f6d", + "b3c76b03eb90c78ca281f178f30a92a98ed9966698ceb24f15f6c5ebf2e65ec4880543847005a58006a0829d2d00" + "b3", + "22f4354c7487a2db0c8c2249fe96909ea1cc9a053447b4a83ad396e3b3ec87ca" }, + { "38a7aa902690a3e1b285953e0121eae7304815e12a015fa98cbd227e6f7d73c1", + "f23f9ac01c0b118b684f10031836f7c92e8a70eea0e916dba2952b685ae2c148", + "995580acc337ee1216802b1a45daf0df12280eb94953ac61916d35eee038e5ea1d1f53da1c6a3e17d54dd1555e79" + "c4ac988494f805715f59f2404eee2fdb592fa538928d", + "6b726ca02fa44684e7d92ddb0b6e2f30d6a6e75b537f209d21bf2375718b4092286ea592f3c1750af21b12f64961" + "1370ee4bfac05e0281c9731242c507a56d9d6522c26e172fb406f3e61efbf3c346917988a1dc85c829d51d3954a0" + "825d2ca4d0e2a784c78ea07bfc5973e80fe6b34ccfe72457", + "c73f3832441f59ce54910fd16dca9e2bd59a168ccd658ba3eb87fbb1ba561f63ad73ecf9618481bc6e8c8020c60e" + "8194cc65bdea155f0f6cc79adaf2334c099793efba4a", + "5c52422a24f79990f26224082d375bf81eaf5df242389c894cf89c4d0131d01e" }, + { "aa54db3f1c5e6405d443afcf4a463974448435f4002d64044a21a04c269759b9", + "0711d3a79176e4c75ac8cc1ecdbadd4203a6a4b9eda4c2ef17150f493d645b8b", + "5a80d351e6a2682a6ceeb374acf59de7e7", + "171077e40c0a689d44003bd1ce56c08b81f6fa3c118cf448f5e8b6386328d5e3465132e5bdf4f73e60b1b1e6e021" + "d05f6881fe7ec8be523ae7e6c57dd1b0af6939b79dc785d584400dfb71aabc336817e295a922aa1d46b873ad3863" + "3099ffbecbf43527a1e64f98d82cf85a18", + "5026a9cbdd2239c6a9abd45e36d5b46b14", + "afe7bea6340c227c0f062e73a05e1be4aa63b93d35f2322322d3e855e0ef5887" }, + { "c3dddd6891c6081f6b478a6cf89574636c8905efbc8079ef1924b97036a050ef", + "abc30e2892910e8c3fb83d4cb6f93eea614a7ff03b750e31ad5fc74ab77e0715", + "079db15c3fc075189ca979ae738e72f0e5a35410b0b746d2d92874f58214cedd7e69a5337485ff038a44f18cbb6c" + "9bb02bc396aa128b87e7888011e803fd9f43dd43494dfb2b58981d1f95820be9d37cec3bc4f779861cf59137f764" + "dd88ea41cf044d9a", + "56c59f42c3429832f9f2333099d2c422ea40cf36162b162e6cda56a9", + "6910f3c047011cf301c6d8458ca4d1c40aafc129476a9c89da7b35ced9479edd3c7cbd5c1ae7a8fabff159cce121" + "c170c1e1a884255b08758d640371d26eb031ae92d1deb7091f202bff0698ca059eae8ae572ada217b6d3df5d446a" + "a5aef503eda02f5e", + "f5d285ebf784c68df40ff4324bf79d0808d43f0739d297f4238b833a7cf9c013" }, + { "77716c56b9f0e158530b24ae8bc160f827eb4a11ee3b1bb3fbef3922e41d58c1", + "f340f377c03ffca01829e013ba7a175b158ac51e5ec84e13dcc1a1974e157557", + "2b9b2bf80c7c65d0a2d243cfac9d01ec9a0250b5e985d430f5eed4ca6aa62b31e3f5d4256a9c998fc588c69486ad" + "41618d8b9094468f9e74b6", + "d314a97f25ebbb16aa2d8a444c70474b5733fa18507c544515ac905450507c708868a7c3847705fcc3b7651a72a2" + "15675a24d44aec160c562c1d68f859dcd4b9aa3569595e040ef6", + "a58d41ed071ccfd12e01de4038783e6b23f84f55354dc0368a025cb9ceff0aa01d9e77badba040fdbc5cd984f95f" + "4c6c6ad1151f02b5687ffd", + "f66ee48f6ab2bbdf3ebd292a11c997bfd6f81ef5a9b61f0c9c5f9e77d7fa2624" } +}; + +static int +tv(void) +{ + unsigned char *ad; + unsigned char *ciphertext; + unsigned char *decrypted; + unsigned char *detached_ciphertext; + unsigned char *expected_ciphertext; + unsigned char *key; + unsigned char *message; + unsigned char *mac; + unsigned char *nonce; + char *hex; + unsigned long long found_ciphertext_len; + unsigned long long found_mac_len; + unsigned long long found_message_len; + size_t ad_len; + size_t ciphertext_len; + size_t detached_ciphertext_len; + size_t i = 0U; + size_t message_len; + + key = (unsigned char *) sodium_malloc(crypto_aead_aegis256_KEYBYTES); + nonce = (unsigned char *) sodium_malloc(crypto_aead_aegis256_NPUBBYTES); + mac = (unsigned char *) sodium_malloc(crypto_aead_aegis256_ABYTES); + + do { + assert(strlen(tests[i].key_hex) == 2 * crypto_aead_aegis256_KEYBYTES); + sodium_hex2bin(key, crypto_aead_aegis256_KEYBYTES, tests[i].key_hex, + strlen(tests[i].key_hex), NULL, NULL, NULL); + assert(strlen(tests[i].nonce_hex) == 2 * crypto_aead_aegis256_NPUBBYTES); + sodium_hex2bin(nonce, crypto_aead_aegis256_NPUBBYTES, tests[i].nonce_hex, + strlen(tests[i].nonce_hex), NULL, NULL, NULL); + message_len = strlen(tests[i].message_hex) / 2; + message = (unsigned char *) sodium_malloc(message_len); + sodium_hex2bin(message, message_len, tests[i].message_hex, strlen(tests[i].message_hex), + NULL, NULL, NULL); + ad_len = strlen(tests[i].ad_hex) / 2; + ad = (unsigned char *) sodium_malloc(ad_len); + sodium_hex2bin(ad, ad_len, tests[i].ad_hex, strlen(tests[i].ad_hex), NULL, NULL, NULL); + ciphertext_len = message_len + crypto_aead_aegis256_ABYTES; + detached_ciphertext_len = message_len; + expected_ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); + assert(strlen(tests[i].ciphertext_hex) == 2 * message_len); + sodium_hex2bin(expected_ciphertext, message_len, tests[i].ciphertext_hex, + strlen(tests[i].ciphertext_hex), NULL, NULL, NULL); + assert(strlen(tests[i].mac_hex) == 2 * crypto_aead_aegis256_ABYTES); + sodium_hex2bin(expected_ciphertext + message_len, crypto_aead_aegis256_ABYTES, + tests[i].mac_hex, strlen(tests[i].mac_hex), NULL, NULL, NULL); + ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); + detached_ciphertext = (unsigned char *) sodium_malloc(detached_ciphertext_len); + + crypto_aead_aegis256_encrypt_detached(detached_ciphertext, mac, &found_mac_len, message, + message_len, ad, ad_len, NULL, nonce, key); + assert(found_mac_len == crypto_aead_aegis256_ABYTES); + if (memcmp(detached_ciphertext, expected_ciphertext, detached_ciphertext_len) != 0 || + memcmp(mac, expected_ciphertext + message_len, crypto_aead_aegis256_ABYTES) != 0) { + printf("Detached encryption of test vector #%u failed\n", (unsigned int) i); + hex = (char *) sodium_malloc((size_t) ciphertext_len * 2 + 1); + sodium_bin2hex(hex, (size_t) ciphertext_len * 2 + 1, ciphertext, ciphertext_len); + printf("Computed: [%s]\n", hex); + sodium_free(hex); + } + + crypto_aead_aegis256_encrypt(ciphertext, &found_ciphertext_len, message, message_len, ad, + ad_len, NULL, nonce, key); + + assert((size_t) found_ciphertext_len == ciphertext_len); + if (memcmp(ciphertext, expected_ciphertext, ciphertext_len) != 0) { + printf("Encryption of test vector #%u failed\n", (unsigned int) i); + hex = (char *) sodium_malloc((size_t) found_ciphertext_len * 2 + 1); + sodium_bin2hex(hex, (size_t) found_ciphertext_len * 2 + 1, ciphertext, ciphertext_len); + printf("Computed: [%s]\n", hex); + sodium_free(hex); + } + + decrypted = (unsigned char *) sodium_malloc(message_len); + found_message_len = 1; + if (crypto_aead_aegis256_decrypt(decrypted, &found_message_len, NULL, ciphertext, + randombytes_uniform((uint32_t) ciphertext_len), ad, ad_len, + nonce, key) != -1) { + printf("Verification of test vector #%u after truncation succeeded\n", + (unsigned int) i); + } + if (found_message_len != 0) { + printf("Message length should have been set to zero after a failure\n"); + } + if (crypto_aead_aegis256_decrypt(decrypted, &found_message_len, NULL, guard_page, + randombytes_uniform(crypto_aead_aegis256_ABYTES), ad, + ad_len, nonce, key) != -1) { + printf("Verification of test vector #%u with a truncated tag failed\n", + (unsigned int) i); + } + if (i == 0 && crypto_aead_aegis256_decrypt(NULL, NULL, NULL, ciphertext, ciphertext_len, ad, + ad_len, nonce, key) != 0) { + printf("Verification of test vector #%u's tag failed\n", (unsigned int) i); + } + if (crypto_aead_aegis256_decrypt(decrypted, &found_message_len, NULL, ciphertext, + ciphertext_len, ad, ad_len, nonce, key) != 0) { + printf("Verification of test vector #%u failed\n", (unsigned int) i); + } + assert((size_t) found_message_len == message_len); + if (memcmp(decrypted, message, message_len) != 0) { + printf("Incorrect decryption of test vector #%u\n", (unsigned int) i); + } + memset(decrypted, 0xd0, message_len); + if (crypto_aead_aegis256_decrypt_detached(decrypted, NULL, detached_ciphertext, + detached_ciphertext_len, mac, ad, ad_len, nonce, + key) != 0) { + printf("Detached verification of test vector #%u failed\n", (unsigned int) i); + } + if (memcmp(decrypted, message, message_len) != 0) { + printf("Incorrect decryption of test vector #%u\n", (unsigned int) i); + } + + sodium_free(message); + sodium_free(ad); + sodium_free(expected_ciphertext); + sodium_free(ciphertext); + sodium_free(decrypted); + sodium_free(detached_ciphertext); + } while (++i < (sizeof tests) / (sizeof tests[0])); + + sodium_free(key); + sodium_free(mac); + sodium_free(nonce); + + return 0; +} + +int +main(void) +{ + tv(); + assert(crypto_aead_aegis256_keybytes() == crypto_aead_aegis256_KEYBYTES); + assert(crypto_aead_aegis256_nsecbytes() == crypto_aead_aegis256_NSECBYTES); + assert(crypto_aead_aegis256_npubbytes() == crypto_aead_aegis256_NPUBBYTES); + assert(crypto_aead_aegis256_abytes() == crypto_aead_aegis256_ABYTES); + assert(crypto_aead_aegis256_messagebytes_max() == crypto_aead_aegis256_MESSAGEBYTES_MAX); + printf("OK\n"); + + return 0; +} diff --git a/src/libsodium/test/default/aead_aegis256.exp b/src/libsodium/test/default/aead_aegis256.exp new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/src/libsodium/test/default/aead_aegis256.exp @@ -0,0 +1 @@ +OK diff --git a/src/libsodium/test/default/aead_aes256gcm.c b/src/libsodium/test/default/aead_aes256gcm.c index 1f83fdc04..9c1e43d60 100644 --- a/src/libsodium/test/default/aead_aes256gcm.c +++ b/src/libsodium/test/default/aead_aes256gcm.c @@ -3081,6 +3081,7 @@ tv(void) { unsigned char *ad; unsigned char *ciphertext; + unsigned char *ciphertext2; unsigned char *decrypted; unsigned char *detached_ciphertext; unsigned char *expected_ciphertext; @@ -3097,6 +3098,7 @@ tv(void) size_t detached_ciphertext_len; size_t i = 0U; size_t message_len; + int res; key = (unsigned char *) sodium_malloc(crypto_aead_aes256gcm_KEYBYTES); nonce = (unsigned char *) sodium_malloc(crypto_aead_aes256gcm_NPUBBYTES); @@ -3135,34 +3137,48 @@ tv(void) ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); detached_ciphertext = (unsigned char *) sodium_malloc(detached_ciphertext_len); - crypto_aead_aes256gcm_encrypt_detached(detached_ciphertext, mac, - &found_mac_len, - message, message_len, - ad, ad_len, NULL, nonce, key); + res = crypto_aead_aes256gcm_encrypt_detached(detached_ciphertext, mac, + &found_mac_len, + message, message_len, + ad, ad_len, NULL, nonce, key); assert(found_mac_len == crypto_aead_aes256gcm_ABYTES); if (memcmp(detached_ciphertext, expected_ciphertext, detached_ciphertext_len) != 0 || memcmp(mac, expected_ciphertext + message_len, crypto_aead_aes256gcm_ABYTES) != 0) { - printf("Detached encryption of test vector #%u failed\n", (unsigned int) i); + printf("Detached encryption of test vector #%u failed (res=%d)\n", + (unsigned int) i, res); hex = (char *) sodium_malloc((size_t) ciphertext_len * 2 + 1); - sodium_bin2hex(hex, (size_t) ciphertext_len * 2 + 1, - ciphertext, ciphertext_len); + sodium_bin2hex(hex, (size_t) detached_ciphertext_len * 2 + 1, + detached_ciphertext, detached_ciphertext_len); printf("Computed: [%s]\n", hex); + sodium_bin2hex(hex, (size_t) detached_ciphertext_len * 2 + 1, + expected_ciphertext, detached_ciphertext_len); + printf("Expected: [%s]\n", hex); + sodium_bin2hex(hex, (size_t) found_mac_len * 2 + 1, + mac, found_mac_len); + printf("Computed mac: [%s]\n", hex); + sodium_bin2hex(hex, (size_t) found_mac_len * 2 + 1, + expected_ciphertext + message_len, found_mac_len); + printf("Expected mac: [%s]\n", hex); sodium_free(hex); } - crypto_aead_aes256gcm_encrypt(ciphertext, &found_ciphertext_len, - message, message_len, - ad, ad_len, NULL, nonce, key); + res = crypto_aead_aes256gcm_encrypt(ciphertext, &found_ciphertext_len, + message, message_len, + ad, ad_len, NULL, nonce, key); assert((size_t) found_ciphertext_len == ciphertext_len); if (memcmp(ciphertext, expected_ciphertext, ciphertext_len) != 0) { - printf("Encryption of test vector #%u failed\n", (unsigned int) i); + printf("Encryption of test vector #%u failed (res=%d)\n", + (unsigned int) i, res); hex = (char *) sodium_malloc((size_t) found_ciphertext_len * 2 + 1); sodium_bin2hex(hex, (size_t) found_ciphertext_len * 2 + 1, ciphertext, ciphertext_len); printf("Computed: [%s]\n", hex); + sodium_bin2hex(hex, (size_t) ciphertext_len * 2 + 1, + expected_ciphertext, ciphertext_len); + printf("Expected: [%s]\n", hex); sodium_free(hex); } @@ -3210,6 +3226,32 @@ tv(void) printf("Incorrect decryption of test vector #%u\n", (unsigned int) i); } + ciphertext2 = (unsigned char *) sodium_malloc(ciphertext_len); + crypto_aead_aes256gcm_encrypt(ciphertext, &found_ciphertext_len, message, + message_len, ad, ad_len, NULL, nonce, key); + assert(found_ciphertext_len == ciphertext_len); + memcpy(ciphertext2, message, message_len); + crypto_aead_aes256gcm_encrypt(ciphertext2, &found_ciphertext_len, + ciphertext2, message_len, ad, ad_len, NULL, + nonce, key); + assert(found_ciphertext_len == ciphertext_len); + assert(memcmp(ciphertext, ciphertext2, ciphertext_len) == 0); + if (crypto_aead_aes256gcm_decrypt(ciphertext2, &found_message_len, NULL, + ciphertext2, ciphertext_len, ad, ad_len, + nonce, key) != 0) { + printf("In-place decryption of vector #%u failed\n", (unsigned int) i); + } + assert(found_message_len == message_len); + assert(memcmp(ciphertext2, message, message_len) == 0); + if (crypto_aead_aes256gcm_decrypt(message, &found_message_len, NULL, + ciphertext, ciphertext_len, ad, ad_len, + nonce, key) != 0) { + printf("Decryption of vector #%u failed\n", (unsigned int) i); + } + assert(found_message_len == message_len); + assert(memcmp(ciphertext2, message, message_len) == 0); + + sodium_free(ciphertext2); sodium_free(message); sodium_free(ad); sodium_free(expected_ciphertext); @@ -3225,11 +3267,54 @@ tv(void) return 0; } +static int +tv2(void) +{ + unsigned char *ciphertext; + unsigned char *message; + unsigned char *message2; + unsigned char *nonce; + unsigned char *key; + size_t message_len; + size_t ciphertext_len; + int i; + + for (i = 0; i < 250; i++) { + message_len = randombytes_uniform(1000); + ciphertext_len = message_len + crypto_aead_aes256gcm_ABYTES; + message = (unsigned char *) sodium_malloc(message_len); + message2 = (unsigned char *) sodium_malloc(message_len); + ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); + nonce = (unsigned char *) sodium_malloc(crypto_aead_aes256gcm_NPUBBYTES); + key = (unsigned char *) sodium_malloc(crypto_aead_aes256gcm_KEYBYTES); + + crypto_aead_aes256gcm_keygen(key); + randombytes_buf(nonce, crypto_aead_aes256gcm_NPUBBYTES); + randombytes_buf(message, message_len); + crypto_aead_aes256gcm_encrypt(ciphertext, NULL, message, message_len, + NULL, 0, NULL, nonce, key); + if (crypto_aead_aes256gcm_decrypt(message2, NULL, NULL, + ciphertext, ciphertext_len, + NULL, 0, nonce, key) != 0) { + printf("Decryption of random ciphertext failed"); + } + assert(message_len == 0 || memcmp(message, message2, message_len) == 0); + sodium_free(key); + sodium_free(nonce); + sodium_free(ciphertext); + sodium_free(message2); + sodium_free(message); + } + + return 0; +} + int main(void) { if (crypto_aead_aes256gcm_is_available()) { tv(); + tv2(); } assert(crypto_aead_aes256gcm_keybytes() == crypto_aead_aes256gcm_KEYBYTES); assert(crypto_aead_aes256gcm_nsecbytes() == crypto_aead_aes256gcm_NSECBYTES); diff --git a/src/libsodium/test/default/cmptest.h b/src/libsodium/test/default/cmptest.h index b1261bdbe..54a020705 100644 --- a/src/libsodium/test/default/cmptest.h +++ b/src/libsodium/test/default/cmptest.h @@ -118,16 +118,23 @@ static int mempool_free_all(void) static unsigned long long now(void) { - struct timeval tp; - unsigned long long now; +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) + struct timespec tp; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) { + abort(); + } + return (unsigned long long) tp.tv_sec * 1000000ULL + + (unsigned long long) tp.tv_nsec / 1000ULL; +#else + struct timeval tp; if (gettimeofday(&tp, NULL) != 0) { abort(); } - now = ((unsigned long long) tp.tv_sec * 1000000ULL) + + return (unsigned long long) tp.tv_sec * 1000000ULL + (unsigned long long) tp.tv_usec; - - return now; +#endif } int main(void) diff --git a/src/libsodium/test/default/core_ed25519.c b/src/libsodium/test/default/core_ed25519.c index 5340f9e82..b24612609 100644 --- a/src/libsodium/test/default/core_ed25519.c +++ b/src/libsodium/test/default/core_ed25519.c @@ -64,13 +64,15 @@ add_l64(unsigned char * const S) int main(void) { - unsigned char *r; + unsigned char *h, *r; unsigned char *p, *p2, *p3; unsigned char *sc, *sc2, *sc3; unsigned char *sc64; + unsigned char *seed; char *hex; unsigned int i, j; + 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 < 500; i++) { @@ -81,7 +83,6 @@ main(void) if (crypto_core_ed25519_is_valid_point(p) == 0) { printf("crypto_core_ed25519_from_uniform() 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"); @@ -399,6 +400,17 @@ main(void) assert(memcmp(sc3, sc, crypto_core_ed25519_SCALARBYTES) != 0); } + seed = (unsigned char *) sodium_malloc(randombytes_SEEDBYTES); + for (i = 0; i < 15; i++) { + randombytes_buf_deterministic(r, crypto_core_ed25519_UNIFORMBYTES, seed); + if (crypto_core_ed25519_from_uniform(p, r) != 0) { + printf("crypto_core_ed25519_from_uniform() failed\n"); + } + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + p, crypto_core_ed25519_BYTES); + printf("from_uniform_deterministic (%u): %s\n", i, hex); + sodium_increment(seed, randombytes_SEEDBYTES); + } crypto_core_ed25519_scalar_mul(sc, L_1, sc_8); sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, sc, crypto_core_ed25519_SCALARBYTES); @@ -506,6 +518,7 @@ main(void) sc, crypto_core_ed25519_SCALARBYTES); printf("h*2: %s\n", hex); + sodium_free(seed); sodium_free(hex); sodium_free(sc64); sodium_free(sc3); @@ -515,6 +528,7 @@ main(void) sodium_free(p2); sodium_free(p); sodium_free(r); + sodium_free(h); assert(crypto_core_ed25519_BYTES == crypto_core_ed25519_bytes()); assert(crypto_core_ed25519_SCALARBYTES == crypto_core_ed25519_scalarbytes()); @@ -522,6 +536,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/src/libsodium/test/default/core_ed25519.exp b/src/libsodium/test/default/core_ed25519.exp index 0fea10200..2865979bd 100644 --- a/src/libsodium/test/default/core_ed25519.exp +++ b/src/libsodium/test/default/core_ed25519.exp @@ -15,6 +15,21 @@ sub1: f67c79849de0253ba142949e1db6224b13121212121212121212121212121202 add2: b02e8581ce62f69922427c23f970f7e951525252525252525252525252525202 sub2: 3da570db4b001cbeb35a7b7fe588e72aaeadadadadadadadadadadadadadad0d mul: 4453ef38408c06677c1b810e4bf8b1991f01c88716fbfa2f075a518b77da400b +from_uniform_deterministic (0): b18e62cf804b022fec392b0e2d6539d0f059732616c11913f510f73ae2544ebc +from_uniform_deterministic (1): b9d23004e78c58e22da72e109550133e3d3bb9e46afcc066b82326319653d62c +from_uniform_deterministic (2): 14063782c8b8a677dce09c4e51719b1cf942bf71bc765c1ec9832a8b4446983c +from_uniform_deterministic (3): 02d6dbac70f6a14de72f4e17386016b08d6506336a086f10e719fbad8831d550 +from_uniform_deterministic (4): 11c851408e7892c2eae37584423a8f9c797e3649d45946b53e64319318a750b0 +from_uniform_deterministic (5): d4b9eaf70ffdc238c88725e294bdd02a6ce85577c5e7add7ca07041873019842 +from_uniform_deterministic (6): 740a6141079285c1b9e84ed463dcce5d3d40a167fa13129463eaf97d2a7bf654 +from_uniform_deterministic (7): e504a3e00bbf506cbe388784d85e85b10c428c37eba04ebd19a60948b71ad2cf +from_uniform_deterministic (8): 67cd50902c40c943f22c479c587fb3e5da2f8f1ad402049ac49ddc45ec20884c +from_uniform_deterministic (9): 658bffa23b425a91268ee17559073c4b1548209054ed7cf00ffe582696dda8dc +from_uniform_deterministic (10): b55b93e7a0fe554f86f1f4c991871a27756fee359a8c6bb7554ec91d5d552c49 +from_uniform_deterministic (11): fbc2bb45df1d806489a5a6415898c719c45c932d3467b6ce948ee80c0e8122c9 +from_uniform_deterministic (12): 93164e57b5e3ae6826ac9e0c31ddecf94e21a39a29ba9d1d24e9e588fe065d95 +from_uniform_deterministic (13): 16824d74c9482890dc57b0ec843a0a5231b581d2ce3909934d7658389f169093 +from_uniform_deterministic (14): 2f5b0336c7f0af520badeae99450f92835c27224ab4cd117f55b176afb6f0001 (L-1)*8: e5d3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010 8(L-1): e5d3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010 (L-1)^2: 0100000000000000000000000000000000000000000000000000000000000000 diff --git a/src/libsodium/test/default/kdf.c b/src/libsodium/test/default/kdf.c index f10f034e2..dc9a24759 100644 --- a/src/libsodium/test/default/kdf.c +++ b/src/libsodium/test/default/kdf.c @@ -15,7 +15,7 @@ tv_kdf(void) context = (char *) sodium_malloc(crypto_kdf_CONTEXTBYTES); master_key = (unsigned char *) sodium_malloc(crypto_kdf_KEYBYTES); - memcpy(context, "KDF test", sizeof "KDF test" -1U); + memcpy(context, "KDF test", sizeof "KDF test" - 1U); for (i = 0; i < crypto_kdf_KEYBYTES; i++) { master_key[i] = i; } diff --git a/src/libsodium/test/default/kdf_hkdf.c b/src/libsodium/test/default/kdf_hkdf.c new file mode 100644 index 000000000..c33627705 --- /dev/null +++ b/src/libsodium/test/default/kdf_hkdf.c @@ -0,0 +1,102 @@ + +#define TEST_NAME "kdf_hkdf" +#include "cmptest.h" + +static void +tv_kdf_hkdf(void) +{ + unsigned char *master_key; + size_t master_key_len = 66; + unsigned char *prk256; + size_t prk256_len = crypto_kdf_hkdf_sha256_KEYBYTES; + unsigned char *prk512; + size_t prk512_len = crypto_kdf_hkdf_sha512_KEYBYTES; + unsigned char *salt; + size_t salt_len = 77; + char *context; + size_t context_len = 88; + unsigned char *out; + size_t out_len = 99; + char hex[99 * 2 + 1]; + size_t i; + int ret; + + master_key = (unsigned char *) sodium_malloc(master_key_len); + prk256 = (unsigned char *) sodium_malloc(prk256_len); + prk512 = (unsigned char *) sodium_malloc(prk512_len); + salt = (unsigned char *) sodium_malloc(salt_len); + context = (char *) sodium_malloc(context_len); + out = (unsigned char *) sodium_malloc(out_len); + for (i = 0; i < master_key_len; i++) { + master_key[i] = i; + } + for (i = 0; i < salt_len; i++) { + salt[i] = (unsigned char) ~i; + } + for (i = 0; i < context_len; i++) { + context[i] = (unsigned char) (i + 111); + } + + printf("\nHKDF/SHA-256:\n"); + crypto_kdf_hkdf_sha256_keygen(prk256); + if (crypto_kdf_hkdf_sha256_extract(prk256, salt, salt_len, + master_key, master_key_len) != 0) { + printf("hkdf_sha256_extract() failed\n"); + } + printf("PRK: %s\n", sodium_bin2hex(hex, sizeof hex, prk256, prk256_len)); + + for (i = 0; i < out_len; i++) { + context[0] = i; + if (crypto_kdf_hkdf_sha256_expand(out, i, + context, context_len, prk256) != 0) { + printf("hkdf_sha256_expand() failed\n"); + } + printf("%s\n", sodium_bin2hex(hex, sizeof hex, out, i)); + } + + printf("\nHKDF/SHA-512:\n"); + crypto_kdf_hkdf_sha256_keygen(prk512); + if (crypto_kdf_hkdf_sha512_extract(prk512, salt, salt_len, + master_key, master_key_len) != 0) { + printf("hkdf_sha512_extract() failed\n"); + } + printf("PRK: %s\n", sodium_bin2hex(hex, sizeof hex, prk512, prk512_len)); + + for (i = 0; i < out_len; i++) { + context[0] = i; + if (crypto_kdf_hkdf_sha512_expand(out, i, + context, context_len, prk512) != 0) { + printf("hkdf_sha512_expand() failed\n"); + } + printf("%s\n", sodium_bin2hex(hex, sizeof hex, out, i)); + } + + sodium_free(out); + sodium_free(context); + sodium_free(salt); + sodium_free(master_key); + sodium_free(prk512); + sodium_free(prk256); + + assert(crypto_kdf_hkdf_sha512_bytes_min() == crypto_kdf_hkdf_sha512_BYTES_MIN); + assert(crypto_kdf_hkdf_sha512_bytes_max() == crypto_kdf_hkdf_sha512_BYTES_MAX); + assert(crypto_kdf_hkdf_sha512_keybytes() == crypto_kdf_hkdf_sha512_KEYBYTES); + assert(crypto_kdf_hkdf_sha512_statebytes() >= sizeof (crypto_kdf_hkdf_sha512_state)); + + assert(crypto_kdf_hkdf_sha256_bytes_min() == crypto_kdf_hkdf_sha256_BYTES_MIN); + assert(crypto_kdf_hkdf_sha256_bytes_max() == crypto_kdf_hkdf_sha256_BYTES_MAX); + assert(crypto_kdf_hkdf_sha256_keybytes() == crypto_kdf_hkdf_sha256_KEYBYTES); + assert(crypto_kdf_hkdf_sha256_statebytes() >= sizeof (crypto_kdf_hkdf_sha256_state)); + + assert(crypto_kdf_hkdf_sha256_KEYBYTES < crypto_kdf_hkdf_sha512_KEYBYTES); + + printf("tv_kdf_hkdf: ok\n"); +} + +int +main(void) +{ + tv_kdf_hkdf(); + + return 0; +} diff --git a/src/libsodium/test/default/kdf_hkdf.exp b/src/libsodium/test/default/kdf_hkdf.exp new file mode 100644 index 000000000..57bd5713c --- /dev/null +++ b/src/libsodium/test/default/kdf_hkdf.exp @@ -0,0 +1,205 @@ + +HKDF/SHA-256: +PRK: 8c3725c0ea8e14106d8c342887ccd1218cc205acecd8095ae1efc099ec195e7e + +92 +2ebf +e29531 +8e563a1b +1fa58d77ee +50f1a4e15ba2 +4fb3724b7d4174 +d10853ceb46b11db +0fdf31228221242833 +98acb29e0993ec45f8cc +f4481a5e6d263d7bdc59ed +e620eb399337a9aace16765c +dbe8924351577475584731979f +371a112305dfd4264feb29c28a2f +d0a4b022f748c96141ec6b4aac6dcb +d2b38fe15e0f95bcff87822ff4df3d90 +e4bf8fde7d77899a5f85d68b039ee7119b +6766b092971ec2e616286925708c7ed6c9e9 +c4f9d36cddfe89b3194282a084881e6c429099 +49be5bc10c278f39b5be391a55e765560deca0ad +6e7d3031d08c5658a19a7d647dad0250418435febc +07cb6356aa7f978cbab87e7814fa90af9ce729aa2b3f +2ea1c08eb04c75806f80ccf0fca683a8998bb663e99993 +bb111699f6c32263474dc5569a6950c767e3b8201f838345 +e81e9086d3e035cc1a288fa521ce8b43b7f93d3d9bbac5085b +29c398bfafa672bc315e192110575691607118759f9e7669f3c5 +60840e8bc6d86733752787232a0321257c82d691722bfba07af839 +b0ec22e547dae3f04fc6ef146203604f0d604a8ce8a20fce229a688f +81ae6add3344b25d14115a38bc10553a75ce0a4be3aa8f3579299227f7 +242c65f95ee0bce1c5e1b01b1ff68e8634fac096edb18997dfd3baf3817d +14b5afe2cc0d8fe10e5359667b2b310365fba93d62f7fd3df2dddfc34c1de5 +24a79d4c0c69e0a524ca91f356e64ab40345973ba82ce68992dbdd16bf161cbe +3edbfc22f9a1e3a5c774cfec8fff3cc4febdfc61d98aecedf6a16eca0546316b56 +b8bad2b04b9b382f9ad2559afc33b8dece4a7fe9b8ac9d74557dfc51ed8949b78ee8 +1d01316d7767f068171f08a8c2f05d2cd571f623fd5fc9916b3476115aac9d7f635cb4 +a7c5763a3b678ee2fa05a57dab377b67e448a38f94531ce83bab9eff8035e105e8889b91 +ab6721825aefb2cb9f9d0ce5123882573abebe94404e0e3a923a7aac84efc084f84ee5b2ed +4815da740c872a9816850c8757be64cb3096dca7994f3af7bd8c10e83a2d3bbb14b40da93d40 +abb141fbb64faec34c09e9c784b1e8aba15b6e916f70996ad803b963d2de676669ebff3ed4b711 +231a7a47a81c21dd6a0969c67b6ff446a73a145fb1d4f0a2d268af8fd56ac6d67b6ef55d13194440 +74e40130ca102c22acc109cc6b8b66d840b984fe729c156edd05eb4f44d1869e6ae6260b41931179ff +3817d2cf7b7c7c7bfe4ab51e9178343f31fa8eea20899ec96d21eebdbf55f44327e7dc23cf669e215c02 +d5ab755f5631d08b70718d2ba3e2775fbc3cdfe69b7ac74afcc73ffbd7b91b9d3a7fef364cda9816c8c367 +93c15afc2cf1baec84b8e3c89f50a3e4cc3a2c1b72aeaa894a45bf09f22aac0711994f0873ac69b099e47d02 +7b359dd2abb995a8bb0d1a01a986bfcf28d47b9215f000b240f5080dc78a84cc65e34ff098074ae237a0238b6f +182ec78776f5ba3818c2ccc7b84aa7bb1a54386134b3215e8f8f709757f3c8e4f9bef3800e3a9eda8b9794e95f8a +0cf1874215b38ab1900ce7137d9b8817fbe99d3196eab5b845971a46a38c479d81fc8033a641533e2c39dd550e672a +3f5a283ca862e6a5f79c5ab39f8d4984b54a86e132d40adcca249f6419caf5b61fbbf61d54d80e78af3e613adfea5f9e +ce6bceffd4ae50e8465c3d5179c661da2f18dcb37f95f9cc66808d2f848b55dd0c1d2201bb37a2e339e9385233e687a711 +7ce3f4575d3edab2f989b0a975b279ac21af117184130911dba4e7c70e19f96b5595ec8910e737c019f3392390f8b9af6439 +9c1b37296ed2ad9b556938d30814c47f822807be8cf9bfb26a05651061015493d4ed551f8a6f1a5cef7df88dd7426f03681935 +0d1f6f49c38c4d6fbc57103193b544ec1a73f40ed8aaac53da2b1a28a4a35838036ec9d50d719af22f3f89ebb7f340f50ce8c180 +fe6786d7d7728a1ed057c329f68cf698b163ae1e6c1b48290e6ba2c325740155f0f90f216111f3bc16d61b8338d910d429241899c4 +c729c63757fa5a421704ba88f8c13f23606e59cb1e7d2396a130742c31b98dc9461cc1fa9d8d24f79f7303dd416bf66adbb08562f832 +44cf07d63adc85de7c0aa524962c29dfad1b37b253fc9559fd1f5b8237d8bd6e6449e5f3997d6b0571ae50da1e164be845523c8630b1df +c1040513a53f652e0ba7bc30f84deaaec13a15919855dd76148ae1fc86cd147ba686ff0ee025f9a00cbf7b6e190c7b87ea458974cf147ae3 +0a67afc69f00ddbdd6794ed7b06285c00d70fd86fb8b959bd8c686e96c72032f2726c4f0fb607a7f4d4f66b410eff17354b6db803c9c910a72 +faad9414932446902309147f8f2c1d2d48c95a7ddb8856219aa36ed30f971e160542ed8272ef9bdf72551cd059ca6c81ea76b5a3b49cbfb07738 +14ee2fc3899650164beb828a557afc7253e4b89cba8a1908d3641d47eb23d50ef34a0dafaa1388328fc33b1db37f2f74db6934d398bacbec785f03 +2333128e004f61ba45c524dbf72a9973fdcc288d76236402f63b0f4a39867b18e73135f35945f1791ae537b215c69941194258103419558c0a477fa9 +70f1a4c027d950573c5ea8f9b34069d1b85ac0b6daabc9de5c4cd1844d6781c0b15ca7b01c2a33dd06272e7c8729b74ea71a0f35486252461a3d83bc62 +8b9199ebc5ae61365d6cc78c9d1b1a466565639c50c317cddcdc13db96b4f6ec612bbc1c6e5d2479147040f313a168e4471b9093f47548899265d8472aab +5f420864258d597766beb7c55ef0dc9c85aab5e296677e1fd9201a8c8a0c7b74b573276b0ce11f797a5816e5ed7ea3a02ca5c338f78c0c6a41322e0cdbb5d6 +13029325fb0fbbe2221caaa6c3797a967335c4a857fafe23b4fb221433afc84da6876cbd74ac631d18f2478aae8def5a85a227b3bb496a81e9d29171a5b501fc +44ef825de340dbcb1b2ce9325eb78650d574d1c9fc13ed3b4517ee3f2f95bd97c8ab62988455a1639d0e4b2e404d661c3881dbdb52d86b7bd5593713b10e8d1086 +2c67d0e2fbdb55cf649c97e1053c717636c526ee4f58f86e9671a1086e5ef6ef7ae109eca2cd482affb1add956aad7225debca3420c4cae6cf590e8e8c1a0398a9cd +6900b97c5783d5856e4eda7816e27326cb71f8c9cda3bfdc88c4a5aa49b580aa4341cd100fd3084b447a24c9d521c8ddb7a55af52c998c4a9b53bae6c86caa02424df6 +c63f43dd3d29e0e92fc2adf18a50e33f11dbe9746f16bfc518397e0df3bd4eff491963cd2a0d25022c535a425fe3cfcea4ffd7dfbe98e2ae9fb40a007012acc31460ef25 +dd61268207f4452ce4a1f212aa4f4ffff1d0cd4df9ac1730b0f4acc07f75e86afb02c0d99aeb512bf3bb138183364a4b800af446b403add2b30d73eca024fb5e3eeebf10dc +4eb2c6dc6159bb82eba32aa839bc4b3d46be87cd358f47aeb7b488d91230414a40fe35a2c0bcde81de243b6974c49ac0af113904a8995928931e867f5b7d131c2c9caf4adde5 +22cef8bbb9f6874c1be53adc6687e3b28d0b9b8574d22212e4d60074585d17751fdcb80a1ed6143a7471fd3b1a0dddbce5b8b1ae859441413d99b069252f39c3a0b7eafc65ab34 +6f0a07f43c6d00649b516cc986fce770aed949875a17164beed5305ceaf74131574eb2cf489dc13fad53e2b10cb757b69eecb481a76a8d99a7cfb2e0aee40dde6f7d44c2be5a5e63 +bf701b835481d47ee85d390caa8f63bd3e7dfa48f4307d51989b4660e465de31329589bd5e3293f75b63d320b8f53211cf1209e426869c3c3b506dde3f819cae07672af9ef74f36de6 +92cc25c67b65fc9c57381457e7752441782dc4d2d62828c13992a7c2eda57811fe7c2de66b725e08f361fee4d8370d3dff2cdba6c603cd03ae54d813e44793387ded1add2c006b320058 +e3ec7f8ccf313fac832d3ef5c3b8b10f1faf5ae8ec32bce0f5f98b9f4464624a58b0f74ffdb827d52d94fa77a8456ca550017f3c31d8e8e6827b6a9ac9664355bc57e9b46cc66b6e396a50 +636ffbeb1cb2e834ae37213247ca8e615fc52f00e79c13f37874edc549f4b629901312b685f3e1ae3394a6beebc5e0c1364c562b3579f34cbbe9ed80c5cc045b9ab7a749950d005e785832e0 +3ae686a5e1abf936d472963d6272226f920c8df4eed5c4b26d9afc910f509c205ffb56a0289fb62d38790dca4f85028f76b4339e9eee32c1c2690abd02c74ef9a7cc822f901ae596ef1b2f2f42 +e542066a18aed627ea3feea7a962b9c69a9a2f00bc0f22c7186c389701283807801d2cd79d678010d91379cfc6d72cf30830a34fd9983a0c011e775be61eb0d093a1432493abb703c8b5bf99ad63 +1392b4676365c1ee01f75811cabe0fa989faa6a222b65e72bf4016f7767c0e9f822de2ad0034098dd9867a787abe9b97adb1a345e96b345aea898682d71fc3febc0e2ef579874da073285d0ba4edc4 +2ddd472dd4090528036d7bf01cacfca7c71ce3d89bab2299b3d6f1b987c51e5f884cfed55ca25008811fa4f44d9bb8563d83cfeccc580865978972cec981f431e4b74857e2a565e5d6e0bc9f0a3c45ec +d2a855d0e2a912ce3ff5ffa99c464c215d9ae1195e92b022d4518dde9fa5ecbdbac4f1877c1a94df35421a122a04073dbe7fce959c87497cb30774bac3441140089b4b714e025509fa3cd41d683ab46edf +00bcf365897640b9268fad068977a11b7eb3006482b51c97543ba4359db31adcd18497d174844c9ec47a0f6132b16d14aa5a02c42583aabd033e520a8a9c5c430cc6708e8b9cdd4fd56c1023a744af67fd14 +0e20beb1a84e9c252b54c4db895324e85436f29e4855cdfa5bf4bbe7868bdbc51b7f0ac428ce54750e2cd16829051e95cd97f2f40c5a1a3db17f90b68570a05ac55a9eaa7c8bf377c7a752666de779ef46764f +20ddf3ccd89c8bf4c084324858c0f0c7d4dcfd4a76a7526183a5bf4344f62320f29e7c0650d3c55ad587128e667d5d4e69689850fa741b49d3ceef45b134327ac89186248d1157aa4b16263731138777811e508b +2a8fadda7001128cf59e3fcc93dc5c98e75ac92d66d536330eb90a558920e4416c210658b3bf44a451db23c62caac1a79fad1437a81d66ab98e4423d8a1ce9ed9a0586a160c4819a019a93781775c6510c6ed09cb9 +9049524d223052ee507450e65112e1f4331c4d7fd71e8237b8f79feb2fa30504c856d6907cc4eb814694e9a7b8a8b10d85f956df72062c5f4752dc42d37f164eae1a3155a11ecb413f92a0e49e0a89d398c21d76e100 +86a92236b4e0dc16e0a17e92825e31b66a417784b7f6c0a53c274ca5100847a929c0a30430ff67e6c8913a41c3437d8313fd11b2c0eebc75e5bdffeb95a4d100c7eb36216494f3c7a8f19403080941e3d1c9e319ede000 +4b15b094db5789ff78fafabdd0f0aa06d3f4ded903c89e8ae22982d152017295de63ad0b43d3d303243de1bbf2637e8e0c042024e307739ab3b02a5b7d299167909edd51f82229c0093a68768d56c2e774285ed95bdc24d9 +9bbca463a5142ea7dad0522f073eabc7eed63e4baea13efec9d7c198b75a9c4db88623c406edc5bf61ec61e047357358541aa66e44a364b779b6a8842c1b1e8131c594ac8298755ba532937b5bdbcbbd1f2c2152d03af55120 +edc5fe50b3f3a7de5ddc14b467e41ec0ce68a44f734c4cd46b5ee1d98337d8a917cf1dd13e09946d22918eaf31f83de1e035209a6f2de32bb7caf119d0db73e4075cb9a714adb84b4d0a6163aac56bb4299a71e8979a97e363f4 +e2770541945a0395fbf597fb58cc4e6f6a2883b707aa79df9c2da5a7165a8838b1e7f4736b5418bd2f99d3eb8020f9b4cb7ff3a620f8bef276f22f3e98ffe20adeac2f62a9e5758136d222a9c562f81f151d3980bdad54f52dbf55 +248474ddc86ce5e07be50fdd3a6a113ab7f2319e3fb86f1d2d361372fa1d89926ef501c5a62b9d2efeb409d0be8fb67f12c1624d04bcf9d555dad09dffdba76948b0eecba430110ab9e738db70e51c4e2f27350a49aecf1282410ab8 +37d75ee27cc14c95c9d930bb1324d8aa6cc77ba833504253d91002fb622d9e578a3f3b1439dad7d9d7af8ea17cebee86fe13c59f316434d46208c019c2e673168b5aaa397525cbce3a0b2f1c59c853600711e719218311e15d1ab9a0cf +981461afd5756cc5d6a953c188b0a537fbcd18b41034cc4f40870cc2c97bcc48e3e4d563c2ee1d60d8c9f714996fc32e2977aaf7c3544e437f40f61d7281548efc22d7c298853304444c4184605b7b55148c24e88f362e41a8c919bf0288 +d65ac485824f9490c5f70fe674fe1da39b4583b25f3580b636a06135761eb0fb5e36a59dcb070dd9bfd5b2d69503a5c3ef295eb9cb3a9346578556d56fdd0c81cbdd960d292f8410681643af154b2550e2d586119b82cb17a79c1447cb26f6 +cdd5bd495ed8c2c41dc511577051ffa30ee02eddb95b3650337e8aeae161d2b81a9ebc1514524c52dbe2c4d0739706dbdcea1a7ba21d9cab36ca10f753fc82b218c01094e288bbcd96d6678e06e1a03f55c3bc6aea67b9637e87a4ce8e2aa0e8 +1d07389dad745981eb7ae03162bf249996cb836316872a4de4241d1fea49044541b9ababc2a10f7d5455ad3c0519997698a52039fd5517c53f7963aea8917e1b8ce3c63c5a2b23331cc473c1ff0986b08e8dd1257847256ded17e6d0409855f8e5 +a1245e0117a0e7c3cfbcd3d3eeb21a5aa7f2a73aea4465f4d83c8d0c6237c5c093ada99ada6ad75dcf18d1eb58982c7316d5c366ce5128a832d433c960e6bf7be42e4dce2747e3cc78101ed44aebcdbbf6bcd42f5160ca40784ea3ee3dd6be537475 + +HKDF/SHA-512: +PRK: 2502bc897dc1b23f9f2d8c35d519c5280ea960bf9154ebb07d377a12a81a4794ea8bdc0cb6ec59ab3303f5cbd713027825715f8af2ac0203e560fd2e55f4ff2b + +4c +abec +6d7647 +a3397e73 +15b3f69cec +fb5c266f8785 +7147d8a6bff246 +1dd7f9b2ab2583ab +725aee4e2d8d7f1f90 +046f63a1e2d606d7893e +fc2026603b032dc6c862de +03127d298ea441e3ae1d3781 +a8f163b5b9476eb50dcb304bc2 +9430c3aa31857951320feaa65e4e +14e4918f7b7eaa9c6d39dc08e9abc1 +3480c9854b8f0bb4a97920338dce7573 +42714ad1af787467b0388cb6663864ba89 +700cd7f28075fc3a28d98672207b45df5b20 +528c93053c63c5fa5ff1f0a6e7cde8d4aec5a8 +d225940fcd325eecf827666ebcb9ea3881dbfc3f +0341475a114b87cdae767a4a68432889145748b0aa +bbbf499a74a2c22dc4a2295bc904fdcd7d4e91b32060 +deb06fe0b094b65da9febfed81f990ae77fd3f458a1bf3 +f64b7ac1473232a727ff461af2f650cc8a8419d7c97b7298 +3ca9c302e1096302185e2288beb6d91124c6abc9f9f97d5a4f +81dfa7213143feb429dae2c641d25bf913aca03feead6ab7df10 +5d428190aad0539c0c2e6037e7745218dbf4e5c5aa0102996ceead +7e76c9dcd614d730eaab145be60584c7bbe925bddc64d9dccde16142 +4b2be1c3dd5cd41d53ead2ce0aa220823ec4f3cf8656b14449e50cb48b +4ceb80935422dba37af63ba59a460204dcd6639741d478185fd1a1e48de6 +633e555556c5288d808b2483d7e99bcc9876b42b61cbcc4d3e9ed42bcaee33 +0d28411da5a660b2eb063af0ed7e031c463a64eddd6c48882add6fad4cc9da92 +30b734f5768d26c4f8d641037b3e425c3d75c5c0c97cf8a3e684d1d2f1ba4f37b6 +970db4152321c2bac15898927aa25db90246c494017765b01ff21ae9a6aef7b89b88 +f168959f62696ea32a46ee67cdd3375684533f799e346fd1d26ad29aecd51de7c2c473 +76a81fa4b90ee1d1b05986c837f10f098cf1ac8f7d6be8097caec980b125185e8f9ee56d +ed95ff4a9919f45c08151fb7f610f5155dac10c92e84bebf2a6bf0fc653585158c19ef59fe +16ff87fb87760dfbaa53a2820c9ef365ee3b539b4a7fd1a4e626d313f24db495319f98c247d3 +f514b605b74bb3a35b86f8c96fb08e751d916b3ecd8b5e84b364e57f1fb6e5928a3a46f4cf7b1a +ecef871f30ca56fbd6b242b9d095a33b9d60472da4914af80dbb8672a84d8ba4640ff1b459cb9b1d +9220ed520c628b7e7e249c334573ff2402d573e34b27c25c4ba22e2b472ccdd2ef4d060eeef5387dc6 +b431fd9eaba69bc20967d1d02014913637df29c855faa6e93a8571ea3c27ad2c542700c77f9f3d19e5bb +7ebd91db579ec5879f81a922c58ee82a91b8cb648294f63b97f728a53411438f54157cb6459ae762b5ef3f +c28a1322e46a89f7a2b6b3dd6d39cbcaa84368bca33a53c04bb7bc90c3f51065143d8e93a279a403aea8ca8a +089ca5fb6e4de86c77cac49f92c8d3356697a1fa51c8e4a207ec44428c4da0b82aadad5f196510d0ae7abc25ab +31b08873dafc0d8c11afacb5efd3fcabbb7cc5ff7aab6e1d40a7451ec715de4a4a6e7e15f9d1f9f832a0e1bc39d7 +984f57235036e6d44777a7bf41fa4333f3077d3f2d92b46bc36c29b123de8580d81e22b2969d9a5abf3bb5fb7b422d +2730edbf85f4e35152af0f22fbc4f23f7968cb430fde9685cf4e1bb64611ba6459acedad777fe1a6d70c88733d83661f +0eb2a97a6d6a5901535399caa5ccb7192e1f1488f9a06d3150ccafe1eeaa8d6e50e039a9344f68d1783973fcb34719c2fa +24d7e154d4b7382daa4d1fb47a8badf0d1020e97f75efe74f302b983584e26bc1865d44c3761b65c4d745766da0bfce5682a +cb7503ad874932bfc2c7b18176d3e03f3e66666613e3e8e2ac83a29965b56afb0aa74d1080ac2ffeb1c43ee160c9f120cc4c61 +0ad5086f6cf363dfbf14c13e82faf14dde185b7142bd0ae44da8692339ed31f47f10773578af23cd7a632352087d07a7f4133474 +72873f68ad5874e1146a70e96c98360ccf0e5e9a5e31e4e38c7829241a531b0712eee8f22729e244da3d94d92703d975e54d84c36c +b05200d914edd05309a7aaafcde50cfbc201d988387d2b7fb7b7315b56d58ecaebc2f7c7b5d2607d041dfd3486e849cf2535c8ef76f4 +6324ea52a00274312457f451953302d02e3e9107aed0a4007c04d26f4b5ce37f31fbc5a2606575a464f64b507691646e2d773c62aac387 +e0c68ed5571a90bc8db36c948b5ffd9179cd80218ae47b86cc7bf4aa4adccc438ddf670ea817d324ca709b612522d510913eb64012462acb +61d3ec6537c084df5981a79545847cbf204c3a267080e2cba06a29b4fa591bc43668f701cc0d9e33e123b774b066e212fd1989d253120bfdf6 +7b74db37484227d237eb7d4039ddade342827d0075322c14de32985d616ffe38c4786e2e0df89de856051796e1f922b6b47578c3428fade6b372 +feea8d891c65fb37dc20095946b9f5db5aa936a2331fc9609ea45ee146107bf561710edceef2cea29e7c25032cb6764bc361eac0c148553e62ca5d +a95341f8f7536d95f14181e4aa01c540a345bd172b67279f5b6dfebe2c8fb7b366edb8ad7e4545eed29903eeb6f486fa9f9d825185a0333eeddd2b45 +5b7fd7b9d6623c25d508712d585fd541089c8b4721b9dc219baa9cfe14022b5ffb0ded9a546ddf183c543d1f26f9c4183f4c7ff012d61de8cb822bccb4 +fa0fc08f49144cf85dcefd25717f37de8469a943fdeaa8c764bbf483af7a37b0dcf1f50451b20e693635e94976c44ead0ef83ac632eec781e9d50efb2f9d +6ec1e621af3a878ad836aeb322e67752de29a310d7e6fbe6d164bb79e8f939d7a8f9f77a72733482d323c50ae7dc2170b90a48c59da782865eb7a9e254aba3 +10d13645bc853dcac6b71dadf4327ea0c7497822a6e0691d93a5e9d32cbafb883f9ff0c245126e391666fed31747e92c81ab886d5e75bb057faac5b3b0f1afa8 +dfb3872da01656cddd9abcb389e75a4a01d89d0d49f571e77655ad1ae0c14c87d4146accaf59f3e402767e6666228ef8e52aa32cd18306f69666769159423d8141 +d3a86236f119fa35c480d5b4b71d3aec93e226db5d2173c04e5d1d88c696594f51ec36470487fb72044a039cc081607be2a99e5d8f1c653848176f97cd2e9d50a742 +0d1f5a47c4917f6158b039e68fdeda5fa3889bbac6dff571f6353f83ada55c26bb99dac4416b2dea7d0fec2b585877aed2709f2b25516551004fee20b68e21efded761 +79a910c7f74b303d5844b609148a5a723e31c6b00d16a773547fb6d97fd35bf4a452eefd7ac3466ea520d61be4b75493156c9ae39ce6698e7120e92ebb366adeafb21d09 +a893878e100dc628ec674c4b48556c067419a3c317be94ed37cfd8ed8cae2ff035985579238f4dc13576677d527f21cde829a54466a911ab81888016c2094fda50e6dab622 +6faefe6e6bad59fab2a801aefd26d05ea3ac3ce546b0abfff524ec2ea80f3cc5c8c7015d18ae766cc84a2de75bc4c8a44cafb3743c6147e934d5de803d74ff8ca507d505065b +ef32b102fb18681c02cee796ba8bb602d927d3428c4387150a5c342532380d3234d69e58a607396af5802cfeece1554de5722931f4e09fe51ae4b74dcd7e851e9a95cf4218f96e +efe653c021ff38cabba1a76f8df2b0737ccffe6dba0506074143c88f6547afb06bcf1a36ba8e48bad9e7ee76c70717e089e1c31f052ee8859f65d6cc0d4bdccf845c8a8955d316bb +8bf54ff6ef8b0f73a569d908ef432227d7fff0e1300503c1d41f3b2618b089ba76873cc5abd22039f3bffd2bb88b4a169e1f55b8280ba8b474aee9a19a93710cdc05a51062ea5970a2 +126a003e4194b577fbf4070e8ecd47f3807afc7d9e733760a23b350649e924ebe702eaefedb70490b77fc8dbccd068baab02bcd64517aee6005d37a496f8dd92093ec34f5ec6af703836 +3b025057a1a889389b105956cffae970b21e3a1179382bb626856c793727ba9ca14706741b94b4704ce0089a378c1efadb7961fbbfd146d657b6ee605231d9ffc60eadcc6af32c43ec7e75 +0c2eadac7883bb59c278aa115b10b8d1459066b9e0061b7e4e2e1ec4caca02c6fc443e5f78c80779360f260507bc2d49beae6bf7470da5c8dca5ee51d251ed1db892db23a43c62fe088d07fc +2f40a09aea1a9b7c32e7b68845de40452c9b753c31c46118d14d3b34c8c7f3eae0f3c0018300ce4d583715debeb9bac31de392080fe2630225a0f0e0d4c5b6e19ff1fa5bf5a0cb8840fed794fc +155e5eef1e32ec06bd7a51741fbeafcbd82bddbb18fc34a984e9018f4b62d1b7ed4fc0b0d7843d4e8983ccdba6bb30d28f964994650e692a5b0b746171563be70a0c622f6a022ac4c655f216bb68 +142e1d62a31895b3a916453a0c01ca2a096d9b0747b3a2c9584822819cbffdab6c6461d4e4374e4d9363f8cc52861e2be1f4ad4edbdf4a72f1fc3667903df83a32a8810398e156ea8dd3385d416e9a +08a01d87455bfb057d64a6374f8da7ae52f4575af5085e7aa3c390de0fe528c14767525b9af87e7e5ef053bf03b2390c98f7eef36161ae1c0d9eba83c4a78d9ae5d4322cbd0b3f7aaed183f18616e49d +1c8ccae6d387f360c2fca138f1c65410918ca0cb47c15cbdee931ed03cbcec6e871f11f2692a9b9136f82b274a338805e863f87c5c0f99604c03484b1a2020732e5473bec84ced8ba05cd9490e75563628 +ac3916dc874442f05ca2409bd5c63957bca4c5363dda23846a5901010818c57874aff1787bd7c554c95aae8e354ec55beb1b79966bae64197d4383c894485c8a509064957abe7f3fa4154dc0f0e958121fcc +f0b7a82a962c7faa238acb98ebe4b904e8d5998e1856dbf68aea0933dfb3d80a44f0eaad678dacf31ee5c985fe6f9844f9490319745e89bf790d3e0cf2a788a177de8401119ebc9f7e48f58c279ef723fda7cc +6d87c3942bc4ebbc224fac383f1b22af13a4ccdfae5ee66ab8f954ebbb874f583ef07152872ce03de5c3584574b91d91d2f6fc4b14625e3e2bdfd04fc7b9441d73f9c09411f08938429c9f12e31caea17e094d9d +2e0d7c7f1c03ce9d4479fa800645abda4aade87bca0bbe547e889f8d32af7530d212171baae32831ecbd84cc27bb3da8496982a183e2785a0731220677341bcf75ae345ddb8bcdb7dccd2c4e1094d33ca53b0768cf +9bec3f01c35ba5436e44b01a96077f41aa61516dff5cef6185818e7f57d2dd0b9d9ebfeb35a0cff1ae8d98975a0cdcf2b626dd7b1f8fa2534ffc058abc1b81e1c68aaeaf8e9b255c3eabe1d675399220d4b6d967fc5f +b0d54ba8f86b01d511acb7ddb567198dabe835512d0033991a221b2bdf815d8063d073d1bbf5704f954df8f73a4ecec48417c2fec643f9e15d1d41b51f955f2422a69a2a8f73b6154881e6f6721f8e73a80efa5bfb1717 +cd41ad000e15e9b261e52b459bf79c7f7ffeb281629fba3c986c08b90a058abf76799dc72e430a1df8b64641cc2e03339ebb37fe7eabced490f77b58b3dcf492f981687036dcb94328cd9ad9f4e489de5d06bbd3671a9bf1 +21233d332c3fa9b056520c06fe55aa388773ee12ae893395df1d75c4932b54a5d679637d33930f2f8afa22be2fb4b1fd36a6c83b51057611c8119bd8cdb1efd8ee7063d5f13c09d2f8e5f8888eda3ece738e34f667aee451b9 +86418350d07d8f9d8b7e1190eb13634dc0a59f267730afe9409cecab0ac4f57feacaee8dec7321b8512991d51d4fe3b7cc2cbb5e6728ba115f022087606d15b39810032b3945e052574c7464c2b2434b2a54a801991d093f9390 +5501bfd8c7b1784515a192c0db6516b1fda893702ed45db7a5c07b32b3d9d41f396f9ed61cc4f9a143d4b4ab16c9f6975ee0a8851c62f80ddd4fdfef6c9f6f27c130a13109cd20779e4bab78200129900ecedae564c790153d2227 +7d45d142bdeff8e1b941537dab8685697988e60cd0ca0926dacc9a227de9f33e0dca5c7c17bcb3f3d3a1f39c4999313786933cb931c725b6359a1b10e31b77cd30f28e3bd4ebe898ef0ae1ee5e3a28a911fdc3759d04929c74321a9d +36f11d276af5958a737c5f457ae997455025cde0503ecf1431ea68b6567530cf3abeee2391c1c549fd3bb274120b0613828839ae74b6a071ee9d29b6247ca6a8a1cd2195d24c6215f58be04e197b541828b99e3a71d0991be8245303ad +efe64e5b4341239a2e60d342b89a302c2b8cbd45a33a5301936a051f69dd1644164bf7e24d269d341285a2c22aaa93517b1e9ae6a3d6b18961d4b1f58b357a113a12e9c6519ce7533f602b026dbd885c0584f21e099e74516d5db197dec0 +e5d90cf622738f73973fc448b7be40b044fac3dfc65d36db47f3fa9d01d41fb9808ad83e51729c0c2c35cc08226fbcd20a988ea24bb8373991e702c911d1764b309eda4d1500592ce0fee42fe111e9f9e346734b9e2758194ff9f0713613d1 +1444dfb0694d36937eb77a0b1f04c2e29e9904d1dcf03cf8d420315c5cb38463f8f3327df5cd34485b0e6db3eefedcd9015f4953a99c125f3ee803c4727c10e0ca943408d82a0c6c1b797a7a3a9e6446df53b8de29894309e81d09a321564b40 +171e9fb9e3867ac3ae4cbe09884cccb7561c2c0773ea8200c492ac338512f2017bc843b1ae5fb998c7d1f155b01b707f70dcbf68dab56d74a561b5fe7759788b5651a9ab0fe7006d0c096cacbc9ba93736bda0b967b7f1ebfb4c7a032e73f40392 +db14a6d9c6311aadd73d9fb5b38b654bf306e0ea3880d22a12032971115d22dc38f9bf03ac83a177a0e36be7f710d4a903934601d15911942f11364692d77958be02be75eb6c697e3d963f6ca2c26449272bd05cd3ec41b884a6a97381f57f19d70c +tv_kdf_hkdf: ok diff --git a/src/libsodium/test/default/misuse.c b/src/libsodium/test/default/misuse.c index 407d526f5..93a6b0ebc 100644 --- a/src/libsodium/test/default/misuse.c +++ b/src/libsodium/test/default/misuse.c @@ -4,12 +4,15 @@ #ifdef HAVE_CATCHABLE_ABRT # include +#ifndef _WIN32 +# include +#endif static void sigabrt_handler_15(int sig) { (void) sig; - exit(0); + _exit(0); } # ifndef SODIUM_LIBRARY_MINIMAL @@ -21,7 +24,7 @@ sigabrt_handler_14(int sig) assert(crypto_box_curve25519xchacha20poly1305_easy (guard_page, guard_page, crypto_stream_xchacha20_MESSAGEBYTES_MAX - 1, guard_page, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -32,7 +35,7 @@ sigabrt_handler_13(int sig) assert(crypto_box_curve25519xchacha20poly1305_easy_afternm (guard_page, guard_page, crypto_stream_xchacha20_MESSAGEBYTES_MAX - 1, guard_page, guard_page) == -1); - exit(1); + _exit(1); } # endif @@ -47,7 +50,7 @@ sigabrt_handler_12(int sig) # endif assert(crypto_pwhash_str_alg((char *) guard_page, "", 0U, 1U, 1U, -1) == -1); - exit(1); + _exit(1); } static void @@ -58,7 +61,7 @@ sigabrt_handler_11(int sig) assert(crypto_box_easy(guard_page, guard_page, crypto_stream_xsalsa20_MESSAGEBYTES_MAX, guard_page, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -69,7 +72,7 @@ sigabrt_handler_10(int sig) assert(crypto_box_easy_afternm(guard_page, guard_page, crypto_stream_xsalsa20_MESSAGEBYTES_MAX, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -79,7 +82,7 @@ sigabrt_handler_9(int sig) signal(SIGABRT, sigabrt_handler_10); assert(sodium_base642bin(guard_page, 1, (const char *) guard_page, 1, NULL, NULL, NULL, -1) == -1); - exit(1); + _exit(1); } static void @@ -89,7 +92,7 @@ sigabrt_handler_8(int sig) signal(SIGABRT, sigabrt_handler_9); assert(sodium_bin2base64((char *) guard_page, 1, guard_page, 1, sodium_base64_VARIANT_ORIGINAL) == NULL); - exit(1); + _exit(1); } static void @@ -99,7 +102,7 @@ sigabrt_handler_7(int sig) signal(SIGABRT, sigabrt_handler_8); assert(sodium_bin2base64((char *) guard_page, 1, guard_page, 1, -1) == NULL); - exit(1); + _exit(1); } static void @@ -108,7 +111,7 @@ sigabrt_handler_6(int sig) (void) sig; signal(SIGABRT, sigabrt_handler_7); assert(sodium_pad(NULL, guard_page, SIZE_MAX, 16, 1) == -1); - exit(1); + _exit(1); } static void @@ -119,7 +122,7 @@ sigabrt_handler_5(int sig) assert(crypto_aead_xchacha20poly1305_ietf_encrypt(guard_page, NULL, NULL, UINT64_MAX, NULL, 0, NULL, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -130,7 +133,7 @@ sigabrt_handler_4(int sig) assert(crypto_aead_chacha20poly1305_ietf_encrypt(guard_page, NULL, NULL, UINT64_MAX, NULL, 0, NULL, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -141,7 +144,7 @@ sigabrt_handler_3(int sig) assert(crypto_aead_chacha20poly1305_encrypt(guard_page, NULL, NULL, UINT64_MAX, NULL, 0, NULL, guard_page, guard_page) == -1); - exit(1); + _exit(1); } static void @@ -154,7 +157,7 @@ sigabrt_handler_2(int sig) #else abort(); #endif - exit(1); + _exit(1); } static void @@ -164,7 +167,7 @@ sigabrt_handler_1(int sig) signal(SIGABRT, sigabrt_handler_2); assert(crypto_kx_server_session_keys(NULL, NULL, guard_page, guard_page, guard_page) == -1); - exit(1); + _exit(1); } int diff --git a/src/libsodium/test/default/pwhash_argon2i.c b/src/libsodium/test/default/pwhash_argon2i.c index 3e1195e13..d3aaba135 100644 --- a/src/libsodium/test/default/pwhash_argon2i.c +++ b/src/libsodium/test/default/pwhash_argon2i.c @@ -290,10 +290,24 @@ str_tests(void) -1) { printf("pwhash_str() with a small opslimit should have failed\n"); } - if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ" - "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ", - "password", 0x100000000ULL) != -1) { - printf("pwhash_str_verify(invalid(0)) failure\n"); + { + const char *str_in_ = "$argon2i$m=65536,t=2,p=1c29tZXNhbHQ" + "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ"; + char *str_in = (char *) sodium_malloc(strlen(str_in_) + 1U); + + const char *password_in_ = "password"; + char *password_in = (char *) sodium_malloc(strlen(password_in_) + 1U); + + memcpy(str_in, str_in_, strlen(str_in_) + 1U); + memcpy(password_in, password_in_, strlen(password_in_) + 1U); + + if (crypto_pwhash_argon2i_str_verify(str_in, password_in, + 0x100000000ULL) != -1) { + printf("pwhash_str_verify(invalid(0)) failure\n"); + } + + sodium_free(password_in); + sodium_free(str_in); } if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ" "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ", diff --git a/src/libsodium/test/default/pwhash_argon2id.c b/src/libsodium/test/default/pwhash_argon2id.c index 954634927..82d7d118c 100644 --- a/src/libsodium/test/default/pwhash_argon2id.c +++ b/src/libsodium/test/default/pwhash_argon2id.c @@ -304,10 +304,24 @@ str_tests(void) if (crypto_pwhash_str(str_out2, passwd, strlen(passwd), 0, MEMLIMIT) != -1) { printf("pwhash_argon2id_str() with a null opslimit should have failed\n"); } - if (crypto_pwhash_str_verify("$argon2id$m=65536,t=2,p=1c29tZXNhbHQ" - "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ", - "password", 0x100000000ULL) != -1) { - printf("pwhash_str_verify(invalid(0)) failure\n"); + { + const char *str_in_ ="$argon2id$m=65536,t=2,p=1c29tZXNhbHQ" + "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ"; + char *str_in = (char *) sodium_malloc(strlen(str_in_) + 1U); + + const char *password_in_ = "password"; + char *password_in = (char *) sodium_malloc(strlen(password_in_) + 1U); + + memcpy(str_in, str_in_, strlen(str_in_) + 1U); + memcpy(password_in, password_in_, strlen(password_in_) + 1U); + + if (crypto_pwhash_argon2i_str_verify(str_in, password_in, + 0x100000000ULL) != -1) { + printf("pwhash_str_verify(invalid(0)) failure\n"); + } + + sodium_free(password_in); + sodium_free(str_in); } if (crypto_pwhash_str_verify("$argon2id$m=65536,t=2,p=1c29tZXNhbHQ" "$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ", @@ -418,7 +432,7 @@ main(void) assert(crypto_pwhash_memlimit_moderate() > 0U); assert(crypto_pwhash_opslimit_sensitive() > 0U); assert(crypto_pwhash_memlimit_sensitive() > 0U); - assert(strcmp(crypto_pwhash_primitive(), "argon2i") == 0); + assert(strcmp(crypto_pwhash_primitive(), "argon2id,argon2i") == 0); assert(crypto_pwhash_bytes_min() == crypto_pwhash_BYTES_MIN); assert(crypto_pwhash_bytes_max() == crypto_pwhash_BYTES_MAX); diff --git a/src/libsodium/test/default/run.sh b/src/libsodium/test/default/run.sh new file mode 100755 index 000000000..91e437780 --- /dev/null +++ b/src/libsodium/test/default/run.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +find . -type f -perm -100 -print | grep -v run.sh | sort | while read -r x; do + echo "[$x]" + if ! "$x"; then + echo "*** [$x] FAILED" >&2 + exit 1 + fi +done diff --git a/src/libsodium/test/default/secretstream.c b/src/libsodium/test/default/secretstream_xchacha20poly1305.c similarity index 99% rename from src/libsodium/test/default/secretstream.c rename to src/libsodium/test/default/secretstream_xchacha20poly1305.c index 63c64438d..6955f82fb 100644 --- a/src/libsodium/test/default/secretstream.c +++ b/src/libsodium/test/default/secretstream_xchacha20poly1305.c @@ -1,5 +1,5 @@ -#define TEST_NAME "secretstream" +#define TEST_NAME "secretstream_xchacha20poly1305" #include "cmptest.h" int diff --git a/src/libsodium/test/default/secretstream_xchacha20poly1305.exp b/src/libsodium/test/default/secretstream_xchacha20poly1305.exp new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/src/libsodium/test/default/secretstream_xchacha20poly1305.exp @@ -0,0 +1 @@ +OK diff --git a/src/libsodium/test/default/sodium_core.c b/src/libsodium/test/default/sodium_core.c index a3985b0e8..4bcdb33e3 100644 --- a/src/libsodium/test/default/sodium_core.c +++ b/src/libsodium/test/default/sodium_core.c @@ -19,6 +19,7 @@ main(void) assert(sodium_init() == 1); (void) sodium_runtime_has_neon(); + (void) sodium_runtime_has_armcrypto(); (void) sodium_runtime_has_sse2(); (void) sodium_runtime_has_sse3(); (void) sodium_runtime_has_ssse3(); @@ -31,11 +32,11 @@ main(void) (void) sodium_runtime_has_rdrand(); sodium_set_misuse_handler(misuse_handler); -#ifndef __EMSCRIPTEN__ +#if defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(BENCHMARKS) + printf("misuse_handler()\n"); +#else sodium_misuse(); printf("Misuse handler returned\n"); -#else - printf("misuse_handler()\n"); #endif return 0; diff --git a/src/libsodium/test/default/sodium_utils2.c b/src/libsodium/test/default/sodium_utils2.c index bd72f36c6..36a6de87d 100644 --- a/src/libsodium/test/default/sodium_utils2.c +++ b/src/libsodium/test/default/sodium_utils2.c @@ -6,6 +6,9 @@ #ifdef HAVE_CATCHABLE_SEGV # include #endif +#ifndef _WIN32 +# include +#endif #define TEST_NAME "sodium_utils2" #include "cmptest.h" @@ -26,6 +29,9 @@ segv_handler(int sig) printf("Intentional segfault / bus error caught\n"); printf("OK\n"); #ifdef SIG_DFL +# ifdef SIGPROT + signal(SIGPROT, SIG_DFL); +# endif # ifdef SIGSEGV signal(SIGSEGV, SIG_DFL); # endif @@ -36,15 +42,19 @@ segv_handler(int sig) signal(SIGABRT, SIG_DFL); # endif #endif - exit(0); + _exit(0); } int main(void) { - void * buf; - size_t size; - unsigned int i; + void *buf; + size_t size; + unsigned int i; + +#ifdef BENCHMARKS + return 0; +#endif if (sodium_malloc(SIZE_MAX - 1U) != NULL) { return 1; @@ -75,6 +85,9 @@ main(void) } printf("OK\n"); #ifdef SIG_DFL +# ifdef SIGPROT + signal(SIGPROT, segv_handler); +# endif # ifdef SIGSEGV signal(SIGSEGV, segv_handler); # endif diff --git a/src/libsodium/test/default/sodium_utils3.c b/src/libsodium/test/default/sodium_utils3.c index 3bba037a2..4593069b7 100644 --- a/src/libsodium/test/default/sodium_utils3.c +++ b/src/libsodium/test/default/sodium_utils3.c @@ -6,6 +6,9 @@ #ifdef HAVE_CATCHABLE_SEGV # include #endif +#ifndef _WIN32 +# include +#endif #define TEST_NAME "sodium_utils3" #include "cmptest.h" @@ -22,6 +25,9 @@ segv_handler(int sig) printf("Intentional segfault / bus error caught\n"); printf("OK\n"); #ifdef SIG_DFL +# ifdef SIGPROT + signal(SIGPROT, SIG_DFL); +# endif # ifdef SIGSEGV signal(SIGSEGV, SIG_DFL); # endif @@ -32,7 +38,7 @@ segv_handler(int sig) signal(SIGABRT, SIG_DFL); # endif #endif - exit(0); + _exit(0); } int @@ -41,7 +47,14 @@ main(void) void * buf; size_t size; +#ifdef BENCHMARKS + return 0; +#endif + #ifdef SIG_DFL +# ifdef SIGPROT + signal(SIGPROT, segv_handler); +# endif # ifdef SIGSEGV signal(SIGSEGV, segv_handler); # endif diff --git a/src/libsodium/test/default/wasi-test-wrapper.sh b/src/libsodium/test/default/wasi-test-wrapper.sh index 8e0c5d7fc..5c3cea765 100755 --- a/src/libsodium/test/default/wasi-test-wrapper.sh +++ b/src/libsodium/test/default/wasi-test-wrapper.sh @@ -1,7 +1,5 @@ #! /bin/sh -MAX_MEMORY_TESTS="67108864" - unset LDFLAGS unset CFLAGS @@ -9,15 +7,12 @@ if command -v wasm-opt >/dev/null; then wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1" fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then - if command -v wavm >/dev/null; then - wavm run --abi=wasi "$1" && exit 0 - fi -fi - -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then - if command -v wasmtime >/dev/null; then - wasmtime run --dir=. "$1" && exit 0 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmedge" ]; then + if command -v wasmedgec >/dev/null && command -v wasmedge >/dev/null; then + wasmedgec "$1" "${1}.so" >/dev/null && + wasmedge --dir=.:. "${1}.so" && + rm -f "${1}.so" && + exit 0 fi fi @@ -27,23 +22,27 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then fi fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then - if command -v wasm3 >/dev/null; then - wasm3 "$1" && exit 0 - fi -fi - -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then - if iwasm | grep -qi wasi >/dev/null 2>&1; then - iwasm "$1" && exit 0 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then + if command -v wasmtime >/dev/null; then + wasmtime run --dir=. "$1" && exit 0 fi fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "ssvm" ]; then - if command -v ssvmc >/dev/null && command -v ssvm >/dev/null; then - ssvmc "$1" "${1}.so" && - ssvm --dir=.:. "${1}.so" && - rm -f "${1}.so" +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "bun" ]; then + if echo | bun help >/dev/null 2>&1; then + { + echo "import fs from 'fs'; import { init, WASI } from '@wasmer/wasi';" + echo "await init();" + echo "const wasi = new WASI({args: process.argv, env: process.env, preopens: {'.':'/'}});" + echo "await (async function() {" + echo " const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));" + echo " await wasi.instantiate(wasm, {});" + echo " wasi.start();" + echo " console.log(wasi.getStdoutString());" + echo "})().catch(e => { console.error(e); process.exit(1); });" + } >"${1}.mjs" + bun run "${1}.mjs" 2>/tmp/err && + rm -f "${1}.mjs" && exit 0 fi fi @@ -53,31 +52,45 @@ if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "node" ]; then echo "import fs from 'fs'; import { WASI } from 'wasi';" echo "const wasi = new WASI({args: process.argv, env: process.env, preopens: {'.':'.'}});" echo "const importObject = { wasi_snapshot_preview1: wasi.wasiImport };" - echo "const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));" - echo "const instance = await WebAssembly.instantiate(wasm, importObject);" - echo "wasi.start(instance);" + echo "await (async function() {" + echo " const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));" + echo " const instance = await WebAssembly.instantiate(wasm, importObject);" + echo " wasi.start(instance);" + echo "})().catch(e => { console.error(e); process.exit(1); });" } >"${1}.mjs" - cat "${1}.mjs" >/tmp/a node --experimental-wasi-unstable-preview1 "${1}.mjs" 2>/tmp/err && rm -f "${1}.mjs" && exit 0 fi fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer-js" ]; then - if command -v wasmer-js >/dev/null; then - wasmer-js run "$1" --dir=. && exit 0 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then + if command -v wasm3 >/dev/null; then + wasm3 "$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 \ - --target-cpu native \ - --reserved-size "4GiB" \ - --opt-level speed \ - "$1" -o "${1}.so" && - lucet-wasi --dir=.:. --max-heap-size "${MAX_MEMORY_TESTS}" "${1}.so" && - rm -f "${1}.so" && exit 0 +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then + if command -v iwasm >/dev/null; then + if iwasm | grep -qi wasi >/dev/null 2>&1; then + if wamrc --version; then + wamrc -o "${1}.o" "$1" >/dev/null && + iwasm --dir=. "${1}.o" && exit 0 + else + iwasm --dir=. "$1" && exit 0 + fi + fi + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wazero" ]; then + if command -v wazero >/dev/null; then + wazero run -mount .:/ "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer-js" ]; then + if command -v wasmer-js >/dev/null; then + wasmer-js run "$1" --dir=. && exit 0 fi fi diff --git a/src/libsodium/test/default/wintest.bat b/src/libsodium/test/default/wintest.bat index e50fb4949..4a22edade 100755 --- a/src/libsodium/test/default/wintest.bat +++ b/src/libsodium/test/default/wintest.bat @@ -1,7 +1,7 @@ @ECHO OFF if "%1" == "" ( - echo "Usage: wintest.bat [ ]" goto :END ) @@ -13,7 +13,8 @@ if not exist sodium_version.c ( ) ) -if "%2" == "x64" (SET ARCH=x64) else (SET ARCH=Win32) +if "%2" == "x64" (SET ARCH=x64) else if "%2" == "ARM64" (SET ARCH=ARM64) else (SET ARCH=ARM64) +if "%2" == "ARM64" (SET CROSSCOMPILE=1) else (SET CROSSCOMPILE=0) SET CFLAGS=/nologo /DTEST_SRCDIR=\".\" /I..\..\src\libsodium\include\sodium /I..\..\src\libsodium\include /I..\quirks SET LDFLAGS=/link /LTCG advapi32.lib ..\..\Build\%1\%ARCH%\libsodium.lib if "%1" == "ReleaseDLL" ( goto :ReleaseDLL ) @@ -44,11 +45,15 @@ FOR %%f in (*.c) DO ( echo %%f compile failed goto :END ) - %%f.exe - if errorlevel 1 ( - echo %%f failed + if %CROSSCOMPILE% == 1 ( + echo %%f skipped ) else ( - echo %%f ok + %%f.exe + if errorlevel 1 ( + echo %%f failed + ) else ( + echo %%f ok + ) ) ) REM Remove temporary files