netpyoung / unity.libsodium

🔑 libsodium made easy for Unity3d
MIT License
17 stars 4 forks source link

No Licence #1

Closed Ekwav closed 6 years ago

Ekwav commented 6 years ago

Hello, I wanted to ask under what licence this code is released? Thank you in advance :smile:

netpyoung commented 6 years ago

sorry i forget indicate license, what i write code will be under mit, and libsodium's license is here https://github.com/jedisct1/libsodium/blob/master/LICENSE

I will update on repository, after work.

netpyoung commented 6 years ago

i updated license. thanks 😄

Ekwav commented 6 years ago

Thank you for the quick response. Do you have any special information for me on how to upgrade from version 1.0.10 to 1.0.16 ?

netpyoung commented 6 years ago

I already wrote build script for that, https://github.com/netpyoung/unity.libsodium/blob/master/build-on-linux.sh

and I have a plan to update library 1.0.10 -> 1.0.16 but not soon. so, if you want, try that script at first.

Ekwav commented 6 years ago

Worked like a charm. One last question, how could I use lobsidium in the linux version of unity? You included OSX and windows but no linux.

netpyoung commented 6 years ago

my laptop is too old to running unity on virtualbox. that's reason why i didn't do that

Ekwav commented 6 years ago

I tried to implement the new functions from https://download.libsodium.org/doc/key_exchange I am on Linux(ubuntu) so I kind of need it :D And I just can't figure out how to build it for linux. I am using the from windows built .dll now, but I am receiving EntryPointNotFoundException: crypto_kx_keypair exception on the new functions.

netpyoung commented 6 years ago

I build / added lib for linux64. try check that.

and you can build libsodium.so by manual using https://download.libsodium.org/doc/installation/

Ekwav commented 6 years ago

Thanks again. I tried it, bad news doesn't work with native .so either. Maybe my implementation is wrong, I added [DllImport(DLL_NAME)] public static extern int crypto_kx_keypair(byte[] publicKey, byte[] secretKey); To the NativeSodium class but I still get EntryPointNotFoundException: crypto_kx_keypair when I try to call NativeLibsodium.crypto_kx_keypair (publicKey, privateKey);

Your DecryptChaCha20 and EncryptChaCha20 are working fine however.

Ekwav commented 6 years ago

Such a simple mistake ... I thought the so file would need to be named the same way as in the c# class. const string DLL_NAME = "sodium"; = sodium for the name, but there has to be a lib in front of that name. But now I am riddling why the other functions worked :D This is wrong in the unity package. I submited a pull request for it.

SOLUTION (I like when there is a simple solution at the end) Name the librarys (dll,so etc.) libDLL_NAME from c# [DllImport(DLL_NAME)]