Skip to content

Commit

Permalink
fix(webgl): 🐛 remove unsupported apis on webgl
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonboukheir committed Oct 13, 2023
1 parent b23cbb4 commit 3202b93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Algorand.Unity.Package/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"crypto",
"libsodium",
"crypto",
"accounts"
"accounts",
"webgl"
],
"dotnet.defaultSolution": "Algorand.Unity.Package.sln"
}
4 changes: 2 additions & 2 deletions Algorand.Unity.Package/ProjectSettings/ProjectSettings.asset
Git LFS file not shown
6 changes: 0 additions & 6 deletions Runtime/Algorand.Unity.Crypto/Interop/sodium.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ internal static unsafe partial class sodium
[DllImport(Library, CallingConvention = CallingConvention.Cdecl)]
internal static extern void sodium_free(IntPtr handle);

[DllImport(Library, CallingConvention = CallingConvention.Cdecl)]
internal static extern void sodium_mlock(IntPtr handle, UIntPtr size);

[DllImport(Library, CallingConvention = CallingConvention.Cdecl)]
internal static extern void sodium_munlock(IntPtr handle, UIntPtr size);

[DllImport(Library, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr sodium_allocarray(UIntPtr count, UIntPtr size);
}
Expand Down
2 changes: 0 additions & 2 deletions Runtime/Algorand.Unity.Crypto/SodiumString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ public SodiumString(ReadOnlySpan<char> source)
{
fixed (char* sourceptr = source)
{
sodium.sodium_mlock((IntPtr)sourceptr, totalCapacityNUint);
var error = UTF8ArrayUnsafeUtility.Copy(
handle.GetUnsafePtr(),
out length,
totalCapacity - 1,
sourceptr,
source.Length
);
sodium.sodium_munlock((IntPtr)sourceptr, totalCapacityNUint);
if (error != CopyError.None)
{
if (handle.IsCreated) handle.Dispose();
Expand Down

0 comments on commit 3202b93

Please sign in to comment.