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

crypto_box_open_detached interface wrong #54

Closed yishais closed 5 years ago

yishais commented 5 years ago

In LazySodium, public boolean cryptoBoxOpenDetached(byte[] message, byte[] cipherText, byte[] mac, byte[] cipherTextLen, byte[] nonce, byte[] publicKey, byte[] secretKey) seems to be wrong with defining
byte[] cipherTextLen instead of long. This goes all the way down in the interface, and eventually ends with a crash as byte[] in java is passed by reference, so converting a long to a byte[4] will not work.

gurpreet- commented 5 years ago

Hi @yishais,

Nice catch! I've fixed the problem on master. A formal release will be upcoming shortly with this change in.

Thank you for reporting.

gurpreet- commented 5 years ago

These changes are now incorporated in release 4.1.0. Thank you so much for improving Lazysodium 😄