feat: use @noble and @scure libraries for cryptography (#2273)

Switch to using `@noble/hashes`, `@noble/curves`, `@scure/base`,
`@scure/bip32`, and `@scure/bip39`. This replaces `crypto` polyfills
(such as `crypto-browserify`), `create-hash`, `elliptic`, `hash.js`,
`bn.js` (both versions), and their many dependencies.  This also means
there are 33 less dependencies downloaded when running a fresh
`npm install` and will make the project much easier to maintain.

This reduces the bundle size by 44% (82kb minified and gzipped) over
the current 3.0 branch as well as reducing the amount of configuration
required to bundle.

Closes #1814, #1817, #2272, and #2306

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
This commit is contained in:
Nicholas Dudfield
2023-10-10 02:45:58 +07:00
committed by Caleb Kniffen
parent 5607320ce2
commit 217b111ef2
78 changed files with 2911 additions and 2621 deletions

View File

@@ -14,19 +14,18 @@
"update:confirm": "npx npm-check-updates --configFileName .ncurc.json -u"
},
"dependencies": {
"@xrplf/ripple-keypairs": "file:packages/secret-numbers",
"@xrplf/isomorphic": "file:packages/isomorphic",
"@xrplf/secret-numbers": "file:packages/secret-numbers",
"ripple-address-codec": "file:packages/ripple-address-codec",
"ripple-binary-codec": "file:packages/ripple-binary-codec",
"ripple-keypairs": "file:packages/ripple-keypairs",
"xrpl": "file:packages/xrpl"
},
"devDependencies": {
"@types/brorand": "^1.0.30",
"@types/chai": "^4.2.21",
"@types/create-hash": "^1.2.2",
"@types/jest": "^29.2.2",
"@types/lodash": "^4.14.136",
"@types/node": "^14.18.35",
"@types/node": "^16.18.38",
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
@@ -36,7 +35,6 @@
"buffer": "^6.0.2",
"chai": "^4.3.4",
"copyfiles": "^2.4.1",
"crypto-browserify": "^3.12.0",
"eslint": "^8.18.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-consistent-default-export-name": "^0.0.15",
@@ -53,12 +51,10 @@
"lerna": "^4.0.0",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"path-browserify": "1.0.1",
"prettier": "^2.3.2",
"process": "^0.11.10",
"source-map-loader": "^5.0.0",
"source-map-support": "^0.5.16",
"stream-browserify": "^3.0.0",
"ts-jest": "^29.0.3",
"ts-loader": "^9.2.5",
"ts-node": "^10.2.1",