[go: up one dir, main page]

Menu

#6 PBC Wrapper for Android

open
None
5
2012-06-14
2012-06-13
Phaestion
No

Is there an easy way to get the JNA wrapper working for Android?

I'm busy building an Android NDK wrapper using your Java JNA as a starting point. I would like to contribute it when I am finished with it.

Regards

Discussion

  • Angelo De Caro

    Angelo De Caro - 2012-06-14

    Hi,
    did you manage to build gmp and pbc?

    Anyway, it's not strictly necessary to
    use JNA. It's always possible to resort
    directly to JNI.

    ./angelo

     
  • Angelo De Caro

    Angelo De Caro - 2012-06-14
    • assigned_to: nobody --> adecaro
     
  • Phaestion

    Phaestion - 2012-06-14

    Yes. I'm using a prebuilt version of GMP from https://github.com/Rupan/gmp, and I built pbc myself.

    I am having some problems with some functions that I can't seem to reach:
    <code> undefined reference to `pairing_init_set_buf'
    undefined reference to `pbc_die'</code>

    Do you have any suggestions?

    Regards
    Steyn

     
  • Mourad BEJI

    Mourad BEJI - 2013-02-24

    Hi!
    I am actually working on a school project on attribute based encryption and I need to use the JPBC library on android. The jna wrapper must be replaced by a jni wrapper or something like that but I am struggling with the ndk...
    Did you manage to make the android wrapper finally? If yes, would it be possible to get it?
    Thanks!

     
  • Nobody/Anonymous

    Hi benji

    Yes, I was able to get it to work. The NDK is not very easy to get to work and takes quite a while to get to know. I mainly used the pairing based cryptography part of PBC, which will be of no use to you.

    I can recommend this book to get you started: Android Ndk Beginner's Guide - Sylvain Ratabouil

    Apart from that, I would recommend that you download Ben Lynn's PBC and not JPBC, as you need to compile the C source yourself, and using the Java parts of JPBC is extremely slow on Android.

    PBC 0.5.12 was the version of PBC I worked with, and it used nested functions which compiles but crashes the APP on execution. PBC 0.5.13 has been released this week I think and removes the nested functions - this should make your life easier. I had to edit the PBC source to get it to work on Android.

    Regards
    Phaestion

     
  • Nobody/Anonymous

    Phaestion,
    Thank you for your fast answer!
    I am actually using the paring based cryptography as the main cryptographic scheme of my algorithm (FYI http://goo.gl/HnkQY\).
    Do you get to build all sub libraries (GMP,...) with JNI?
    Sorry to insist but it would be very helpful for me if I could take a look at the way you did it.
    Thank you.

    Regards,
    beji

     
  • Phaestion

    Phaestion - 2013-02-26

    Hi benji

    I cross compiled GMP using the Android standalone toolchain. Though you can download prebuild versions of GMP here: https://github.com/Rupan/gmp

    I have a test application that I used for my masters degree that I can share with you. I will send you a message with my email address here on SF. You can contact me there.

    Regards
    Phaestion