Chris Duncan [Mon, 25 Nov 2024 20:50:59 +0000 (12:50 -0800)]
TweetNaCl expects 64-byte secret keys and signatures, and in Nano this is accomplished by concatenating private key and public key, so update sign functions to align.
Chris Duncan [Thu, 21 Nov 2024 06:25:42 +0000 (22:25 -0800)]
Remove deprecated ckd functions from wallet subclasses. Fix freeze from ckd being called on empty array of indexes. Throw error if index of derived account is missing instead of just logging to the console.
Chris Duncan [Thu, 21 Nov 2024 06:04:28 +0000 (22:04 -0800)]
Worker threads do not seem to improve BLAKE2b ckd much, but BIP-44 ckd is 5x faster. This commit saves the work, and the next commit will clean up the logging and old functions.
Chris Duncan [Wed, 20 Nov 2024 08:11:24 +0000 (00:11 -0800)]
In Tools, deprecate blake2b function in favor of simpler hash function already exported to reduce confusion with package of the same name, and add an encoding flag to allow strings already encoded to hexadecimal like nano blocks.
Chris Duncan [Tue, 19 Nov 2024 07:08:31 +0000 (23:08 -0800)]
Document test vector sources in TEST_VECTORS file, and remove repetitive warning from individual test files in favor of one very clear warning above test vector values.
Chris Duncan [Tue, 19 Nov 2024 06:55:55 +0000 (22:55 -0800)]
Integrate blake2b package, replacing blakejs and blake2b-wasm. Restore arrow notation to test methods. Remove ckd and thread class files for now, perhaps to be implemented later.
Chris Duncan [Mon, 18 Nov 2024 21:48:07 +0000 (13:48 -0800)]
Move performance tests to separate file. Move warning about sending funds to test vectors into TEST_VECTORS file only. In Wallet class, expand documentation of accounts method.
Chris Duncan [Mon, 18 Nov 2024 20:15:01 +0000 (12:15 -0800)]
Refactor passkey function to immediately execute polyfill if needed and export the function as a data URL string instead of a blob URL which doesn't work for creating workers. Test replacing key creation in Safe class with message to worker. Add data shape checks to wallet creation test. Add wallet gen performance tests.
Chris Duncan [Mon, 18 Nov 2024 18:02:46 +0000 (10:02 -0800)]
Create web worker to generate AES-GCM keys for locking wallets and accounts since generating them from a password involves the long-running PBKDF2 process.
Chris Duncan [Mon, 18 Nov 2024 14:21:03 +0000 (06:21 -0800)]
In BIP-32/44 keygen, add type guard against input to serialization functions and replace positional set of typed array with padding argument in call to Convert function. In Safe class, fix session storage reference. In Tools class, remove littleEndian function deprecated by bugfix. In Wallet class, substitute blakejs package for blake2b-wasm; refer to getter for Ledger service instead of private property; throw error if Ledger account ckd fails so that parent abstract ckd method can return an Account guaranteed; refactor accounts function to save an allocation; add type guard to ckd implementations; remove unused imports. In TEST_VECTORS, move session storage custom polyfill for testing to separate GLOBALS file; document source of Trezor test vectors; tweak names of constants for clarity when using. In tests, use new GLOBALS file; add ckd performance test for generating 2^15 accounts; fix BLAKE2b ckd tests by adding more public/private key checks; skip sweep tool test since it can cause test failures due to node limits; reorganize wallet generation and account derivation test suites to separate concerns; remove unknown test vectors from original library.