Skip to content

Conversation

@TimoGlastra
Copy link
Contributor

This updates Askar to 0.5, and integrates the new Argon2 custom config, allowing to replace react-native-argon2 in React Native.

The only breaking change is in Argon2, which we don't use in Credo, so we can allow both 0.4.x and 0.5.x of Askar to be used with Credo 0.6. This also allows us to more easily test the new integration with Koffi

We need this to upgrade the Paradym Wallet to React Native 0.81 and use the new arch (replace react-native-argon2, while keeping the same derived password) animo/paradym-wallet#438

Signed-off-by: Timo Glastra <[email protected]>
…rt for providing a custom Argon2 config. In addition it adds methods to list the open sessions and scans on a store.

Signed-off-by: Timo Glastra <[email protected]>
@TimoGlastra TimoGlastra requested a review from a team as a code owner December 12, 2025 07:43
@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 1fc1b2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@openwallet-foundation/askar-react-native Minor
@openwallet-foundation/askar-nodejs Minor
@openwallet-foundation/askar-shared Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but it'd be great if someone with more context about Askar looks at it too.

Signed-off-by: Timo Glastra <[email protected]>
@TimoGlastra
Copy link
Contributor Author

Yes that'd be good. Let's merge it for now so i can test with the alpha release.

And then @berendsliedrecht or @genaris can review and I will open a follow up pr if needed. (especially the C++ stuff would be good to get your input on @berendsliedrecht , i'm not 100% if the config for argon2 in React Native is the best way to do it)

@TimoGlastra TimoGlastra merged commit f0ae878 into main Dec 12, 2025
6 checks passed
@TimoGlastra TimoGlastra deleted the feat/update-to-05 branch December 12, 2025 08:55

auto ret = createReturnValue(rt, code, &out);
askar_buffer_free(out);
if (code == ErrorCode::Success) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that when an error was thrown, e.g. the config to the argon 2 method was null while custom mode was used. This resulted in an error, and the return value not being written. Then it would crash trying to free the buffer.

Maybe the better approach would be to check if the return value is written or not?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think works good enough. It makes sense :).

algorithm: number
version: number
parallelism: number
mem_cost: number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pattern we use here is to convert the casing so the user provides memoryCost and we translate it to mem_cost. To have a JS-like interface.

Copy link
Contributor Author

@TimoGlastra TimoGlastra Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes sense, that is the case in the top level api, but we can also do it like that in the lower level API

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.

4 participants