serenity-kit / react-native-libsodium

React Native bindings to Libsodium matching the libsodium-wrappers package API
MIT License
30 stars 9 forks source link

add crypto_box_seal #60

Closed plneple closed 9 months ago

nikgraf commented 10 months ago

@plneple looks great! can you also add tests for it like these ones? https://github.com/serenity-kit/react-native-libsodium/blob/main/example/src/tests/crypto_box_easy_test.ts

plneple commented 10 months ago

@nikgraf Disclaimer: I am not at all familiar with libsodium

It seems to me that the output from the crypto_box_seal function is dependent on the nonce generated inside of libsodium. Documentation. I believe, that means that I cannot write out the expected output statically, and calculating it might have it's own bugs.

nikgraf commented 10 months ago

@plneple totally, but the what would work as a test is creating the encryption and verifying it with a decryption. A test here is really important to make sure this works on all environments and this way we can dedect breaking changes with the e2e tests

plneple commented 9 months ago

@nikgraf I have added crypto_box_seal_open and tested crypto_box_seal using it, as you suggested.

nikgraf commented 9 months ago

@plneple just released 1.3.0 which includes your additions 👍