ArteMisc / libsalty

Elixir bindings for libsodium (NIF)
Apache License 2.0
21 stars 25 forks source link

Salty.Sign.Ed25519.seed_keypair/1 and Salty.Sign.Ed25519.keypair/0 do not return a key pair #9

Closed sgessa closed 6 years ago

sgessa commented 6 years ago

Hi!

I just noticed seed_keypair/1 and keypair/0 only return the secret key so I have to call sk_to_pk/1 manually. I was expecting them to return a tuple with the secret and public key, am I wrong?

Thank you!

ArteMisc commented 6 years ago

This does indeed seem to be a mistake.

https://github.com/ArteMisc/libsalty/blob/master/lib/salty/sign.ex#L54 defines that the returned tuple should be {:ok, binary(), binary()}, which matches the api in the original C library. I will update the nif code to fix this.

Thanks for the catch!