GithubHelp home page GithubHelp logo

twystd / tweetnacl-android Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 5.31 MB

TweetNaCl crypto library port to Android

License: Other

Java 45.65% HTML 42.77% JavaScript 0.10% CSS 1.35% Makefile 0.05% Shell 0.01% C 10.08%
cryptography tweetnacl

tweetnacl-android's People

Contributors

twystd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tweetnacl-android's Issues

Cannot build in my own project

I have coped the code from native-lib , the TweetNacl code and the exceptions as well. The gradle syncs well. Now If I try to call the functions in another activity, I get this error

        try {
            KeyPair keyPair = TweetNaCl.cryptoBoxKeyPair();
            byte[] val =keyPair.publicKey;
            LogD(bytesToHex(val));
        } catch (KeyPairException e) {
            e.printStackTrace();
        }

First issue is that to use cryptoBoxKeyPair(), the function in the TweetNacl.java file had to be made static. Now If I run this I get an error that points to this line and throws the exception java.lang.UnsatisfiedLinkError.

    /**
     * Loads the TweetNaCl JNI library.
     * 
     */
    static {
        System.loadLibrary("tweetnacl");
    }

If I comment out this line this error comes

java.lang.UnsatisfiedLinkError: No implementation found for int com.example.varun.vesica.encryption.TweetNaCl.jniCryptoBoxKeyPair(byte[]

In Usage section of the ReadMe.md I am following this line Alternatively, copy the libs and src directories to your own project. but not able to do it.
Could someone tell me how to tackle these errors. Thanks

UnsatisfiedLink Error

After importing the project into my project and adding it as a Library and getting it to build, I am now getting an UnsatisfiedLinkError: no tweetnacl in java.library.path. I think I brought the jni/ndk stuff in correctly, but for some reason the library is still not loading. Thanks

Heap Corruption detected by dlmalloc_real

Hi,
I am using your library in a project where I need to sign stuff and verify signatures. Sometimes it works correctly, but a lot of the time the app crashes because of a heap corruption.

D/libc-fault-recovery-native: M=0xb6fbc0f4 B=0xb6fbc174 F=0x0 P=0xb9aca908 I=11
D/libc-fault-recovery-native: FIND target F=0xb9c6c330
D/libc-fault-recovery-native: M=0xb6fbc0f4 B=0xb6fbc134 F=0x0 P=0xb9d29f90 I=3
D/libc-fault-recovery-native: FIND target F=0xb9b56750
I/Choreographer: Skipped 201 frames!  The application may be doing too much work on its main thread.
E/Typeface: SANS_LOC file not found.
W/IInputConnectionWrapper: reportFullscreenMode on inactive InputConnection
E/Typeface: SANS_LOC file not found.
D/libc-fault-recovery-native: M=0xb6fbc0f4 B=0xb6fbc1c4 F=0x0 P=0xb9cd6f58 I=21
D/libc-fault-recovery-native: FIND target F=0x0
A/libc: heap corruption detected by dlmalloc_real
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9318
W/libc: Security Level: (1), Debug inforamtion is controlled by the DUMPABLE flag.
Application terminated.

These are the last few messages in the console. Any idea how to solve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.