Update to sodium 1.0.20.1 to .NET 8
This commit is contained in:
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
* text=auto
|
||||
*.sln text eol=crlf
|
||||
@@ -1,12 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PackageId>SpaceWizards.Sodium.Interop</PackageId>
|
||||
<Version>1.0.18-beta4</Version>
|
||||
<PackageId>CSSUDII.Sodium.Interop</PackageId>
|
||||
<Version>1.0.20.1</Version>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<Description>Native API binding for libsodium.</Description>
|
||||
<NoWarn>CS1591</NoWarn>
|
||||
@@ -18,7 +18,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="libsodium" Version="1.0.18.2" />
|
||||
<PackageReference Include="libsodium" Version="1.0.20.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public static unsafe partial class Libsodium
|
||||
{
|
||||
@@ -294,7 +294,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_auth_KEYBYTES = 32U;
|
||||
|
||||
[NativeTypeName("#define crypto_auth_PRIMITIVE \"hmacsha512256\"")]
|
||||
public static ReadOnlySpan<byte> crypto_auth_PRIMITIVE => new byte[] { 0x68, 0x6D, 0x61, 0x63, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x32, 0x35, 0x36, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_auth_PRIMITIVE => "hmacsha512256"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -518,7 +518,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const ulong crypto_box_MESSAGEBYTES_MAX = (((0xffffffffffffffffUL) < (0xffffffffffffffffUL) ? (0xffffffffffffffffUL) : (0xffffffffffffffffUL)) - 16U);
|
||||
|
||||
[NativeTypeName("#define crypto_box_PRIMITIVE \"curve25519xsalsa20poly1305\"")]
|
||||
public static ReadOnlySpan<byte> crypto_box_PRIMITIVE => new byte[] { 0x63, 0x75, 0x72, 0x76, 0x65, 0x32, 0x35, 0x35, 0x31, 0x39, 0x78, 0x73, 0x61, 0x6C, 0x73, 0x61, 0x32, 0x30, 0x70, 0x6F, 0x6C, 0x79, 0x31, 0x33, 0x30, 0x35, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_box_PRIMITIVE => "curve25519xsalsa20poly1305"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES")]
|
||||
public const uint crypto_box_BEFORENMBYTES = 32U;
|
||||
@@ -744,6 +744,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int crypto_core_ed25519_from_uniform([NativeTypeName("unsigned char *")] byte* p, [NativeTypeName("const unsigned char *")] byte* r);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_core_ed25519_from_hash([NativeTypeName("unsigned char *")] byte* p, [NativeTypeName("const unsigned char *")] byte* h);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
@@ -950,18 +951,22 @@ namespace SpaceWizards.Sodium.Interop
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_core_salsa208_outputbytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_core_salsa208_inputbytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_core_salsa208_keybytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_core_salsa208_constbytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
@@ -1076,7 +1081,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_generichash_KEYBYTES = 32U;
|
||||
|
||||
[NativeTypeName("#define crypto_generichash_PRIMITIVE \"blake2b\"")]
|
||||
public static ReadOnlySpan<byte> crypto_generichash_PRIMITIVE => new byte[] { 0x62, 0x6C, 0x61, 0x6B, 0x65, 0x32, 0x62, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_generichash_PRIMITIVE => "blake2b"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -1174,7 +1179,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_hash_BYTES = 64U;
|
||||
|
||||
[NativeTypeName("#define crypto_hash_PRIMITIVE \"sha512\"")]
|
||||
public static ReadOnlySpan<byte> crypto_hash_PRIMITIVE => new byte[] { 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_hash_PRIMITIVE => "sha512"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -1261,19 +1266,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const int crypto_kdf_KEYBYTES = 32;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_PRIMITIVE \"blake2b\"")]
|
||||
public static ReadOnlySpan<byte> crypto_kdf_PRIMITIVE => new byte[] { 0x62, 0x6C, 0x61, 0x6B, 0x65, 0x32, 0x62, 0x00 };
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_BYTES_MIN 16")]
|
||||
public const int crypto_kdf_blake2b_BYTES_MIN = 16;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_BYTES_MAX 64")]
|
||||
public const int crypto_kdf_blake2b_BYTES_MAX = 64;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_CONTEXTBYTES 8")]
|
||||
public const int crypto_kdf_blake2b_CONTEXTBYTES = 8;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_KEYBYTES 32")]
|
||||
public const int crypto_kdf_blake2b_KEYBYTES = 32;
|
||||
public static ReadOnlySpan<byte> crypto_kdf_PRIMITIVE => "blake2b"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -1294,6 +1287,18 @@ namespace SpaceWizards.Sodium.Interop
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_kdf_blake2b_derive_from_key([NativeTypeName("unsigned char *")] byte* subkey, [NativeTypeName("size_t")] nuint subkey_len, [NativeTypeName("uint64_t")] ulong subkey_id, [NativeTypeName("const char[8]")] sbyte* ctx, [NativeTypeName("const unsigned char[32]")] byte* key);
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_BYTES_MIN 16")]
|
||||
public const int crypto_kdf_blake2b_BYTES_MIN = 16;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_BYTES_MAX 64")]
|
||||
public const int crypto_kdf_blake2b_BYTES_MAX = 64;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_CONTEXTBYTES 8")]
|
||||
public const int crypto_kdf_blake2b_CONTEXTBYTES = 8;
|
||||
|
||||
[NativeTypeName("#define crypto_kdf_blake2b_KEYBYTES 32")]
|
||||
public const int crypto_kdf_blake2b_KEYBYTES = 32;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
public static extern nuint crypto_kx_publickeybytes();
|
||||
@@ -1339,7 +1344,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const int crypto_kx_SESSIONKEYBYTES = 32;
|
||||
|
||||
[NativeTypeName("#define crypto_kx_PRIMITIVE \"x25519blake2b\"")]
|
||||
public static ReadOnlySpan<byte> crypto_kx_PRIMITIVE => new byte[] { 0x78, 0x32, 0x35, 0x35, 0x31, 0x39, 0x62, 0x6C, 0x61, 0x6B, 0x65, 0x32, 0x62, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_kx_PRIMITIVE => "x25519blake2b"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -1382,7 +1387,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_onetimeauth_KEYBYTES = 32U;
|
||||
|
||||
[NativeTypeName("#define crypto_onetimeauth_PRIMITIVE \"poly1305\"")]
|
||||
public static ReadOnlySpan<byte> crypto_onetimeauth_PRIMITIVE => new byte[] { 0x70, 0x6F, 0x6C, 0x79, 0x31, 0x33, 0x30, 0x35, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_onetimeauth_PRIMITIVE => "poly1305"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -1507,10 +1512,10 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int crypto_pwhash_str_alg([NativeTypeName("char[128]")] sbyte* @out, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit, int alg);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_str_verify([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
public static extern int crypto_pwhash_str_verify([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_str_needs_rehash([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
public static extern int crypto_pwhash_str_needs_rehash([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("const char *")]
|
||||
@@ -1544,7 +1549,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_pwhash_STRBYTES = 128U;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_STRPREFIX crypto_pwhash_argon2id_STRPREFIX")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_STRPREFIX => new byte[] { 0x24, 0x61, 0x72, 0x67, 0x6F, 0x6E, 0x32, 0x69, 0x64, 0x24, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_STRPREFIX => "$argon2id$"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_OPSLIMIT_MIN crypto_pwhash_argon2id_OPSLIMIT_MIN")]
|
||||
public const uint crypto_pwhash_OPSLIMIT_MIN = 1U;
|
||||
@@ -1576,8 +1581,8 @@ namespace SpaceWizards.Sodium.Interop
|
||||
[NativeTypeName("#define crypto_pwhash_MEMLIMIT_SENSITIVE crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE")]
|
||||
public const uint crypto_pwhash_MEMLIMIT_SENSITIVE = 1073741824U;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_PRIMITIVE \"argon2i\"")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_PRIMITIVE => new byte[] { 0x61, 0x72, 0x67, 0x6F, 0x6E, 0x32, 0x69, 0x00 };
|
||||
[NativeTypeName("#define crypto_pwhash_PRIMITIVE \"argon2id,argon2i\"")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_PRIMITIVE => "argon2id,argon2i"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_argon2i_alg_argon2i13();
|
||||
@@ -1657,10 +1662,10 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int crypto_pwhash_argon2i_str([NativeTypeName("char[128]")] sbyte* @out, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_argon2i_str_verify([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
public static extern int crypto_pwhash_argon2i_str_verify([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_argon2i_str_needs_rehash([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
public static extern int crypto_pwhash_argon2i_str_needs_rehash([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2i_ALG_ARGON2I13 1")]
|
||||
public const int crypto_pwhash_argon2i_ALG_ARGON2I13 = 1;
|
||||
@@ -1684,7 +1689,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_pwhash_argon2i_STRBYTES = 128U;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2i_STRPREFIX \"$argon2i$\"")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_argon2i_STRPREFIX => new byte[] { 0x24, 0x61, 0x72, 0x67, 0x6F, 0x6E, 0x32, 0x69, 0x24, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_argon2i_STRPREFIX => "$argon2i$"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2i_OPSLIMIT_MIN 3U")]
|
||||
public const uint crypto_pwhash_argon2i_OPSLIMIT_MIN = 3U;
|
||||
@@ -1794,10 +1799,10 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int crypto_pwhash_argon2id_str([NativeTypeName("char[128]")] sbyte* @out, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_argon2id_str_verify([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
public static extern int crypto_pwhash_argon2id_str_verify([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_argon2id_str_needs_rehash([NativeTypeName("const char [128]")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
public static extern int crypto_pwhash_argon2id_str_needs_rehash([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2id_ALG_ARGON2ID13 2")]
|
||||
public const int crypto_pwhash_argon2id_ALG_ARGON2ID13 = 2;
|
||||
@@ -1821,7 +1826,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_pwhash_argon2id_STRBYTES = 128U;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2id_STRPREFIX \"$argon2id$\"")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_argon2id_STRPREFIX => new byte[] { 0x24, 0x61, 0x72, 0x67, 0x6F, 0x6E, 0x32, 0x69, 0x64, 0x24, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_argon2id_STRPREFIX => "$argon2id$"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_argon2id_OPSLIMIT_MIN 1U")]
|
||||
public const uint crypto_pwhash_argon2id_OPSLIMIT_MIN = 1U;
|
||||
@@ -1920,13 +1925,13 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_str([NativeTypeName("char[102]")] sbyte* @out, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_str_verify([NativeTypeName("const char [102]")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_str_verify([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_ll([NativeTypeName("const uint8_t *")] byte* passwd, [NativeTypeName("size_t")] nuint passwdlen, [NativeTypeName("const uint8_t *")] byte* salt, [NativeTypeName("size_t")] nuint saltlen, [NativeTypeName("uint64_t")] ulong N, [NativeTypeName("uint32_t")] uint r, [NativeTypeName("uint32_t")] uint p, [NativeTypeName("uint8_t *")] byte* buf, [NativeTypeName("size_t")] nuint buflen);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash([NativeTypeName("const char [102]")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
public static extern int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash([NativeTypeName("const char *")] sbyte* str, [NativeTypeName("unsigned long long")] ulong opslimit, [NativeTypeName("size_t")] nuint memlimit);
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_scryptsalsa208sha256_BYTES_MIN 16U")]
|
||||
public const uint crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = 16U;
|
||||
@@ -1947,7 +1952,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_pwhash_scryptsalsa208sha256_STRBYTES = 102U;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_scryptsalsa208sha256_STRPREFIX \"$7$\"")]
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_scryptsalsa208sha256_STRPREFIX => new byte[] { 0x24, 0x37, 0x24, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_pwhash_scryptsalsa208sha256_STRPREFIX => "$7$"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768U")]
|
||||
public const uint crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = 32768U;
|
||||
@@ -1998,7 +2003,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_scalarmult_SCALARBYTES = 32U;
|
||||
|
||||
[NativeTypeName("#define crypto_scalarmult_PRIMITIVE \"curve25519\"")]
|
||||
public static ReadOnlySpan<byte> crypto_scalarmult_PRIMITIVE => new byte[] { 0x63, 0x75, 0x72, 0x76, 0x65, 0x32, 0x35, 0x35, 0x31, 0x39, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_scalarmult_PRIMITIVE => "curve25519"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -2125,7 +2130,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_secretbox_MACBYTES = 16U;
|
||||
|
||||
[NativeTypeName("#define crypto_secretbox_PRIMITIVE \"xsalsa20poly1305\"")]
|
||||
public static ReadOnlySpan<byte> crypto_secretbox_PRIMITIVE => new byte[] { 0x78, 0x73, 0x61, 0x6C, 0x73, 0x61, 0x32, 0x30, 0x70, 0x6F, 0x6C, 0x79, 0x31, 0x33, 0x30, 0x35, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_secretbox_PRIMITIVE => "xsalsa20poly1305"u8;
|
||||
|
||||
[NativeTypeName("#define crypto_secretbox_MESSAGEBYTES_MAX crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX")]
|
||||
public const ulong crypto_secretbox_MESSAGEBYTES_MAX = (((0xffffffffffffffffUL) < (0xffffffffffffffffUL) ? (0xffffffffffffffffUL) : (0xffffffffffffffffUL)) - 16U);
|
||||
@@ -2330,7 +2335,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const uint crypto_shorthash_KEYBYTES = 16U;
|
||||
|
||||
[NativeTypeName("#define crypto_shorthash_PRIMITIVE \"siphash24\"")]
|
||||
public static ReadOnlySpan<byte> crypto_shorthash_PRIMITIVE => new byte[] { 0x73, 0x69, 0x70, 0x68, 0x61, 0x73, 0x68, 0x32, 0x34, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_shorthash_PRIMITIVE => "siphash24"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -2440,7 +2445,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const ulong crypto_sign_MESSAGEBYTES_MAX = (((0xffffffffffffffffUL) < (0xffffffffffffffffUL) ? (0xffffffffffffffffUL) : (0xffffffffffffffffUL)) - 64U);
|
||||
|
||||
[NativeTypeName("#define crypto_sign_PRIMITIVE \"ed25519\"")]
|
||||
public static ReadOnlySpan<byte> crypto_sign_PRIMITIVE => new byte[] { 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_sign_PRIMITIVE => "ed25519"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -2524,12 +2529,15 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const ulong crypto_sign_ed25519_MESSAGEBYTES_MAX = (((0xffffffffffffffffUL) < (0xffffffffffffffffUL) ? (0xffffffffffffffffUL) : (0xffffffffffffffffUL)) - 64U);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_sign_edwards25519sha512batch([NativeTypeName("unsigned char *")] byte* sm, [NativeTypeName("unsigned long long *")] ulong* smlen_p, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* sk);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_sign_edwards25519sha512batch_open([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned long long *")] ulong* mlen_p, [NativeTypeName("const unsigned char *")] byte* sm, [NativeTypeName("unsigned long long")] ulong smlen, [NativeTypeName("const unsigned char *")] byte* pk);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_sign_edwards25519sha512batch_keypair([NativeTypeName("unsigned char *")] byte* pk, [NativeTypeName("unsigned char *")] byte* sk);
|
||||
|
||||
[NativeTypeName("#define crypto_sign_edwards25519sha512batch_BYTES 64U")]
|
||||
@@ -2579,7 +2587,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public const ulong crypto_stream_MESSAGEBYTES_MAX = ((0xffffffffffffffffUL) < (0xffffffffffffffffUL) ? (0xffffffffffffffffUL) : (0xffffffffffffffffUL));
|
||||
|
||||
[NativeTypeName("#define crypto_stream_PRIMITIVE \"xsalsa20\"")]
|
||||
public static ReadOnlySpan<byte> crypto_stream_PRIMITIVE => new byte[] { 0x78, 0x73, 0x61, 0x6C, 0x73, 0x61, 0x32, 0x30, 0x00 };
|
||||
public static ReadOnlySpan<byte> crypto_stream_PRIMITIVE => "xsalsa20"u8;
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -2691,23 +2699,29 @@ namespace SpaceWizards.Sodium.Interop
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_stream_salsa208_keybytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_stream_salsa208_noncebytes();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
[Obsolete]
|
||||
public static extern nuint crypto_stream_salsa208_messagebytes_max();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_stream_salsa208([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("const unsigned char *")] byte* k);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern int crypto_stream_salsa208_xor([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("const unsigned char *")] byte* k);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[Obsolete]
|
||||
public static extern void crypto_stream_salsa208_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
||||
|
||||
[NativeTypeName("#define crypto_stream_salsa208_KEYBYTES 32U")]
|
||||
@@ -2873,7 +2887,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern int randombytes_close();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int randombytes_set_implementation(randombytes_implementation* impl);
|
||||
public static extern int randombytes_set_implementation([NativeTypeName("const randombytes_implementation *")] randombytes_implementation* impl);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("const char *")]
|
||||
@@ -2891,6 +2905,9 @@ namespace SpaceWizards.Sodium.Interop
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_runtime_has_neon();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_runtime_has_armcrypto();
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_runtime_has_sse2();
|
||||
|
||||
@@ -2953,7 +2970,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern sbyte* sodium_bin2hex([NativeTypeName("char *const")] sbyte* hex, [NativeTypeName("const size_t")] nuint hex_maxlen, [NativeTypeName("const unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_len);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_hex2bin([NativeTypeName("unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_maxlen, [NativeTypeName("const char *const")] sbyte* hex, [NativeTypeName("const size_t")] nuint hex_len, [NativeTypeName("const char *const")] sbyte* ignore, [NativeTypeName("size_t *const")] nuint* bin_len, [NativeTypeName("const char **const")] sbyte** hex_end);
|
||||
public static extern int sodium_hex2bin([NativeTypeName("unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_maxlen, [NativeTypeName("const char *const")] sbyte* hex, [NativeTypeName("const size_t")] nuint hex_len, [NativeTypeName("const char *const")] sbyte* ignore, [NativeTypeName("size_t *")] nuint* bin_len, [NativeTypeName("const char **const")] sbyte** hex_end);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
[return: NativeTypeName("size_t")]
|
||||
@@ -2964,7 +2981,7 @@ namespace SpaceWizards.Sodium.Interop
|
||||
public static extern sbyte* sodium_bin2base64([NativeTypeName("char *const")] sbyte* b64, [NativeTypeName("const size_t")] nuint b64_maxlen, [NativeTypeName("const unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_len, [NativeTypeName("const int")] int variant);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_base642bin([NativeTypeName("unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_maxlen, [NativeTypeName("const char *const")] sbyte* b64, [NativeTypeName("const size_t")] nuint b64_len, [NativeTypeName("const char *const")] sbyte* ignore, [NativeTypeName("size_t *const")] nuint* bin_len, [NativeTypeName("const char **const")] sbyte** b64_end, [NativeTypeName("const int")] int variant);
|
||||
public static extern int sodium_base642bin([NativeTypeName("unsigned char *const")] byte* bin, [NativeTypeName("const size_t")] nuint bin_maxlen, [NativeTypeName("const char *const")] sbyte* b64, [NativeTypeName("const size_t")] nuint b64_len, [NativeTypeName("const char *const")] sbyte* ignore, [NativeTypeName("size_t *")] nuint* bin_len, [NativeTypeName("const char **const")] sbyte** b64_end, [NativeTypeName("const int")] int variant);
|
||||
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_mlock([NativeTypeName("void *const")] void* addr, [NativeTypeName("const size_t")] nuint len);
|
||||
@@ -3024,13 +3041,13 @@ namespace SpaceWizards.Sodium.Interop
|
||||
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern int sodium_library_minimal();
|
||||
|
||||
[NativeTypeName("#define SODIUM_VERSION_STRING \"1.0.18\"")]
|
||||
public static ReadOnlySpan<byte> SODIUM_VERSION_STRING => new byte[] { 0x31, 0x2E, 0x30, 0x2E, 0x31, 0x38, 0x00 };
|
||||
[NativeTypeName("#define SODIUM_VERSION_STRING \"1.0.20\"")]
|
||||
public static ReadOnlySpan<byte> SODIUM_VERSION_STRING => "1.0.20"u8;
|
||||
|
||||
[NativeTypeName("#define SODIUM_LIBRARY_VERSION_MAJOR 10")]
|
||||
public const int SODIUM_LIBRARY_VERSION_MAJOR = 10;
|
||||
[NativeTypeName("#define SODIUM_LIBRARY_VERSION_MAJOR 26")]
|
||||
public const int SODIUM_LIBRARY_VERSION_MAJOR = 26;
|
||||
|
||||
[NativeTypeName("#define SODIUM_LIBRARY_VERSION_MINOR 3")]
|
||||
public const int SODIUM_LIBRARY_VERSION_MINOR = 3;
|
||||
[NativeTypeName("#define SODIUM_LIBRARY_VERSION_MINOR 2")]
|
||||
public const int SODIUM_LIBRARY_VERSION_MINOR = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the annotation found in a native declaration.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class NativeAnnotationAttribute : Attribute
|
||||
{
|
||||
private readonly string _annotation;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="NativeAnnotationAttribute" /> class.</summary>
|
||||
/// <param name="annotation">The annotation that was used in the native declaration.</param>
|
||||
public NativeAnnotationAttribute(string annotation)
|
||||
{
|
||||
_annotation = annotation;
|
||||
}
|
||||
|
||||
/// <summary>Gets the annotation that was used in the native declaration.</summary>
|
||||
public string Annotation => _annotation;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the type of a member as it was used in the native signature.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)]
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_aead_aes256gcm_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[512]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(512)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_auth_hmacsha256_state
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_auth_hmacsha512256_state
|
||||
{
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_generichash_blake2b_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[384]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(384)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
CSSUDII.Sodium.Interop/Generated/crypto_hash_sha256_state.cs
Normal file
28
CSSUDII.Sodium.Interop/Generated/crypto_hash_sha256_state.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_hash_sha256_state
|
||||
{
|
||||
[NativeTypeName("uint32_t[8]")]
|
||||
public _state_e__FixedBuffer state;
|
||||
|
||||
[NativeTypeName("uint64_t")]
|
||||
public ulong count;
|
||||
|
||||
[NativeTypeName("uint8_t[64]")]
|
||||
public _buf_e__FixedBuffer buf;
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct _state_e__FixedBuffer
|
||||
{
|
||||
public uint e0;
|
||||
}
|
||||
|
||||
[InlineArray(64)]
|
||||
public partial struct _buf_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
34
CSSUDII.Sodium.Interop/Generated/crypto_hash_sha512_state.cs
Normal file
34
CSSUDII.Sodium.Interop/Generated/crypto_hash_sha512_state.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_hash_sha512_state
|
||||
{
|
||||
[NativeTypeName("uint64_t[8]")]
|
||||
public _state_e__FixedBuffer state;
|
||||
|
||||
[NativeTypeName("uint64_t[2]")]
|
||||
public _count_e__FixedBuffer count;
|
||||
|
||||
[NativeTypeName("uint8_t[128]")]
|
||||
public _buf_e__FixedBuffer buf;
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct _state_e__FixedBuffer
|
||||
{
|
||||
public ulong e0;
|
||||
}
|
||||
|
||||
[InlineArray(2)]
|
||||
public partial struct _count_e__FixedBuffer
|
||||
{
|
||||
public ulong e0;
|
||||
}
|
||||
|
||||
[InlineArray(128)]
|
||||
public partial struct _buf_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_onetimeauth_poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[256]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(256)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_secretstream_xchacha20poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[32]")]
|
||||
public _k_e__FixedBuffer k;
|
||||
|
||||
[NativeTypeName("unsigned char[12]")]
|
||||
public _nonce_e__FixedBuffer nonce;
|
||||
|
||||
[NativeTypeName("unsigned char[8]")]
|
||||
public __pad_e__FixedBuffer _pad;
|
||||
|
||||
[InlineArray(32)]
|
||||
public partial struct _k_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
|
||||
[InlineArray(12)]
|
||||
public partial struct _nonce_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct __pad_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_sign_ed25519ph_state
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct randombytes_implementation
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium.Interop;
|
||||
namespace CSSUDII.Sodium.Interop;
|
||||
|
||||
public partial class Libsodium
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
@@ -18,8 +18,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SpaceWizards.Sodium.Interop\SpaceWizards.Sodium.Interop.csproj" />
|
||||
<ProjectReference Include="..\SpaceWizards.Sodium\SpaceWizards.Sodium.csproj" />
|
||||
<ProjectReference Include="..\CSSUDII.Sodium.Interop\CSSUDII.Sodium.Interop.csproj" />
|
||||
<ProjectReference Include="..\CSSUDII.Sodium\CSSUDII.Sodium.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace SpaceWizards.Sodium.Tests;
|
||||
namespace CSSUDII.Sodium.Tests;
|
||||
|
||||
[TestFixture]
|
||||
[TestOf(typeof(CryptoGenericHashBlake2B))]
|
||||
@@ -65,7 +65,7 @@ public sealed class GenericHashBlake2BTest
|
||||
var expected = Convert.FromHexString(expectedHex);
|
||||
|
||||
var output = new byte[expected.Length];
|
||||
CryptoGenericHashBlake2B.State state;
|
||||
CryptoGenericHashBlake2B.State state = new CryptoGenericHashBlake2B.State();
|
||||
CryptoGenericHashBlake2B.Init(ref state, key, expected.Length);
|
||||
CryptoGenericHashBlake2B.Update(ref state, input);
|
||||
CryptoGenericHashBlake2B.Final(ref state, output);
|
||||
@@ -97,7 +97,7 @@ public sealed class GenericHashBlake2BTest
|
||||
var expected = Convert.FromHexString(expectedHex);
|
||||
|
||||
var output = new byte[expected.Length];
|
||||
CryptoGenericHashBlake2B.State state;
|
||||
CryptoGenericHashBlake2B.State state = new CryptoGenericHashBlake2B.State();
|
||||
CryptoGenericHashBlake2B.InitSaltPersonal(ref state, key, expected.Length, salt, personal);
|
||||
CryptoGenericHashBlake2B.Update(ref state, input);
|
||||
CryptoGenericHashBlake2B.Final(ref state, output);
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace SpaceWizards.Sodium.Tests;
|
||||
namespace CSSUDII.Sodium.Tests;
|
||||
|
||||
[TestFixture]
|
||||
[Parallelizable(ParallelScope.All)]
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Security.Cryptography;
|
||||
using NUnit.Framework;
|
||||
using static SpaceWizards.Sodium.Interop.Libsodium;
|
||||
using static CSSUDII.Sodium.Interop.Libsodium;
|
||||
|
||||
namespace SpaceWizards.Sodium.Tests;
|
||||
namespace CSSUDII.Sodium.Tests;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class SecretBoxTest
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceWizards.Sodium", "SpaceWizards.Sodium\SpaceWizards.Sodium.csproj", "{52EC2D2E-B57B-45E3-944A-247C750731C0}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSSUDII.Sodium", "CSSUDII.Sodium\CSSUDII.Sodium.csproj", "{52EC2D2E-B57B-45E3-944A-247C750731C0}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{40BDE6AC-8B1C-4E85-960E-B3D9EA0FEC6C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
@@ -14,14 +14,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
||||
Directory.build.props = Directory.build.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceWizards.Sodium.Interop", "SpaceWizards.Sodium.Interop\SpaceWizards.Sodium.Interop.csproj", "{4565084B-3F40-44EA-B0B8-75DBFB9398EB}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSSUDII.Sodium.Interop", "CSSUDII.Sodium.Interop\CSSUDII.Sodium.Interop.csproj", "{4565084B-3F40-44EA-B0B8-75DBFB9398EB}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{7F6778F9-368B-4F4E-BC12-88AA25F85329}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Scripts\GenBindings.rsp = Scripts\GenBindings.rsp
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceWizards.Sodium.Tests", "SpaceWizards.Sodium.Tests\SpaceWizards.Sodium.Tests.csproj", "{5E1C1FFF-6F86-4D33-9038-CF314CF1320B}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSSUDII.Sodium.Tests", "CSSUDII.Sodium.Tests\CSSUDII.Sodium.Tests.csproj", "{5E1C1FFF-6F86-4D33-9038-CF314CF1320B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PackageId>SpaceWizards.Sodium</PackageId>
|
||||
<PackageId>CSSUDII.Sodium</PackageId>
|
||||
<Version>0.2.1</Version>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<Description>Simple API binding for libsodium.</Description>
|
||||
@@ -14,7 +14,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SpaceWizards.Sodium.Interop\SpaceWizards.Sodium.Interop.csproj" />
|
||||
<ProjectReference Include="..\CSSUDII.Sodium.Interop\CSSUDII.Sodium.Interop.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
using static Interop.Libsodium;
|
||||
|
||||
/// <summary>
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
using static Interop.Libsodium;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using SpaceWizards.Sodium.Interop;
|
||||
using CSSUDII.Sodium.Interop;
|
||||
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
using static Interop.Libsodium;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using static SpaceWizards.Sodium.Interop.Libsodium;
|
||||
using static CSSUDII.Sodium.Interop.Libsodium;
|
||||
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
public static class SodiumCore
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
public sealed class SodiumException : Exception
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Buffers;
|
||||
using System.Text;
|
||||
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
using static Interop.Libsodium;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SpaceWizards.Sodium;
|
||||
namespace CSSUDII.Sodium;
|
||||
|
||||
[Serializable]
|
||||
public sealed class SodiumInitException : Exception
|
||||
@@ -3,9 +3,9 @@
|
||||
<PropertyGroup>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/space-wizards/SpaceWizards.Sodium</RepositoryUrl>
|
||||
<RepositoryUrl>https://git.119.224.65.18.sslip.io/CSSUDII/CSSUDII.Sodium</RepositoryUrl>
|
||||
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
|
||||
<Authors>Space Wizards</Authors>
|
||||
<Authors>CSSUDII</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--SourceLink stuff-->
|
||||
|
||||
3053
Scripts/CSSUDII.Sodium.Interop/Generated/Libsodium.cs
Normal file
3053
Scripts/CSSUDII.Sodium.Interop/Generated/Libsodium.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the annotation found in a native declaration.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class NativeAnnotationAttribute : Attribute
|
||||
{
|
||||
private readonly string _annotation;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="NativeAnnotationAttribute" /> class.</summary>
|
||||
/// <param name="annotation">The annotation that was used in the native declaration.</param>
|
||||
public NativeAnnotationAttribute(string annotation)
|
||||
{
|
||||
_annotation = annotation;
|
||||
}
|
||||
|
||||
/// <summary>Gets the annotation that was used in the native declaration.</summary>
|
||||
public string Annotation => _annotation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the type of a member as it was used in the native signature.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class NativeTypeNameAttribute : Attribute
|
||||
{
|
||||
private readonly string _name;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="NativeTypeNameAttribute" /> class.</summary>
|
||||
/// <param name="name">The name of the type that was used in the native signature.</param>
|
||||
public NativeTypeNameAttribute(string name)
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name of the type that was used in the native signature.</summary>
|
||||
public string Name => _name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_aead_aes256gcm_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[512]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(512)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_auth_hmacsha256_state
|
||||
{
|
||||
public crypto_hash_sha256_state ictx;
|
||||
|
||||
public crypto_hash_sha256_state octx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_auth_hmacsha512256_state
|
||||
{
|
||||
public crypto_hash_sha512_state ictx;
|
||||
|
||||
public crypto_hash_sha512_state octx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_generichash_blake2b_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[384]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(384)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_hash_sha256_state
|
||||
{
|
||||
[NativeTypeName("uint32_t[8]")]
|
||||
public _state_e__FixedBuffer state;
|
||||
|
||||
[NativeTypeName("uint64_t")]
|
||||
public ulong count;
|
||||
|
||||
[NativeTypeName("uint8_t[64]")]
|
||||
public _buf_e__FixedBuffer buf;
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct _state_e__FixedBuffer
|
||||
{
|
||||
public uint e0;
|
||||
}
|
||||
|
||||
[InlineArray(64)]
|
||||
public partial struct _buf_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_hash_sha512_state
|
||||
{
|
||||
[NativeTypeName("uint64_t[8]")]
|
||||
public _state_e__FixedBuffer state;
|
||||
|
||||
[NativeTypeName("uint64_t[2]")]
|
||||
public _count_e__FixedBuffer count;
|
||||
|
||||
[NativeTypeName("uint8_t[128]")]
|
||||
public _buf_e__FixedBuffer buf;
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct _state_e__FixedBuffer
|
||||
{
|
||||
public ulong e0;
|
||||
}
|
||||
|
||||
[InlineArray(2)]
|
||||
public partial struct _count_e__FixedBuffer
|
||||
{
|
||||
public ulong e0;
|
||||
}
|
||||
|
||||
[InlineArray(128)]
|
||||
public partial struct _buf_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_onetimeauth_poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[256]")]
|
||||
public _opaque_e__FixedBuffer opaque;
|
||||
|
||||
[InlineArray(256)]
|
||||
public partial struct _opaque_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_secretstream_xchacha20poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char[32]")]
|
||||
public _k_e__FixedBuffer k;
|
||||
|
||||
[NativeTypeName("unsigned char[12]")]
|
||||
public _nonce_e__FixedBuffer nonce;
|
||||
|
||||
[NativeTypeName("unsigned char[8]")]
|
||||
public __pad_e__FixedBuffer _pad;
|
||||
|
||||
[InlineArray(32)]
|
||||
public partial struct _k_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
|
||||
[InlineArray(12)]
|
||||
public partial struct _nonce_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
|
||||
[InlineArray(8)]
|
||||
public partial struct __pad_e__FixedBuffer
|
||||
{
|
||||
public byte e0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public partial struct crypto_sign_ed25519ph_state
|
||||
{
|
||||
public crypto_hash_sha512_state hs;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace CSSUDII.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct randombytes_implementation
|
||||
{
|
||||
[NativeTypeName("const char *(*)()")]
|
||||
public delegate* unmanaged[Cdecl]<sbyte*> implementation_name;
|
||||
|
||||
[NativeTypeName("uint32_t (*)()")]
|
||||
public delegate* unmanaged[Cdecl]<uint> random;
|
||||
|
||||
[NativeTypeName("void (*)()")]
|
||||
public delegate* unmanaged[Cdecl]<void> stir;
|
||||
|
||||
[NativeTypeName("uint32_t (*)(const uint32_t)")]
|
||||
public delegate* unmanaged[Cdecl]<uint, uint> uniform;
|
||||
|
||||
[NativeTypeName("void (*)(void *const, const size_t)")]
|
||||
public delegate* unmanaged[Cdecl]<void*, nuint, void> buf;
|
||||
|
||||
[NativeTypeName("int (*)()")]
|
||||
public delegate* unmanaged[Cdecl]<int> close;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the base type of a struct as it was in the native signature.</summary>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class NativeInheritanceAttribute : Attribute
|
||||
{
|
||||
private readonly string _name;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="NativeInheritanceAttribute" /> class.</summary>
|
||||
/// <param name="name">The name of the base type that was inherited from in the native signature.</param>
|
||||
public NativeInheritanceAttribute(string name)
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name of the base type that was inherited from in the native signature.</summary>
|
||||
public string Name => _name;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
/// <summary>Specifies that the given method sets the last system error and it can be retrieved via <see cref="Marshal.GetLastSystemError" />.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class SetsLastSystemErrorAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="SetsLastSystemErrorAttribute" /> class.</summary>
|
||||
public SetsLastSystemErrorAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
/// <summary>Defines the vtbl index of a method as it was in the native signature.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed partial class VtblIndexAttribute : Attribute
|
||||
{
|
||||
private readonly uint _index;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="VtblIndexAttribute" /> class.</summary>
|
||||
/// <param name="index">The vtbl index of a method as it was in the native signature.</param>
|
||||
public VtblIndexAttribute(uint index)
|
||||
{
|
||||
_index = index;
|
||||
}
|
||||
|
||||
/// <summary>Gets the vtbl index of a method as it was in the native signature.</summary>
|
||||
public uint Index => _index;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_aead_aes256gcm_state
|
||||
{
|
||||
[NativeTypeName("unsigned char [512]")]
|
||||
public fixed byte opaque[512];
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_generichash_blake2b_state
|
||||
{
|
||||
[NativeTypeName("unsigned char [384]")]
|
||||
public fixed byte opaque[384];
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_hash_sha256_state
|
||||
{
|
||||
[NativeTypeName("uint32_t [8]")]
|
||||
public fixed uint state[8];
|
||||
|
||||
[NativeTypeName("uint64_t")]
|
||||
public ulong count;
|
||||
|
||||
[NativeTypeName("uint8_t [64]")]
|
||||
public fixed byte buf[64];
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_hash_sha512_state
|
||||
{
|
||||
[NativeTypeName("uint64_t [8]")]
|
||||
public fixed ulong state[8];
|
||||
|
||||
[NativeTypeName("uint64_t [2]")]
|
||||
public fixed ulong count[2];
|
||||
|
||||
[NativeTypeName("uint8_t [128]")]
|
||||
public fixed byte buf[128];
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_onetimeauth_poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char [256]")]
|
||||
public fixed byte opaque[256];
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop
|
||||
{
|
||||
public unsafe partial struct crypto_secretstream_xchacha20poly1305_state
|
||||
{
|
||||
[NativeTypeName("unsigned char [32]")]
|
||||
public fixed byte k[32];
|
||||
|
||||
[NativeTypeName("unsigned char [12]")]
|
||||
public fixed byte nonce[12];
|
||||
|
||||
[NativeTypeName("unsigned char [8]")]
|
||||
public fixed byte _pad[8];
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop;
|
||||
|
||||
/// <summary>
|
||||
/// WARNING: This type MUST be aligned to a 16-byte boundary.
|
||||
/// .NET does not currently have a method of specifying this at the type level,
|
||||
/// so you need to manage this yourself when allocating space or such.
|
||||
/// </summary>
|
||||
public unsafe partial struct crypto_aead_aes256gcm_state
|
||||
{
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop;
|
||||
|
||||
/// <summary>
|
||||
/// WARNING: This type MUST be aligned to a 64-byte boundary.
|
||||
/// .NET does not currently have a method of specifying this at the type level,
|
||||
/// so you need to manage this yourself when allocating space or such.
|
||||
/// </summary>
|
||||
public unsafe partial struct crypto_generichash_blake2b_state
|
||||
{
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace SpaceWizards.Sodium.Interop;
|
||||
|
||||
/// <summary>
|
||||
/// WARNING: This type MUST be aligned to a 16-byte boundary.
|
||||
/// .NET does not currently have a method of specifying this at the type level,
|
||||
/// so you need to manage this yourself when allocating space or such.
|
||||
/// </summary>
|
||||
public unsafe partial struct crypto_onetimeauth_poly1305_state
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user