Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crypto]: Replace scrypt.c with crypto_scrypt implemented in Rust #3489

Closed
wants to merge 2 commits into from

Conversation

satoshiotomakan
Copy link
Collaborator

@satoshiotomakan satoshiotomakan commented Oct 16, 2023

Description

Fixes: #3391
The problem in the mentioned issue is related to an incorrect working of the scrypt function.
When we compile WalletCore using Xcode 14.3.1 in Release mode, scrypt starts computing weird password hashes. Moreover, it seems to change a global context, so each function call with the same arguments returns a predictable but different hash.

Metrics are provided at #3482 (comment)

How to test

Run C++, Rust, iOS, Android, WASM tests

Types of changes

Add crypto_scrypt FFI function in Rust that is inspired by RustCrypto/scrypt and using RustCrypto/pbkdf2 (most likely not audited) and RustCrypto/salsa20 (not audited, has a usage warning).

Checklist

  • Create pull request as draft initially, unless its complete.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description.

If you're adding a new blockchain

  • I have read the guidelines for adding a new blockchain.

Copy link
Contributor

@hewigovens hewigovens left a comment

Choose a reason for hiding this comment

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

We can go with rust this time, have you verified ios release build locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants