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

crypto_pwhash_scryptsalsa* undefined reference #579

Closed
joshjdevl opened this issue Aug 8, 2017 · 4 comments
Closed

crypto_pwhash_scryptsalsa* undefined reference #579

joshjdevl opened this issue Aug 8, 2017 · 4 comments
Labels

Comments

@joshjdevl
Copy link
Contributor

Recently started receiving many crypto_pwhash_scryptsalsa* undefined reference errors. Did something change recently?

Build error

/home/travis/build/joshjdevl/libsodium-jni/build/intermediates/ndkBuild/debug/obj/local/mips64/objs-debug/sodiumjni/sodium_wrap.o: In function Java_org_libsodium_jni_SodiumJNI_crypto_1pwhash_1scryptsalsa208sha256_1saltbytes': /home/travis/build/joshjdevl/libsodium-jni/jni/sodium_wrap.c:5851: undefined reference to crypto_pwhash_scryptsalsa208sha256_saltbytes'
/home/travis/build/joshjdevl/libsodium-jni/build/intermediates/ndkBuild/debug/obj/local/mips64/objs-debug/sodiumjni/sodium_wrap.o: In function Java_org_libsodium_jni_SodiumJNI_crypto_1pwhash_1scryptsalsa208sha256_1strbytes': /home/travis/build/joshjdevl/libsodium-jni/jni/sodium_wrap.c:5863: undefined reference to crypto_pwhash_scryptsalsa208sha256_strbytes'
/home/travis/build/joshjdevl/libsodium-jni/build/intermediates/ndkBuild/debug/obj/local/mips64/objs-debug/sodiumjni/sodium_wrap.o: In function Java_org_libsodium_jni_SodiumJNI_crypto_1pwhash_1scryptsalsa208sha256_1strprefix': /home/travis/build/joshjdevl/libsodium-jni/jni/sodium_wrap.c:5875: undefined reference to crypto_pwhash_scryptsalsa208sha256_strprefix'
/home/travis/build/joshjdevl/libsodium-jni/build/intermediates/ndkBuild/debug/obj/local/mips64/objs-debug/sodiumjni/sodium_wrap.o: In function Java_org_libsodium_jni_SodiumJNI_crypto_1pwhash_1scryptsalsa208sha256_1opslimit_1interactive': /home/travis/build/joshjdevl/libsodium-jni/jni/sodium_wrap.c:5887: undefined reference to crypto_pwhash_scryptsalsa208sha256_opslimit_interactive'

@jedisct1
Copy link
Owner

jedisct1 commented Aug 8, 2017

Hi!

Libsodium-JNI is a distinct project: https://github.com/joshjdevl/libsodium-jni

I've never used it and I don't know much about Java and Android, so you'd better ask on their project page.

scrypt is not available any more when libsodium is compiled in minimal mode, so maybe this is related.

@joshjdevl
Copy link
Contributor Author

Well, I am the maintainer of Libsodium-jni, hence my question as to what changed when trying to build and include the scrypt related functions.

I did not find much in the changelog? I will try then without the minimal mode and see.

@jedisct1
Copy link
Owner

jedisct1 commented Aug 8, 2017

Low-level functions that are not used by any high-level APIs are not present in minimal mode, and may eventually become deprecated and removed.

We were waiting for the outcome of the password hashing competition to add the final high-level API and the first algorithms it would use, which were bound to not include scrypt.

crypto_pwhash is the high-level API for password hashing that bindings such as libsodium-jni should use should use, if only because it exposes a unified interface for all algorithms.

As size and speed are important to these devices, Android & iOS builds have always used the minimal mode. But maybe a switch can be added to the build scripts to include deprecated and undocumented functions, and the ones not used by the high-level APIs (similar to "sumo" builds in Javascript).

@jedisct1
Copy link
Owner

jedisct1 commented Aug 8, 2017

If it can help, there is also a SODIUM_LIBRARY_MINIMAL macro, which is defined on minimal builds (and removes prototypes of nonexistent functions, when you include sodium.h).

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

No branches or pull requests

2 participants