From 12a7cb0e827200ba92fe1d41f249bcbdd7c1aca5 Mon Sep 17 00:00:00 2001 From: ektrah Date: Sat, 27 Apr 2024 12:21:50 +0200 Subject: [PATCH] Update supported platforms --- .github/workflows/dotnet.yml | 58 ++++++++++++++++----------------- INSTALL.md | 63 +++++++++++++++++++++++------------- 2 files changed, 70 insertions(+), 51 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index dcd117d84..ceeb38b72 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -8,17 +8,17 @@ jobs: runs-on: windows-latest steps: - name: Set up .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - run: dotnet --info - - uses: actions/checkout@v3 - - name: Test (.NET 7.0/Debug) - run: dotnet test -f net7.0 -c Debug - - name: Test (.NET 7.0/Release) - run: dotnet test -f net7.0 -c Release + - uses: actions/checkout@v4 + - name: Test (.NET 8.0/Debug) + run: dotnet test -f net8.0 -c Debug + - name: Test (.NET 8.0/Release) + run: dotnet test -f net8.0 -c Release - name: Test (.NET 6.0/Debug) run: dotnet test -f net6.0 -c Debug - name: Test (.NET 6.0/Release) @@ -26,7 +26,7 @@ jobs: - name: Pack run: dotnet pack -c Release - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: '**/*.nupkg' @@ -34,17 +34,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - run: dotnet --info - - uses: actions/checkout@v3 - - name: Test (.NET 7.0/Debug) - run: dotnet test -f net7.0 -c Debug - - name: Test (.NET 7.0/Release) - run: dotnet test -f net7.0 -c Release + - uses: actions/checkout@v4 + - name: Test (.NET 8.0/Debug) + run: dotnet test -f net8.0 -c Debug + - name: Test (.NET 8.0/Release) + run: dotnet test -f net8.0 -c Release - name: Test (.NET 6.0/Debug) run: dotnet test -f net6.0 -c Debug - name: Test (.NET 6.0/Release) @@ -53,30 +53,30 @@ jobs: test-alpine-x64: runs-on: ubuntu-latest container: - image: mcr.microsoft.com/dotnet/sdk:7.0-alpine + image: mcr.microsoft.com/dotnet/sdk:8.0-alpine steps: - run: dotnet --info - - uses: actions/checkout@v3 - - name: Test (.NET 7.0/Debug) - run: dotnet test -f net7.0 -c Debug - - name: Test (.NET 7.0/Release) - run: dotnet test -f net7.0 -c Release + - uses: actions/checkout@v4 + - name: Test (.NET 8.0/Debug) + run: dotnet test -f net8.0 -c Debug + - name: Test (.NET 8.0/Release) + run: dotnet test -f net8.0 -c Release - test-macos-x64: + test-macos-arm64: runs-on: macos-latest steps: - name: Set up .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - run: dotnet --info - - uses: actions/checkout@v3 - - name: Test (.NET 7.0/Debug) - run: dotnet test -f net7.0 -c Debug - - name: Test (.NET 7.0/Release) - run: dotnet test -f net7.0 -c Release + - uses: actions/checkout@v4 + - name: Test (.NET 8.0/Debug) + run: dotnet test -f net8.0 -c Debug + - name: Test (.NET 8.0/Release) + run: dotnet test -f net8.0 -c Release - name: Test (.NET 6.0/Debug) run: dotnet test -f net6.0 -c Debug - name: Test (.NET 6.0/Release) diff --git a/INSTALL.md b/INSTALL.md index 33f2f9888..bc85a1e46 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,9 +2,12 @@ **libsodium for .NET** can be installed as follows: - dotnet add package Sodium.Core --version 1.3.4 + $ dotnet add package Sodium.Core --version 1.3.4 -The *Sodium.Core* package is intended to run on + +## Supported Platforms + +The *Sodium.Core* package is intended to run on all [supported versions of .NET](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) on the following platforms: @@ -17,26 +20,42 @@ on the following platforms: | **`ios-`** | | | | | | **`android-`** | | | | | -Specifically, + +Please note: + +1. For Windows, the + [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist) + is required. This is part of the .NET SDK but might not be present on a + clean Windows installation. + +2. The AES-GCM implementation in libsodium is hardware-accelerated and may not be + available on all architectures. Support can be determined at runtime using + the static `IsAvailable` property of the `Sodium.SecretAeadAes` class. + + +## Tested Platforms + [Sodium.Core 1.3.4](https://www.nuget.org/packages/Sodium.Core/1.3.4) has been tested to run on the following platforms and .NET versions: -| OS | Version | Architectures | .NET | -|:-------------------- |:-------- |:------------- |:--------------- | -| Windows 10 Client | 20H2 | x64 | 7.0.0 / 6.0.11 | -| Windows Server | 2022 | x64 | 7.0.0 / 6.0.11 | -| macOS | 11.7 | x64 | 7.0.0 / 6.0.11 | -| Ubuntu | 22.04 | x64 | 7.0.0 / 6.0.11 | -| Alpine | 3.16 | x64 | 7.0.0 | - -Other, similar platforms supported by .NET should work as well but have not been tested. - -Using libsodium on Windows requires the -[Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads). -This dependency is included in the .NET SDK but might -not be present, for example, when deploying a self-contained application. - -The implementation of AES-GCM in libsodium is hardware-accelerated and requires an -x64 processor with the AES-NI extension. The availability of this extension can -be determined at runtime using the static `IsAvailable` property of the -`Sodium.SecretAeadAes` class. +| OS | Version | Architecture | .NET | +|:-------------------- |:-------- |:------------- |:-------------- | +| Windows 11 | 23H2 | x64 | 8.0.4 / 6.0.29 | +| Windows Server | 2022 | x64 | 8.0.4 / 6.0.29 | +| macOS | 14.4 | arm64 | 8.0.4 / 6.0.29 | +| Alpine Linux | 3.19 | x64 | 8.0.4 | +| Ubuntu | 22.04 | x64 | 8.0.4 / 6.0.29 | + +The other supported platforms should work as well, but haven't been tested. + + +## Frequently Asked Questions + +Below are some frequently asked questions: + +**Q**: What causes a *System.DllNotFoundException: Unable to load shared +library 'libsodium' or one of its dependencies.* when using libsodium for .NET? +**A**: This exception can occur if the operating system or architecture is not +supported, or if the Visual C++ Redistributable has not been installed on a +Windows system. Please refer to the [Supported Platforms](#supported-platforms) +section above.