Closed plneple closed 9 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.
@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
@nikgraf I have added crypto_box_seal_open
and tested crypto_box_seal
using it, as you suggested.
@plneple just released 1.3.0 which includes your additions 👍
@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