ArteMisc / libsalty

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

Box seal fixes #4

Closed magnetised closed 6 years ago

magnetised commented 6 years ago

Thanks for the library.

I found a few problems when experimenting with Salty that are fixed by this PR:

  1. Salty.Box.Curve25519xsalsa20poly1305.seal/2 was calling the wrong NIF primitive
  2. the NIF function for box_curve25519xsalsa20poly1305_seal_open was returning the original ciphertext, not the decrypted plaintext, and
  3. Compiling salty was deleting other dependencies.

3 is a bit weird: don't know if its an elixir/mix bug but having the compile alias call ["compile", &make/1] in that order was deleting other compiled dependencies in my project, i.e. the directories under _build/dev/lib were being deleted. This is on Elixir 1.5.2, OTP 20.

Switching the order of the compile commands fixed it (luckily).

ArteMisc commented 6 years ago

Thanks for the catch!

I am unsure about the origin of point 3, will have to look into that.