Closed keeferrourke closed 6 years ago
Hello!
Glad you're enjoying Lazysodium! 🙌
Sure, of course I can add them for you and expose those sizes publicly.
It seems I missed all those pre-calculated functions out of the Lazy interface too (whoops!). Give me a sec and I'll add some in.
@gurpreet- much appreciated, thanks! :smile:
Hello again.
I just checked and it seems I did add those sizes into the Box
interface.
// The byte sizes are available in their relevant interfaces like so...
byte[] sharedSecret = new byte[Box.BEFORENMBYTES];
You can find similar array sizes at the start of their respective interfaces. For example the KeyExchange
interface has these byte sizes available for you:
public interface KeyExchange {
int PUBLICKEYBYTES = 32;
int SECRETKEYBYTES = 32;
int SESSIONKEYBYTES = 32;
int SEEDBYTES = 32;
String PRIMITIVE = "x25519blake2b";
// ... rest of interface
}
I've made a note to make that clearer in the documentation 👍
@gurpreet- whoops, my bad. Thanks a bunch!
Hey @gurpreet- are you folks on Liberapay? I'd be happy throw a couple dollars your way, since this library is being developed so quickly and with extremely high quality. My usage is more one-off (but maybe I'd use it more in the future), but you saved me from having to write bindings myself :wink:
Hey @keeferrourke.
Thanks for the compliments! I got tired of using low quality libs a while ago 😪. I think I'm going to expand Lazysodium to the languages that run iOS, Mac and Windows so then devs can use it to build high quality cryptography applications. I personally would like to see a GPG rival but with a better interface so everyone can use it 😄
One off donations are totally fine too! Just created a Liberapay account https://liberapay.com/terlacious/
Thanks so much!
Hey there! LazySodium looks like it's shaping up to be probably the best Libsodium Java binding library, but it doesn't expose
libsodium
's pre-calculated authenticated encryption interface properly.In particular, in the Box interface, the value of
BEFORENMBYTES
etc is not publicly accessible. The code I'm writing needs to fill a shared secretk
using theLazySodium.cryptoBoxEasyBeforeNm()
method, but I had to dig around to figure out that the buffer size should be 32 bytes long.I'm doing something like
But it would be much more clear if I could do something like:
Could this buffer size (and others) be exposed publicly?