mattrglobal / ffi-bbs-signatures

An FFI wrapper around the implementation of BBS+ signatures in Ursa
Apache License 2.0
23 stars 22 forks source link

Implement Java Wrapper for Windows and Linux #43

Open marc4virono opened 2 years ago

marc4virono commented 2 years ago

Hi,

How to implement the Java wrapper in Windows and Linux ? I built the library, added the lib to the path. I updated the Java native methods bbs_signatures_bbs.h.

When I used the Bbs Java class, it cannot find the link. I tested on Android it worked but on Linux & Windows I have this error : java.lang.UnsatisfiedLinkError: 'byte[] bbs.signatures.Bbs.bls_public_key_to_bbs_key(byte[], int)' it cannot find the functions in the lib.

What did I miss ?

marc4virono commented 2 years ago

Hi again, I tried to compile rust part to be compatible in Java with a native library .dll / .so but I have difficulties to understand why the java.rs is only called for android ?

https://github.com/mattrglobal/ffi-bbs-signatures/blob/b73d17b93721f2e8efa652b9f4827fa0502ceafb/src/lib.rs#L262

What can I do to get the final bbs.dll or bbs.so compatible with Java (jni) ? I tried to remove android target and I got the same error java.lang.UnsatisfiedLinkError.

ngwlf commented 1 year ago

Hi, also trying to get this lib usable in Java under Linux, I found the Java feature not enabled by cargo when platform is Linux. Modifying the build.sh this way: cargo build --release --features java will enable the JNI features within the native lib. However running the JUnit tests fails with other errors (58% successful - 18/43)

mcsherrylabs commented 1 year ago

@ngwlf Did you get anywhere with this? I've hit the same problem.

mcsherrylabs commented 1 year ago

Or @marc4virono - any further progress?

ngwlf commented 1 year ago

@ngwlf Did you get anywhere with this? I've hit the same problem.

unfortunately no further.