Mirror of space-wizards/SpaceWizards.Sodium
Find a file
PJB3005 46037d0a3e
Update versions
New SpaceWizards.Sodium.Interop is 1.1.0, new SpaceWizards.Sodium is 0.3.0

Also update SourceLink and update TFM to .NET 8
2025-11-11 00:32:12 +01:00
Scripts Rename Methods class to Libsodium 2022-03-27 18:00:02 +02:00
SpaceWizards.Sodium Update versions 2025-11-11 00:32:12 +01:00
SpaceWizards.Sodium.Interop Update versions 2025-11-11 00:32:12 +01:00
SpaceWizards.Sodium.Tests Update versions 2025-11-11 00:32:12 +01:00
.editorconfig Some prep work for NuGet package 2022-03-27 17:54:40 +02:00
.gitignore Don't ignore .rsp file. 2022-03-27 17:12:23 +02:00
Directory.build.props Update versions 2025-11-11 00:32:12 +01:00
LICENSE.txt Basic project structure 2022-03-27 14:46:29 +02:00
README.md Woops that wasn't a link 2022-04-14 23:44:12 +02:00
SpaceWizards.Sodium.sln Some prep work for NuGet package 2022-03-27 17:54:40 +02:00

SpaceWizards.Sodium Nuget

A .NET libsodium binding that doesn't suck. Actually exposes the native API so you don't have to cry yourself to sleep in unnecessary allocations or OOP nonsense.

Currently depends on the "libsodium" NuGet package provided by Sodium.Core for the native library. They say you shouldn't depend on it directly but I am too lazy to compile them myself so deal with it.

API Shape

There is a low-level API in SpaceWizards.Sodium.Interop. This is a raw P/Invoke binding, hope you like pointers.

The high-level API in SpaceWizards.Sodium generally has two variants: span with return code, or byte[] with exceptions. Note that the former still throws exceptions if you pass spans that are too small, but otherwise failing return codes from libsodium are passed through so you can handle them. This is just what I decided to settle on to keep API size down.

Also, if it wasn't obvious, the only API wrapped is the ones I needed at the moment. PRs welcome I guess.