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.
Chris Duncan [Sun, 10 Nov 2024 21:25:03 +0000 (13:25 -0800)]
Test additional accounts when deriving from BLAKE2b wallet. Test more BLAKE2b wallet seeds. Use Trezor wallet password instead of Nano password for consistency with Trezor test vectors.
Chris Duncan [Fri, 8 Nov 2024 18:48:00 +0000 (10:48 -0800)]
Revert promisification of serialize functions in BIP-32 ckd algorithm. Add type guards to serialization functions and log actual value instead of binary representation on errors. Simplify byte array construction and return now that convert methods accept padding values.
Chris Duncan [Wed, 6 Nov 2024 07:08:21 +0000 (23:08 -0800)]
Nano spec indicates account derivation should use index in unsigned 32-bit big endian format. This is opposite of many processor architectures, so add a check for endianness for BLAKE2b wallet accounts. Also move function to be in alphabetical order.
Chris Duncan [Sun, 13 Oct 2024 09:11:46 +0000 (02:11 -0700)]
Update Safe to use browser session storage. Mock global sessionStorage in tests. Update wallet to pack ID and both secrets in one JSON object when locking and unpack it all when unlocking.