-
Notifications
You must be signed in to change notification settings - Fork 64
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
web-client: Enable HD wallet key derivation #2715
base: albatross
Are you sure you want to change the base?
Conversation
182d489
to
8d5d3a1
Compare
8d5d3a1
to
a3474e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Halfway through the review, already some comments.
let rounds = 2u32.pow(rounds_log as u32); | ||
|
||
match version { | ||
1 => unimplemented!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to fully discard older versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The older versions use a KDF OTP function that core-rs-albatross no longer implements.
59fabbf
to
afa49dd
Compare
The encryption is PoW-backward-compatible (using the Argon2d algorithm).
That way these classes can be tree-shaken and do not blow up WASM size when not used. Move CryptoUtils.otpKdf function into an auto-spawning worker, so it doesn't block the main thread, as it usually takes a few seconds to run, other than the other methods on the class.
Copied the relevant tests from core-js.
Wrapping String.prototype.isWellFormed or a replacement taken from the official polyfill.
afa49dd
to
3103f08
Compare
`wasm-pack build` runs wasm-opt automatically, which currently fails for an unknown reason. The wasm tests are run with `wasm-pack test`, which compiles to a debug target and doesn't use wasm-opt, so doesn't trigger the problem. The actual build will be tested as part of PR #2715.
Add classes/structs and methods to support HD wallet key derivation as was possible with the core-js library.