Skip to content

Conversation

@ReneeVandervelde
Copy link
Contributor

The initialization call returns an additional code 1 if the initialzation has already completed successfully. Added a specific handler for this functionality into the common sources.

@ionspin -- I noticed when dding this code that the javascript implementation doesn't appear to be using the same return code handling as the rest for this call. I left it as-is for now, but is that an oversight or is there something else that handles that?

Fixes #67

@ionspin
Copy link
Owner

ionspin commented Dec 17, 2025

@ionspin -- I noticed when dding this code that the javascript implementation doesn't appear to be using the same return code handling as the rest for this call. I left it as-is for now, but is that an oversight or is there something else that handles that?

The JS integration was peculiar because libsodium-js already is a shallow wrapper around libsodium, so the API is not the same. Looking here, it seems the JS will throw an exception if result is not 0 when initializing

https://github.com/jedisct1/libsodium.js/blob/d3aedf1ce0ed8553ca5f2c2a8f5c0f13d369a4ba/wrapper/wrap-template.js#L11-L15

@ionspin
Copy link
Owner

ionspin commented Dec 20, 2025

Looks good, thanks @ReneeVandervelde !

@ionspin ionspin merged commit 7942e05 into ionspin:main Dec 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected return code 1

2 participants