|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
namespace CSSUDII.Sodium.Interop
|
|
|
|
|
{
|
|
|
|
|
public static unsafe partial class Libsodium
|
|
|
|
|
{
|
|
|
|
|
@@ -69,7 +69,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_aead_aes256gcm_decrypt_detached_afternm([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned char *")] byte* nsec, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* mac, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen, [NativeTypeName("const unsigned char *")] byte* npub, [NativeTypeName("const crypto_aead_aes256gcm_state *")] crypto_aead_aes256gcm_state* ctx_);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_aead_aes256gcm_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_aead_aes256gcm_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_aead_aes256gcm_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_aead_aes256gcm_KEYBYTES = 32U;
|
|
|
|
|
@@ -119,7 +119,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_aead_chacha20poly1305_ietf_decrypt_detached([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned char *")] byte* nsec, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* mac, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen, [NativeTypeName("const unsigned char *")] byte* npub, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_aead_chacha20poly1305_ietf_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_aead_chacha20poly1305_ietf_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
[return: NativeTypeName("size_t")]
|
|
|
|
|
@@ -154,7 +154,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_aead_chacha20poly1305_decrypt_detached([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned char *")] byte* nsec, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* mac, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen, [NativeTypeName("const unsigned char *")] byte* npub, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_aead_chacha20poly1305_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_aead_chacha20poly1305_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_aead_chacha20poly1305_ietf_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_aead_chacha20poly1305_ietf_KEYBYTES = 32U;
|
|
|
|
|
@@ -234,7 +234,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_aead_xchacha20poly1305_ietf_decrypt_detached([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned char *")] byte* nsec, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* mac, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen, [NativeTypeName("const unsigned char *")] byte* npub, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_aead_xchacha20poly1305_ietf_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_aead_xchacha20poly1305_ietf_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_aead_xchacha20poly1305_ietf_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_aead_xchacha20poly1305_ietf_KEYBYTES = 32U;
|
|
|
|
|
@@ -285,7 +285,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_auth_verify([NativeTypeName("const unsigned char *")] byte* h, [NativeTypeName("const unsigned char *")] byte* @in, [NativeTypeName("unsigned long long")] ulong inlen, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_auth_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_auth_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES")]
|
|
|
|
|
public const uint crypto_auth_BYTES = 32U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -324,7 +324,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state* state, [NativeTypeName("unsigned char *")] byte* @out);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_auth_hmacsha256_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_auth_hmacsha256_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_auth_hmacsha256_BYTES 32U")]
|
|
|
|
|
public const uint crypto_auth_hmacsha256_BYTES = 32U;
|
|
|
|
|
@@ -360,7 +360,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_auth_hmacsha512_final([NativeTypeName("crypto_auth_hmacsha512_state *")] crypto_auth_hmacsha512256_state* state, [NativeTypeName("unsigned char *")] byte* @out);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_auth_hmacsha512_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_auth_hmacsha512_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_auth_hmacsha512_BYTES 64U")]
|
|
|
|
|
public const uint crypto_auth_hmacsha512_BYTES = 64U;
|
|
|
|
|
@@ -396,7 +396,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state* state, [NativeTypeName("unsigned char *")] byte* @out);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_auth_hmacsha512256_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_auth_hmacsha512256_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_auth_hmacsha512256_BYTES 32U")]
|
|
|
|
|
public const uint crypto_auth_hmacsha512256_BYTES = 32U;
|
|
|
|
|
@@ -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)]
|
|
|
|
|
@@ -1055,7 +1060,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_generichash_final([NativeTypeName("crypto_generichash_state *")] crypto_generichash_blake2b_state* state, [NativeTypeName("unsigned char *")] byte* @out, [NativeTypeName("const size_t")] nuint outlen);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_generichash_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_generichash_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN")]
|
|
|
|
|
public const uint crypto_generichash_BYTES_MIN = 16U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -1133,7 +1138,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state* state, [NativeTypeName("unsigned char *")] byte* @out, [NativeTypeName("const size_t")] nuint outlen);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_generichash_blake2b_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_generichash_blake2b_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_generichash_blake2b_BYTES_MIN 16U")]
|
|
|
|
|
public const uint crypto_generichash_blake2b_BYTES_MIN = 16U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -1243,10 +1248,10 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern sbyte* crypto_kdf_primitive();
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_kdf_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);
|
|
|
|
|
public static extern int crypto_kdf_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);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_kdf_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_kdf_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN")]
|
|
|
|
|
public const int crypto_kdf_BYTES_MIN = 16;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -1292,7 +1285,19 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern nuint crypto_kdf_blake2b_keybytes();
|
|
|
|
|
|
|
|
|
|
[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);
|
|
|
|
|
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")]
|
|
|
|
|
@@ -1315,16 +1320,16 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern sbyte* crypto_kx_primitive();
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_kx_seed_keypair([NativeTypeName("unsigned char [32]")] byte* pk, [NativeTypeName("unsigned char [32]")] byte* sk, [NativeTypeName("const unsigned char [32]")] byte* seed);
|
|
|
|
|
public static extern int crypto_kx_seed_keypair([NativeTypeName("unsigned char[32]")] byte* pk, [NativeTypeName("unsigned char[32]")] byte* sk, [NativeTypeName("const unsigned char[32]")] byte* seed);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_kx_keypair([NativeTypeName("unsigned char [32]")] byte* pk, [NativeTypeName("unsigned char [32]")] byte* sk);
|
|
|
|
|
public static extern int crypto_kx_keypair([NativeTypeName("unsigned char[32]")] byte* pk, [NativeTypeName("unsigned char[32]")] byte* sk);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_kx_client_session_keys([NativeTypeName("unsigned char [32]")] byte* rx, [NativeTypeName("unsigned char [32]")] byte* tx, [NativeTypeName("const unsigned char [32]")] byte* client_pk, [NativeTypeName("const unsigned char [32]")] byte* client_sk, [NativeTypeName("const unsigned char [32]")] byte* server_pk);
|
|
|
|
|
public static extern int crypto_kx_client_session_keys([NativeTypeName("unsigned char[32]")] byte* rx, [NativeTypeName("unsigned char[32]")] byte* tx, [NativeTypeName("const unsigned char[32]")] byte* client_pk, [NativeTypeName("const unsigned char[32]")] byte* client_sk, [NativeTypeName("const unsigned char[32]")] byte* server_pk);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_kx_server_session_keys([NativeTypeName("unsigned char [32]")] byte* rx, [NativeTypeName("unsigned char [32]")] byte* tx, [NativeTypeName("const unsigned char [32]")] byte* server_pk, [NativeTypeName("const unsigned char [32]")] byte* server_sk, [NativeTypeName("const unsigned char [32]")] byte* client_pk);
|
|
|
|
|
public static extern int crypto_kx_server_session_keys([NativeTypeName("unsigned char[32]")] byte* rx, [NativeTypeName("unsigned char[32]")] byte* tx, [NativeTypeName("const unsigned char[32]")] byte* server_pk, [NativeTypeName("const unsigned char[32]")] byte* server_sk, [NativeTypeName("const unsigned char[32]")] byte* client_pk);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_kx_PUBLICKEYBYTES 32")]
|
|
|
|
|
public const int crypto_kx_PUBLICKEYBYTES = 32;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -1373,7 +1378,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_onetimeauth_final([NativeTypeName("crypto_onetimeauth_state *")] crypto_onetimeauth_poly1305_state* state, [NativeTypeName("unsigned char *")] byte* @out);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_onetimeauth_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_onetimeauth_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES")]
|
|
|
|
|
public const uint crypto_onetimeauth_BYTES = 16U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -1412,7 +1417,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state* state, [NativeTypeName("unsigned char *")] byte* @out);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_onetimeauth_poly1305_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_onetimeauth_poly1305_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_onetimeauth_poly1305_BYTES 16U")]
|
|
|
|
|
public const uint crypto_onetimeauth_poly1305_BYTES = 16U;
|
|
|
|
|
@@ -1501,16 +1506,16 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_pwhash([NativeTypeName("unsigned char *const")] byte* @out, [NativeTypeName("unsigned long long")] ulong outlen, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("const unsigned char *const")] byte* salt, [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([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);
|
|
|
|
|
public static extern int crypto_pwhash_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_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);
|
|
|
|
|
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();
|
|
|
|
|
@@ -1654,13 +1659,13 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_pwhash_argon2i([NativeTypeName("unsigned char *const")] byte* @out, [NativeTypeName("unsigned long long")] ulong outlen, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("const unsigned char *const")] byte* salt, [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_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);
|
|
|
|
|
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;
|
|
|
|
|
@@ -1791,13 +1796,13 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_pwhash_argon2id([NativeTypeName("unsigned char *const")] byte* @out, [NativeTypeName("unsigned long long")] ulong outlen, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("const unsigned char *const")] byte* salt, [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_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);
|
|
|
|
|
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;
|
|
|
|
|
@@ -1917,16 +1922,16 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_pwhash_scryptsalsa208sha256([NativeTypeName("unsigned char *const")] byte* @out, [NativeTypeName("unsigned long long")] ulong outlen, [NativeTypeName("const char *const")] sbyte* passwd, [NativeTypeName("unsigned long long")] ulong passwdlen, [NativeTypeName("const unsigned char *const")] byte* salt, [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([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);
|
|
|
|
|
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")]
|
|
|
|
|
@@ -2099,7 +2104,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_secretbox_open_detached([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* mac, [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)]
|
|
|
|
|
public static extern void crypto_secretbox_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_secretbox_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[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);
|
|
|
|
|
@@ -2199,7 +2204,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_secretbox_xsalsa20poly1305_open([NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("const 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)]
|
|
|
|
|
public static extern void crypto_secretbox_xsalsa20poly1305_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_secretbox_xsalsa20poly1305_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
[return: NativeTypeName("size_t")]
|
|
|
|
|
@@ -2264,16 +2269,16 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern nuint crypto_secretstream_xchacha20poly1305_statebytes();
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_secretstream_xchacha20poly1305_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_secretstream_xchacha20poly1305_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_init_push(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("unsigned char [24]")] byte* header, [NativeTypeName("const unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_init_push(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("unsigned char[24]")] byte* header, [NativeTypeName("const unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_push(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("unsigned long long *")] ulong* clen_p, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen, [NativeTypeName("unsigned char")] byte tag);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_init_pull(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("const unsigned char [24]")] byte* header, [NativeTypeName("const unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_init_pull(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("const unsigned char[24]")] byte* header, [NativeTypeName("const unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern int crypto_secretstream_xchacha20poly1305_pull(crypto_secretstream_xchacha20poly1305_state* state, [NativeTypeName("unsigned char *")] byte* m, [NativeTypeName("unsigned long long *")] ulong* mlen_p, [NativeTypeName("unsigned char *")] byte* tag_p, [NativeTypeName("const unsigned char *")] byte* c, [NativeTypeName("unsigned long long")] ulong clen, [NativeTypeName("const unsigned char *")] byte* ad, [NativeTypeName("unsigned long long")] ulong adlen);
|
|
|
|
|
@@ -2321,7 +2326,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_shorthash([NativeTypeName("unsigned char *")] byte* @out, [NativeTypeName("const unsigned char *")] byte* @in, [NativeTypeName("unsigned long long")] ulong inlen, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_shorthash_keygen([NativeTypeName("unsigned char [16]")] byte* k);
|
|
|
|
|
public static extern void crypto_shorthash_keygen([NativeTypeName("unsigned char[16]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES")]
|
|
|
|
|
public const uint crypto_shorthash_BYTES = 8U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -2567,7 +2575,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_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)]
|
|
|
|
|
public static extern void crypto_stream_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES")]
|
|
|
|
|
public const uint crypto_stream_KEYBYTES = 32U;
|
|
|
|
|
@@ -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")]
|
|
|
|
|
@@ -2603,7 +2611,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_chacha20_xor_ic([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("uint64_t")] ulong ic, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_stream_chacha20_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_chacha20_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
[return: NativeTypeName("size_t")]
|
|
|
|
|
@@ -2627,7 +2635,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_chacha20_ietf_xor_ic([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("uint32_t")] uint ic, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_stream_chacha20_ietf_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_chacha20_ietf_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_chacha20_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_chacha20_KEYBYTES = 32U;
|
|
|
|
|
@@ -2678,7 +2686,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_salsa20_xor_ic([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("uint64_t")] ulong ic, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_stream_salsa20_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_salsa20_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_salsa20_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_salsa20_KEYBYTES = 32U;
|
|
|
|
|
@@ -2691,24 +2699,30 @@ 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)]
|
|
|
|
|
public static extern void crypto_stream_salsa208_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
[Obsolete]
|
|
|
|
|
public static extern void crypto_stream_salsa208_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_salsa208_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_salsa208_KEYBYTES = 32U;
|
|
|
|
|
@@ -2738,7 +2752,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_salsa2012_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)]
|
|
|
|
|
public static extern void crypto_stream_salsa2012_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_salsa2012_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_salsa2012_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_salsa2012_KEYBYTES = 32U;
|
|
|
|
|
@@ -2771,7 +2785,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_xchacha20_xor_ic([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("uint64_t")] ulong ic, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_stream_xchacha20_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_xchacha20_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_xchacha20_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_xchacha20_KEYBYTES = 32U;
|
|
|
|
|
@@ -2804,7 +2818,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern int crypto_stream_xsalsa20_xor_ic([NativeTypeName("unsigned char *")] byte* c, [NativeTypeName("const unsigned char *")] byte* m, [NativeTypeName("unsigned long long")] ulong mlen, [NativeTypeName("const unsigned char *")] byte* n, [NativeTypeName("uint64_t")] ulong ic, [NativeTypeName("const unsigned char *")] byte* k);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void crypto_stream_xsalsa20_keygen([NativeTypeName("unsigned char [32]")] byte* k);
|
|
|
|
|
public static extern void crypto_stream_xsalsa20_keygen([NativeTypeName("unsigned char[32]")] byte* k);
|
|
|
|
|
|
|
|
|
|
[NativeTypeName("#define crypto_stream_xsalsa20_KEYBYTES 32U")]
|
|
|
|
|
public const uint crypto_stream_xsalsa20_KEYBYTES = 32U;
|
|
|
|
|
@@ -2856,7 +2870,7 @@ namespace SpaceWizards.Sodium.Interop
|
|
|
|
|
public static extern void randombytes_buf([NativeTypeName("void *const")] void* buf, [NativeTypeName("const size_t")] nuint size);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
public static extern void randombytes_buf_deterministic([NativeTypeName("void *const")] void* buf, [NativeTypeName("const size_t")] nuint size, [NativeTypeName("const unsigned char [32]")] byte* seed);
|
|
|
|
|
public static extern void randombytes_buf_deterministic([NativeTypeName("void *const")] void* buf, [NativeTypeName("const size_t")] nuint size, [NativeTypeName("const unsigned char[32]")] byte* seed);
|
|
|
|
|
|
|
|
|
|
[DllImport("libsodium", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
|
[return: NativeTypeName("uint32_t")]
|
|
|
|
|
@@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|