Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebGL target #7

Open
jasonboukheir opened this issue Aug 6, 2023 · 1 comment
Open

Add WebGL target #7

jasonboukheir opened this issue Aug 6, 2023 · 1 comment

Comments

@jasonboukheir
Copy link

I've been struggling to get WebGL crypto functions to work in my Algorand SDK library. I have been using .jslib native plugins to handle them, but the APIs are not the same as libsodium.

Well I'm pleased to show off that I got source libsodium working in WebGL! Check this out:
https://github.com/CareBoo/unity-algorand-sdk/tree/8c1b360d745cfcb1d621d355f56fa959c33a8957/Runtime/Algorand.Unity.Crypto/Plugins/WebGL

I have only tested ChaCha20Poly1305, Ed25519, and Sha512, however, I'm really surprised it worked!

So the steps to copy from the libsodium project were the following:

  1. Give each file a unique name.
  2. Replace all #includes with the new names.
  3. Flatten the folders.
  4. Remove all directories from #includes.
  5. Set explicit version and minimal in the version.h.in -> version.h file.

I recommend doing something similar to add this to WebGL. It should also just work for any platform using IL2CPP, so it opens this project up to loads of other platforms!

@netpyoung
Copy link
Owner

Thank you for reporting that. I'm not sure when I got a time, But I will looking what did you reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants