Skip to content

Commit

Permalink
Update supported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ektrah committed Apr 27, 2024
1 parent fcf56cb commit 12a7cb0
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 51 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ 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)
run: dotnet test -f net6.0 -c Release
- name: Pack
run: dotnet pack -c Release
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: '**/*.nupkg'

test-ubuntu-x64:
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)
Expand All @@ -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)
Expand Down
63 changes: 41 additions & 22 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.

0 comments on commit 12a7cb0

Please sign in to comment.