terl / lazysodium-java

A Java implementation of the Libsodium crypto library. For the lazy dev.
https://github.com/terl/lazysodium-java/wiki
Mozilla Public License 2.0
135 stars 47 forks source link

Add crypto_sign_init related functions #67

Closed gurpreet- closed 4 years ago

gurpreet- commented 4 years ago

Add the following crypto_sign_init related functions.

    public native int crypto_sign_init(Sign.StateCryptoSign state);
    public native int crypto_sign_update(Sign.StateCryptoSign state, byte[] chunk, long chunkLength);
    public native int crypto_sign_final_create(Sign.StateCryptoSign state, byte[] sig, Pointer sigLen, byte[] sk);
    public native int crypto_sign_final_verify(Sign.StateCryptoSign state, byte[] sig, byte[] pk);
gurpreet- commented 4 years ago

Having some problems getting:

boolean verified = lazySodium.cryptoSignFinalVerify(state, signature, pk.getAsBytes());
assertTrue("cryptoSignFinalVerify did not work", verified);

to work 🤔