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

No implementation found for void com.goterl.lazycode.lazysodium.Sodium.randombytes_buf(com.sun.jna.Pointer, int) #3

Closed
PaulSeiziger opened this issue May 18, 2018 · 2 comments
Assignees
Labels
bug You've found something that definitely should not happen, e.g a crash in a critical part of the lib resolved When the issue or problem was resolved successfully

Comments

@PaulSeiziger
Copy link

PaulSeiziger commented May 18, 2018

Hello, when I run this code:
`byte[] encodedhash = digest.digest(seed);
Sodium sodium = new SodiumAndroid();
Box.Lazy lazySodium = new LazySodium(sodium);

KeyPair pair = lazySodium.cryptoBoxSeedKeypair(encodedhash);`

I get an error:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dremanovich.adamant_android, PID: 16762 java.lang.UnsatisfiedLinkError: No implementation found for void com.goterl.lazycode.lazysodium.Sodium.randombytes_buf(com.sun.jna.Pointer, int) (tried Java_com_goterl_lazycode_lazysodium_Sodium_randombytes_1buf and Java_com_goterl_lazycode_lazysodium_Sodium_randombytes_1buf__Lcom_sun_jna_Pointer_2I) at com.goterl.lazycode.lazysodium.Sodium.randombytes_buf(Native Method) at com.goterl.lazycode.lazysodium.LazySodium.randomBytesBuf(LazySodium.java:136) at com.goterl.lazycode.lazysodium.LazySodium.cryptoBoxSeedKeypair(LazySodium.java:571) at com.dremanovich.adamant_android.LoginScreen.getPublicKeyFromPassPhrase(LoginScreen.java:116) at com.dremanovich.adamant_android.LoginScreen.onCreate(LoginScreen.java:57) at android.app.Activity.performCreate(Activity.java:6237) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

What am I doing wrong?

@gurpreet- gurpreet- self-assigned this May 18, 2018
@gurpreet- gurpreet- added the bug You've found something that definitely should not happen, e.g a crash in a critical part of the lib label May 18, 2018
@gurpreet-
Copy link
Contributor

Hello @PaulSeiziger. Thanks for trying out Lazysodium.

Ah seems like you caught the Pointer bug. This bug occurred when I mistakenly added the Pointer class to randombytes_buf's signature.

I fixed this in later versions of Lazysodium for Android. Please update Lazysodium to version 1.1.4 or higher.

@PaulSeiziger
Copy link
Author

Everything works, thank you.

@gurpreet- gurpreet- added the resolved When the issue or problem was resolved successfully label May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug You've found something that definitely should not happen, e.g a crash in a critical part of the lib resolved When the issue or problem was resolved successfully
Projects
None yet
Development

No branches or pull requests

2 participants