abstractj / kalium

Java binding to the Networking and Cryptography (NaCl) library with the awesomeness of libsodium
http://abstractj.github.com/kalium/
Apache License 2.0
208 stars 74 forks source link

KeyPair from secret produces different result than libsodium impl #55

Open lvh opened 8 years ago

lvh commented 8 years ago

KeyPair in kalium just does the point mult with whatever the input was. The seed API in libsodium hashes the input to 32 bytes and then does the point mult. Is that intentional?

Cc @cbowdon, who might care about the behavior in caesium, since he submitted the PR for it. I might be changing this to use the libsodium API.

bendoerr commented 8 years ago

Not sure that the original intent of KeyPair(byte[] secretKey) is supposed to mimic crypto_box_seed_keypair but rather the case where crypto_box_keypair was used. On my branch where I was trying to get Kalium up to date with current libsodium I added a constructor that uses crypto_box_seed_keypair explicity.