From 7ae82f2c215970918de97859522c59e70c1d15f4 Mon Sep 17 00:00:00 2001 From: Juanelas Date: Wed, 28 Jun 2023 19:35:42 +0200 Subject: [PATCH] modpow with crt; crt; modAdd; modMultiply; phi --- .github/workflows/build-and-test.yml | 2 +- .gitignore | 4 +- .npmignore | 24 +- build/build.docs.cjs | 1 + build/rollup-plugin-dts.js | 1 + build/rollup.config.js | 28 +- build/testing/browser/index.cjs | 8 +- build/testing/browser/server.cjs | 5 +- .../testing/mocha/builders/RollupBuilder.cjs | 14 +- .../typings/{is-browser.d.ts => globals.d.ts} | 1 + dist/bundle.esm.js | 16 +- dist/bundle.esm.min.js | 2 +- dist/bundle.iife.js | 2 +- dist/bundle.umd.js | 2 +- dist/index.browser.esm.js | 3 +- dist/index.d.ts | 180 +++++- dist/index.node.cjs | 4 +- dist/index.node.esm.js | 4 +- docs/API.md | 142 ++--- package-lock.json | 590 +++++++++++++----- package.json | 10 +- 21 files changed, 768 insertions(+), 275 deletions(-) rename build/typings/{is-browser.d.ts => globals.d.ts} (63%) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2df5d33..63831d1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [14.x, 16.x, 18.x] + node-version: [16.x, 18.x, 20.x] # When set to true, GitHub cancels all in-progress jobs if any matrix job fails. fail-fast: false # The maximum number of jobs that can run simultaneously. Set to 1 if you can't run tests in parallel diff --git a/.gitignore b/.gitignore index 3cc193d..2b12397 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,7 @@ node_modules # Output of 'npm pack' *.tgz -# MYC output -.nyc_output +# Coverage coverage # Environment files @@ -19,6 +18,7 @@ coverage # Test temporal files .mocha-ts .tsconfig.json +.types # docs temporal files .nojekyll diff --git a/.npmignore b/.npmignore index 3c3a11e..78ff736 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,14 @@ +# Code examples +examples + # Build scripts build # Test files test +__tests__ **/*.spec.ts +test-vectors # Logs logs @@ -19,8 +24,7 @@ npm-debug.log* # IntelliJ .idea -# MYC output -.nyc_output +# Coverage coverage # GitHub @@ -33,18 +37,26 @@ coverage # tsconfig tsconfig.json -# SRC docs -src/docs +# SRC +src # Environment files *.env +*.env.* # Test temporal files .mocha-ts .tsconfig.json +.types # docs temporal files .nojekyll -# Examples -examples \ No newline at end of file +# code of conduct +CODE_OF_CONDUCT.md + +# TODO +TO-DO.txt + +# benchmark +benchmark diff --git a/build/build.docs.cjs b/build/build.docs.cjs index 5eef1e6..f0f2c89 100644 --- a/build/build.docs.cjs +++ b/build/build.docs.cjs @@ -58,6 +58,7 @@ async function typedoc () { // typedoc options here tsconfig: tempTsConfigPath, entryPoints: ['src/ts/index.ts'], + disableSources: true, plugin: ['typedoc-plugin-markdown'], includeVersion: true, entryDocument: 'API.md', diff --git a/build/rollup-plugin-dts.js b/build/rollup-plugin-dts.js index b5151a3..b9f0d0a 100644 --- a/build/rollup-plugin-dts.js +++ b/build/rollup-plugin-dts.js @@ -21,6 +21,7 @@ const tsConfig = parseJsonSourceFileConfigFileContent(configFile, sys, dirname(t export const compile = (outDir) => { const compilerOptions = { ...tsConfig.options, + removeComments: false, declaration: true, declarationMap: true, emitDeclarationOnly: true, diff --git a/build/rollup.config.js b/build/rollup.config.js index 88e9345..2a4ae78 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -45,15 +45,10 @@ if (existsSync(input) !== true) throw new Error('The entry point should be index const tsPluginOptions = { tsconfig: tsConfigPath, outDir: undefined, - include: ['src/ts/**/*', 'build/typings/is-browser.d.ts'], + include: ['src/ts/**/*', 'build/typings/**/*.d.ts'], exclude: ['src/**/*.spec.ts'] } -const sourcemapOutputOptions = { - sourcemap: 'inline', - sourcemapExcludeSources: true -} - function compileDts (outDir) { return { name: 'compile-dts', @@ -90,7 +85,6 @@ export default [ output: [ { file: join(rootDir, pkgJson.exports['.'].default.default), - ...sourcemapOutputOptions, format: 'es', plugins: [ terser() @@ -100,7 +94,9 @@ export default [ plugins: [ replace({ IS_BROWSER: true, + environment: 'browser', _MODULE_TYPE: "'ESM'", + _NPM_PKG_VERSION: `'${process.env.npm_package_version}'` ?? "'0.0.1'", preventAssignment: true }), rollupPluginTs(tsPluginOptions), @@ -142,7 +138,9 @@ export default [ plugins: [ replace({ IS_BROWSER: true, + environment: 'browser', _MODULE_TYPE: "'BUNDLE'", + _NPM_PKG_VERSION: `'${process.env.npm_package_version}'` ?? "'0.0.1'", preventAssignment: true }), rollupPluginTs({ @@ -159,12 +157,11 @@ export default [ output: [ { file: join(rootDir, pkgJson.exports['.'].node.require.default), - ...sourcemapOutputOptions, format: 'cjs', exports: 'auto', - plugins: [ - terser() - ] + interop: 'auto', + dynamicImportInCjs: false, + plugins: [terser()] } ], plugins: [ @@ -175,7 +172,9 @@ export default [ }), replace({ IS_BROWSER: false, + environment: 'nodejs', _MODULE_TYPE: "'CJS'", + _NPM_PKG_VERSION: `'${process.env.npm_package_version}'` ?? "'0.0.1'", preventAssignment: true }), rollupPluginTs(tsPluginOptions), @@ -195,17 +194,16 @@ export default [ output: [ { file: join(rootDir, pkgJson.exports['.'].node.import.default), - ...sourcemapOutputOptions, format: 'es', - plugins: [ - terser() - ] + plugins: [terser()] } ], plugins: [ replace({ IS_BROWSER: false, + environment: 'nodejs', _MODULE_TYPE: "'ESM'", + _NPM_PKG_VERSION: `'${process.env.npm_package_version}'` ?? "'0.0.1'", __filename: 'fileURLToPath(import.meta.url)', __dirname: 'fileURLToPath(new URL(\'.\', import.meta.url))', preventAssignment: true diff --git a/build/testing/browser/index.cjs b/build/testing/browser/index.cjs index 32ab5f4..41eee01 100644 --- a/build/testing/browser/index.cjs +++ b/build/testing/browser/index.cjs @@ -61,7 +61,7 @@ const browserTests = async ( await watchDog.catch(async (reason) => { console.error(reason) }) - if (puppeteerOptions.headless === true) { + if (puppeteerOptions.headless === 'new') { await close() } }).catch(async (reason) => { @@ -102,9 +102,9 @@ const opts = { // puppeteer options puppeteerOptions: { headless: false, - devtools: true + devtools: true, // slowMo: 100, - // timeout: 10000 + timeout: 0 }, logWarnings: false, // log warnings in Node console (usually not needed) keepServerRunning: false, // keep server running until manually closed with ctrl-c. In combination with puppeteerOptions.headless (or just connecting any browser to the test page) allows debugging in browser @@ -113,7 +113,7 @@ const opts = { const args = process.argv.slice(2) if (args[0] === 'headless') { - opts.puppeteerOptions.headless = true + opts.puppeteerOptions.headless = 'new' args.shift() } diff --git a/build/testing/browser/server.cjs b/build/testing/browser/server.cjs index ea1ebb6..64a68c0 100644 --- a/build/testing/browser/server.cjs +++ b/build/testing/browser/server.cjs @@ -51,7 +51,7 @@ const tsBundleOptions = { tsconfig: path.join(rootDir, 'tsconfig.json'), outDir: undefined, // ignore outDir in tsconfig.json sourceMap: false - // include: ['build/typings/is-browser.d.ts'] + // include: ['src/ts/**/*', 'build/typings/**/*.d.ts'] } async function buildTests (testFiles) { @@ -63,6 +63,7 @@ async function buildTests (testFiles) { replace({ IS_BROWSER: true, _MODULE_TYPE: "'ESM'", + _NPM_PKG_VERSION: `'${process.env.npm_package_version}'` ?? "'0.0.1'", preventAssignment: true }), typescriptPlugin(tsBundleOptions), @@ -202,7 +203,7 @@ function _getEnvVarsReplacements (testsCode) { } } if (missingEnvVars.length > 0) { - console.warn('The folloinwg environment variables are missing in your .env file and will be replaced with "undefined": ' + [...(new Set(missingEnvVars)).values()].join(', ')) + console.warn('The following environment variables are missing in your .env file and will be replaced with "undefined": ' + [...(new Set(missingEnvVars)).values()].join(', ')) } return replacements } diff --git a/build/testing/mocha/builders/RollupBuilder.cjs b/build/testing/mocha/builders/RollupBuilder.cjs index 33323ff..17097af 100644 --- a/build/testing/mocha/builders/RollupBuilder.cjs +++ b/build/testing/mocha/builders/RollupBuilder.cjs @@ -42,6 +42,9 @@ class RollupBuilder extends Builder { rollupOptions.output = rollupOptions.output[0] } + rollupOptions.output[0].sourcemap = 'inline' + rollupOptions.output[0].sourcemapExcludeSources = true + this.builder = new RollupBundler({ rollupOptions, watch: this.watch, watchedModule: this.watchedModule }) this.builder.on('event', event => { @@ -115,11 +118,12 @@ class RollupBundler extends EventEmitter { this.emit('event', event) }) } else { - if (!fs.existsSync(path.join(rootDir, this.watchedModule))) { - await this._bundle() - } else { - this.emit('event', { code: 'END', noBuild: true }) - } + await this._bundle() + // if (!fs.existsSync(path.join(rootDir, this.watchedModule))) { + // await this._bundle() + // } else { + // this.emit('event', { code: 'END', noBuild: true }) + // } } } diff --git a/build/typings/is-browser.d.ts b/build/typings/globals.d.ts similarity index 63% rename from build/typings/is-browser.d.ts rename to build/typings/globals.d.ts index 3adc8c8..25a8a5c 100644 --- a/build/typings/is-browser.d.ts +++ b/build/typings/globals.d.ts @@ -1,2 +1,3 @@ declare const IS_BROWSER: boolean declare const _MODULE_TYPE: string +declare const _NPM_PKG_VERSION: string diff --git a/dist/bundle.esm.js b/dist/bundle.esm.js index 1f23e5d..c93de14 100644 --- a/dist/bundle.esm.js +++ b/dist/bundle.esm.js @@ -1,4 +1,4 @@ -function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++;}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,e=1n,o=1n,u=0n;for(;0n!==n;){const i=t/n,f=t%n,g=r-o*i,b=e-u*i;t=n,n=f,r=o,e=u,o=g,u=b;}return {g:t,x:r,y:e}}function e(t,r){let e="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof r?BigInt(n(r)):n(r);if(0n===e)return o;if(0n===o)return e;let u=0n;for(;0n===(1n&(e|o));)e>>=1n,o>>=1n,u++;for(;0n===(1n&e);)e>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(e>o){const n=e;e=o,o=n;}o-=e;}while(0n!==o);return e<=t?n:t}function i(n,t){return n>=t?t:n}function f(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const r=n%t;return r<0n?r+t:r}function g(n,t){const e=r(f(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return f(e.x,t)}function b(t,r,e){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof r&&(r=BigInt(r)),"number"==typeof e&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");if(1n===e)return 0n;if(t=f(t,e),r<0n)return g(b(t,n(r),e),e);let o=1n;for(;r>0;)r%2n===1n&&(o=o*t%e),r/=2n,t=t**2n%e;return o} +function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++;}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,e=1n,o=1n,i=0n;for(;0n!==n;){const u=t/n,f=t%n,g=r-o*u,c=e-i*u;t=n,n=f,r=o,e=i,o=g,i=c;}return {g:t,x:r,y:e}}function e(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const r=n%t;return r<0n?r+t:r}function o(n,t){const o=r(e(n,t),t);if(1n!==o.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return e(o.x,t)}function i(n,t,r){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const i=r??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,r,u)=>{const f=i/r;return e(t+f*o(f,r)%i*n[u]%i,i)}),0n)}function u(t,r){let e="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof r?BigInt(n(r)):n(r);if(0n===e)return o;if(0n===o)return e;let i=0n;for(;0n===(1n&(e|o));)e>>=1n,o>>=1n,i++;for(;0n===(1n&e);)e>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(e>o){const n=e;e=o,o=n;}o-=e;}while(0n!==o);return e<=t?n:t}function c(n,t){return n>=t?t:n}function a(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}function s(t,r,u,f){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof r&&(r=BigInt(r)),"number"==typeof u&&(u=BigInt(u)),u<=0n)throw new RangeError("n must be > 0");if(1n===u)return 0n;if(t=e(t,u),r<0n)return o(s(t,n(r),u,f),u);if(void 0!==f)return function(n,t,r,e){const o=e.map((n=>n[0]**n[1])),u=e.map((n=>a([n]))),f=u.map(((r,e)=>s(n,t%r,o[e])));return i(f,o,r)}(t,r,u,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const r=String(n);void 0===t[r]?t[r]={p:BigInt(n),k:1n}:t[r].k+=1n;}else {const r=String(n[0]);void 0===t[r]?t[r]={p:BigInt(n[0]),k:BigInt(n[1])}:t[r].k+=BigInt(n[1]);}})),Object.values(t).map((n=>[n.p,n.k]))}(f));let g=1n;for(;r>0;)r%2n===1n&&(g=g*t%u),r/=2n,t=t**2n%u;return g} function fromBuffer(buf) { let ret = 0n; @@ -412,13 +412,13 @@ function _isProbablyPrime(w, iterations) { } const m = d / (2n ** a); do { - const b$1 = randBetween(d, 2n); - let z = b(b$1, m, w); + const b = randBetween(d, 2n); + let z = s(b, m, w); if (z === 1n || z === d) continue; let j = 1; while (j < a) { - z = b(z, 2n, w); + z = s(z, 2n, w); if (z === d) break; if (z === 1n) @@ -434,9 +434,9 @@ function _isProbablyPrimeWorkerUrl() { let workerCode = ` 'use strict'; const ${r.name} = ${r.toString()}; - const ${g.name} = ${g.toString()}; - const ${b.name} = ${b.toString()}; - const ${f.name} = ${f.toString()}; + const ${o.name} = ${o.toString()}; + const ${s.name} = ${s.toString()}; + const ${e.name} = ${e.toString()}; const ${randBitsSync.name} = ${randBitsSync.toString()}; const ${randBytesSync.name} = ${randBytesSync.toString()}; const ${randBetween.name} = ${randBetween.toString()}; @@ -530,4 +530,4 @@ function primeSync(bitLength, iterations = 16) { return rnd; } -export { n as abs, t as bitLength, r as eGcd, e as gcd, isProbablyPrime, o as lcm, u as max, i as min, g as modInv, b as modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, f as toZn }; +export { n as abs, t as bitLength, r as eGcd, u as gcd, isProbablyPrime, f as lcm, g as max, c as min, o as modInv, s as modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, e as toZn }; diff --git a/dist/bundle.esm.min.js b/dist/bundle.esm.min.js index f5bd4c5..a9f955c 100644 --- a/dist/bundle.esm.min.js +++ b/dist/bundle.esm.min.js @@ -1 +1 @@ -function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function e(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,a=e-o*s,c=r-i*s;t=n,n=u,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function r(t,e){let r="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof e?BigInt(n(e)):n(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function s(n,t){return n>=t?t:n}function u(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function a(n,t){const r=e(u(n,t),t);if(1n!==r.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return u(r.x,t)}function c(t,e,r){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(t=u(t,r),e<0n)return a(c(t,n(e),r),r);let o=1n;for(;e>0;)e%2n===1n&&(o=o*t%r),e/=2n,t=t**2n%r;return o}function f(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function g(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{g(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function b(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=m(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function l(n,e=1n){if(n<=e)throw new RangeError("Arguments MUST be: max > min");const r=n-e,o=t(r);let i;do{i=f(b(o))}while(i>r);return i+e}let w=!1;function h(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(p());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function y(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}function $(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!w){let e=0n;do{e=f(b(n,!0))}while(!y(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=f(b(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=p();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=f(b(n,!0))}while(!y(e,t));return e}void 0!==self.Worker&&(w=!0);export{n as abs,t as bitLength,e as eGcd,r as gcd,h as isProbablyPrime,o as lcm,i as max,s as min,a as modInv,c as modPow,$ as prime,S as primeSync,l as randBetween,d as randBits,b as randBitsSync,g as randBytes,m as randBytesSync,u as toZn}; +function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function e(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,a=e-o*s,c=r-i*s;t=n,n=u,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function o(n,t){const o=e(r(n,t),t);if(1n!==o.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return r(o.x,t)}function i(n,t,e){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const i=e??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,e,s)=>{const u=i/e;return r(t+u*o(u,e)%i*n[s]%i,i)}),0n)}function s(t,e){let r="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof e?BigInt(n(e)):n(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function c(n,t){return n>=t?t:n}function f(t,e,s,u){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof s&&(s=BigInt(s)),s<=0n)throw new RangeError("n must be > 0");if(1n===s)return 0n;if(t=r(t,s),e<0n)return o(f(t,n(e),s,u),s);if(void 0!==u)return function(n,t,e,r){const o=r.map((n=>n[0]**n[1])),s=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}([n]))),u=s.map(((e,r)=>f(n,t%e,o[r])));return i(u,o,e)}(t,e,s,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const e=String(n);void 0===t[e]?t[e]={p:BigInt(n),k:1n}:t[e].k+=1n}else{const e=String(n[0]);void 0===t[e]?t[e]={p:BigInt(n[0]),k:BigInt(n[1])}:t[e].k+=BigInt(n[1])}})),Object.values(t).map((n=>[n.p,n.k]))}(u));let a=1n;for(;e>0;)e%2n===1n&&(a=a*t%s),e/=2n,t=t**2n%s;return a}function g(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function m(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{m(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function b(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=d(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function h(n,e=1n){if(n<=e)throw new RangeError("Arguments MUST be: max > min");const r=n-e,o=t(r);let i;do{i=g(b(o))}while(i>r);return i+e}let w=!1;function p(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(S());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function y(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}function $(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!w){let e=0n;do{e=g(b(n,!0))}while(!y(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=g(b(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=S();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=g(b(n,!0))}while(!y(e,t));return e}void 0!==self.Worker&&(w=!0);export{n as abs,t as bitLength,e as eGcd,s as gcd,p as isProbablyPrime,u as lcm,a as max,c as min,o as modInv,f as modPow,$ as prime,B as primeSync,h as randBetween,l as randBits,b as randBitsSync,m as randBytes,d as randBytesSync,r as toZn}; diff --git a/dist/bundle.iife.js b/dist/bundle.iife.js index 73b5913..89e8812 100644 --- a/dist/bundle.iife.js +++ b/dist/bundle.iife.js @@ -1 +1 @@ -var bigintCryptoUtils=function(n){"use strict";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,a=e-o*s,c=r-i*s;t=n,n=u,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function o(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");const e=n%t;return e<0n?e+t:e}function s(n,t){const e=r(i(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return i(e.x,t)}function u(n,e,r){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(n=i(n,r),e<0n)return s(u(n,t(e),r),r);let o=1n;for(;e>0;)e%2n===1n&&(o=o*n%r),e/=2n,n=n**2n%r;return o}function a(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function c(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{c(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function m(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=f(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function d(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=a(m(o))}while(i>r);return i+t}let b=!1;function l(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(h());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function w(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}return void 0!==self.Worker&&(b=!0),n.abs=t,n.bitLength=e,n.eGcd=r,n.gcd=o,n.isProbablyPrime=l,n.lcm=function(n,e){return"number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),0n===n&&0n===e?BigInt(0):t(n/o(n,e)*e)},n.max=function(n,t){return n>=t?n:t},n.min=function(n,t){return n>=t?t:n},n.modInv=s,n.modPow=u,n.prime=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!b){let e=0n;do{e=a(m(n,!0))}while(!w(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=a(m(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=h();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=a(m(n,!0))}while(!w(e,t));return e},n.randBetween=d,n.randBits=g,n.randBitsSync=m,n.randBytes=c,n.randBytesSync=f,n.toZn=i,n}({}); +var bigintCryptoUtils=function(n){"use strict";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const u=t/n,s=t%n,a=e-o*u,c=r-i*u;t=n,n=s,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function o(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function i(n,t){const e=r(o(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return o(e.x,t)}function u(n,t,e){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const r=e??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,e,u)=>{const s=r/e;return o(t+s*i(s,e)%r*n[u]%r,r)}),0n)}function s(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");if(1n===r)return 0n;if(n=o(n,r),e<0n)return i(a(n,t(e),r,s),r);if(void 0!==s)return function(n,t,e,r){const o=r.map((n=>n[0]**n[1])),i=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}([n]))),s=i.map(((e,r)=>a(n,t%e,o[r])));return u(s,o,e)}(n,e,r,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const e=String(n);void 0===t[e]?t[e]={p:BigInt(n),k:1n}:t[e].k+=1n}else{const e=String(n[0]);void 0===t[e]?t[e]={p:BigInt(n[0]),k:BigInt(n[1])}:t[e].k+=BigInt(n[1])}})),Object.values(t).map((n=>[n.p,n.k]))}(s));let c=1n;for(;e>0;)e%2n===1n&&(c=c*n%r),e/=2n,n=n**2n%r;return c}function c(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function f(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{f(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function d(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=g(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function l(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=c(d(o))}while(i>r);return i+t}let b=!1;function h(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(p());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function w(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}return void 0!==self.Worker&&(b=!0),n.abs=t,n.bitLength=e,n.eGcd=r,n.gcd=s,n.isProbablyPrime=h,n.lcm=function(n,e){return"number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),0n===n&&0n===e?BigInt(0):t(n/s(n,e)*e)},n.max=function(n,t){return n>=t?n:t},n.min=function(n,t){return n>=t?t:n},n.modInv=i,n.modPow=a,n.prime=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!b){let e=0n;do{e=c(d(n,!0))}while(!w(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=c(d(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=p();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=c(d(n,!0))}while(!w(e,t));return e},n.randBetween=l,n.randBits=m,n.randBitsSync=d,n.randBytes=f,n.randBytesSync=g,n.toZn=o,n}({}); diff --git a/dist/bundle.umd.js b/dist/bundle.umd.js index fbc1ac0..a0d12ed 100644 --- a/dist/bundle.umd.js +++ b/dist/bundle.umd.js @@ -1 +1 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).bigintCryptoUtils={})}(this,(function(n){"use strict";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,f=e-o*s,a=r-i*s;t=n,n=u,e=o,r=i,o=f,i=a}return{g:t,x:e,y:r}}function o(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");const e=n%t;return e<0n?e+t:e}function s(n,t){const e=r(i(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return i(e.x,t)}function u(n,e,r){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(n=i(n,r),e<0n)return s(u(n,t(e),r),r);let o=1n;for(;e>0;)e%2n===1n&&(o=o*n%r),e/=2n,n=n**2n%r;return o}function f(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function a(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{a(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function d(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=c(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function m(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=f(d(o))}while(i>r);return i+t}let l=!1;function b(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(h());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function w(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}void 0!==self.Worker&&(l=!0),n.abs=t,n.bitLength=e,n.eGcd=r,n.gcd=o,n.isProbablyPrime=b,n.lcm=function(n,e){return"number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),0n===n&&0n===e?BigInt(0):t(n/o(n,e)*e)},n.max=function(n,t){return n>=t?n:t},n.min=function(n,t){return n>=t?t:n},n.modInv=s,n.modPow=u,n.prime=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!l){let e=0n;do{e=f(d(n,!0))}while(!w(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=f(d(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=h();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=f(d(n,!0))}while(!w(e,t));return e},n.randBetween=m,n.randBits=g,n.randBitsSync=d,n.randBytes=a,n.randBytesSync=c,n.toZn=i})); +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).bigintCryptoUtils={})}(this,(function(n){"use strict";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,c=e-o*s,a=r-i*s;t=n,n=u,e=o,r=i,o=c,i=a}return{g:t,x:e,y:r}}function o(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function i(n,t){const e=r(o(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return o(e.x,t)}function s(n,t,e){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const r=e??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,e,s)=>{const u=r/e;return o(t+u*i(u,e)%r*n[s]%r,r)}),0n)}function u(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");if(1n===r)return 0n;if(n=o(n,r),e<0n)return i(c(n,t(e),r,u),r);if(void 0!==u)return function(n,t,e,r){const o=r.map((n=>n[0]**n[1])),i=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}([n]))),u=i.map(((e,r)=>c(n,t%e,o[r])));return s(u,o,e)}(n,e,r,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const e=String(n);void 0===t[e]?t[e]={p:BigInt(n),k:1n}:t[e].k+=1n}else{const e=String(n[0]);void 0===t[e]?t[e]={p:BigInt(n[0]),k:BigInt(n[1])}:t[e].k+=BigInt(n[1])}})),Object.values(t).map((n=>[n.p,n.k]))}(u));let a=1n;for(;e>0;)e%2n===1n&&(a=a*n%r),e/=2n,n=n**2n%r;return a}function a(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function f(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{f(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function m(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=g(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function l(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=a(m(o))}while(i>r);return i+t}let b=!1;function h(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(p());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function w(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}void 0!==self.Worker&&(b=!0),n.abs=t,n.bitLength=e,n.eGcd=r,n.gcd=u,n.isProbablyPrime=h,n.lcm=function(n,e){return"number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),0n===n&&0n===e?BigInt(0):t(n/u(n,e)*e)},n.max=function(n,t){return n>=t?n:t},n.min=function(n,t){return n>=t?t:n},n.modInv=i,n.modPow=c,n.prime=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!b){let e=0n;do{e=a(m(n,!0))}while(!w(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=a(m(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=p();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=a(m(n,!0))}while(!w(e,t));return e},n.randBetween=l,n.randBits=d,n.randBitsSync=m,n.randBytes=f,n.randBytesSync=g,n.toZn=o})); diff --git a/dist/index.browser.esm.js b/dist/index.browser.esm.js index 2a06841..a9f955c 100644 --- a/dist/index.browser.esm.js +++ b/dist/index.browser.esm.js @@ -1,2 +1 @@ -function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function e(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,a=e-o*s,c=r-i*s;t=n,n=u,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function r(t,e){let r="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof e?BigInt(n(e)):n(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function s(n,t){return n>=t?t:n}function u(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function a(n,t){const r=e(u(n,t),t);if(1n!==r.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return u(r.x,t)}function c(t,e,r){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(t=u(t,r),e<0n)return a(c(t,n(e),r),r);let o=1n;for(;e>0;)e%2n===1n&&(o=o*t%r),e/=2n,t=t**2n%r;return o}function f(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function g(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{g(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function b(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=m(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function l(n,e=1n){if(n<=e)throw new RangeError("Arguments MUST be: max > min");const r=n-e,o=t(r);let i;do{i=f(b(o))}while(i>r);return i+e}let w=!1;function h(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(p());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function y(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}function $(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!w){let e=0n;do{e=f(b(n,!0))}while(!y(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=f(b(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=p();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=f(b(n,!0))}while(!y(e,t));return e}void 0!==self.Worker&&(w=!0);export{n as abs,t as bitLength,e as eGcd,r as gcd,h as isProbablyPrime,o as lcm,i as max,s as min,a as modInv,c as modPow,$ as prime,S as primeSync,l as randBetween,d as randBits,b as randBitsSync,g as randBytes,m as randBytesSync,u as toZn}; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5lc20uanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9iaWdpbnQtbW9kLWFyaXRoL2Rpc3QvaW5kZXguYnJvd3Nlci5lc20uanMiLCIuLi9zcmMvdHMvZnJvbUJ1ZmZlci50cyIsIi4uL3NyYy90cy9yYW5kQnl0ZXMudHMiLCIuLi9zcmMvdHMvcmFuZEJpdHMudHMiLCIuLi9zcmMvdHMvcmFuZEJldHdlZW4udHMiLCIuLi9zcmMvdHMvd29ya2VyVXRpbHMudHMiLCIuLi9zcmMvdHMvaXNQcm9iYWJseVByaW1lLnRzIiwiLi4vc3JjL3RzL3ByaW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpudWxsLCJuYW1lcyI6WyJuIiwidCIsIkJpZ0ludCIsInIiLCJSYW5nZUVycm9yIiwiZSIsIm8iLCJ1IiwiaSIsImYiLCJnIiwiYiIsIngiLCJ5IiwidG9TdHJpbmciLCJmcm9tQnVmZmVyIiwiYnVmIiwicmV0IiwidmFsdWVzIiwicmFuZEJ5dGVzIiwiYnl0ZUxlbmd0aCIsImZvcmNlTGVuZ3RoIiwiUHJvbWlzZSIsInJlc29sdmUiLCJyZWplY3QiLCJVaW50OEFycmF5Iiwic2VsZiIsImNyeXB0byIsImdldFJhbmRvbVZhbHVlcyIsIk1hdGgiLCJjZWlsIiwiYmVnaW4iLCJlbmQiLCJzdWJhcnJheSIsInJhbmRCeXRlc1N5bmMiLCJyYW5kQml0cyIsImJpdExlbmd0aCIsImJpdExlbmd0aE1v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oQmhDLEtBQUs0QixTQUFzQk4sR0FBYyIsInhfZ29vZ2xlX2lnbm9yZUxpc3QiOlswXX0= +function n(n){return n>=0?n:-n}function t(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function e(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const s=t/n,u=t%n,a=e-o*s,c=r-i*s;t=n,n=u,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function o(n,t){const o=e(r(n,t),t);if(1n!==o.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return r(o.x,t)}function i(n,t,e){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const i=e??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,e,s)=>{const u=i/e;return r(t+u*o(u,e)%i*n[s]%i,i)}),0n)}function s(t,e){let r="number"==typeof t?BigInt(n(t)):n(t),o="number"==typeof e?BigInt(n(e)):n(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function c(n,t){return n>=t?t:n}function f(t,e,s,u){if("number"==typeof t&&(t=BigInt(t)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof s&&(s=BigInt(s)),s<=0n)throw new RangeError("n must be > 0");if(1n===s)return 0n;if(t=r(t,s),e<0n)return o(f(t,n(e),s,u),s);if(void 0!==u)return function(n,t,e,r){const o=r.map((n=>n[0]**n[1])),s=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}([n]))),u=s.map(((e,r)=>f(n,t%e,o[r])));return i(u,o,e)}(t,e,s,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const e=String(n);void 0===t[e]?t[e]={p:BigInt(n),k:1n}:t[e].k+=1n}else{const e=String(n[0]);void 0===t[e]?t[e]={p:BigInt(n[0]),k:BigInt(n[1])}:t[e].k+=BigInt(n[1])}})),Object.values(t).map((n=>[n.p,n.k]))}(u));let a=1n;for(;e>0;)e%2n===1n&&(a=a*t%s),e/=2n,t=t**2n%s;return a}function g(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}function m(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{m(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function b(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=d(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function h(n,e=1n){if(n<=e)throw new RangeError("Arguments MUST be: max > min");const r=n-e,o=t(r);let i;do{i=g(b(o))}while(i>r);return i+e}let w=!1;function p(n,t=16,e=!1){if("number"==typeof n&&(n=BigInt(n)),n<0n)throw RangeError("w MUST be >= 0");return new Promise(((e,r)=>{const o=new Worker(S());o.onmessage=n=>{void 0!==n?.data?._bcu?.isPrime&&(o.terminate(),e(n.data._bcu.isPrime))},o.onmessageerror=n=>{r(n)};const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}))}function y(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t {${n}})()`;const t=new Blob([n],{type:"text/javascript"});return window.URL.createObjectURL(t)}(n)}function $(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!w){let e=0n;do{e=g(b(n,!0))}while(!y(e,t));return new Promise((n=>{n(e)}))}return new Promise(((e,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();e(r._bcu.value)}else{const e=g(b(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};{const n=S();for(let t=0;ti(n.data,t),o.push(t)}}for(let e=0;e 0");let e=0n;do{e=g(b(n,!0))}while(!y(e,t));return e}void 0!==self.Worker&&(w=!0);export{n as abs,t as bitLength,e as eGcd,s as gcd,p as isProbablyPrime,u as lcm,a as max,c as min,o as modInv,f as modPow,$ as prime,B as primeSync,h as randBetween,l as randBits,b as randBitsSync,m as randBytes,d as randBytesSync,r as toZn}; diff --git a/dist/index.d.ts b/dist/index.d.ts index 48ea84f..3e5f7a4 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,6 +1,19 @@ /// +/** + * Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0 + * + * @param a + * + * @returns The absolute value of a + */ declare function abs(a: number | bigint): number | bigint; +/** + * Returns the (minimum) length of a number expressed in bits. + * + * @param a + * @returns The bit length + */ declare function bitLength(a: number | bigint): number; interface Egcd { @@ -8,33 +21,198 @@ interface Egcd { x: bigint; y: bigint; } +/** + * An iterative implementation of the extended euclidean algorithm or extended greatest common divisor algorithm. + * Take positive integers a, b as input, and return a triple (g, x, y), such that ax + by = g = gcd(a, b). + * + * @param a + * @param b + * + * @throws {@link RangeError} if a or b are <= 0 + * + * @returns A triple (g, x, y), such that ax + by = g = gcd(a, b). + */ declare function eGcd(a: number | bigint, b: number | bigint): Egcd; +/** + * Greatest common divisor of two integers based on the iterative binary algorithm. + * + * @param a + * @param b + * + * @returns The greatest common divisor of a and b + */ declare function gcd(a: number | bigint, b: number | bigint): bigint; +/** + * The least common multiple computed as abs(a*b)/gcd(a,b) + * @param a + * @param b + * + * @returns The least common multiple of a and b + */ declare function lcm(a: number | bigint, b: number | bigint): bigint; +/** + * Maximum. max(a,b)==a if a>=b. max(a,b)==b if a=b. min(a,b)==a if a; +/** + * A probably-prime (Miller-Rabin), cryptographically-secure, random-number generator. + * The browser version uses web workers to parallelise prime look up. Therefore, it does not lock the UI + * main process, and it can be much faster (if several cores or cpu are available). + * The node version can also use worker_threads if they are available (enabled by default with Node 11 and + * and can be enabled at runtime executing node --experimental-worker with node >=10.5.0). + * + * @param bitLength - The required bit length for the generated prime + * @param iterations - The number of iterations for the Miller-Rabin Probabilistic Primality Test + * + * @throws {@link RangeError} if bitLength < 1 + * + * @returns A promise that resolves to a bigint probable prime of bitLength bits. + */ declare function prime(bitLength: number, iterations?: number): Promise; +/** + * A probably-prime (Miller-Rabin), cryptographically-secure, random-number generator. + * The sync version is NOT RECOMMENDED since it won't use workers and thus it'll be slower and may freeze thw window in browser's javascript. Please consider using prime() instead. + * + * @param bitLength - The required bit length for the generated prime + * @param iterations - The number of iterations for the Miller-Rabin Probabilistic Primality Test + * + * @throws {@link RangeError} if bitLength < 1 + * + * @returns A bigint probable prime of bitLength bits. + */ declare function primeSync(bitLength: number, iterations?: number): bigint; +/** + * Returns a cryptographically secure random integer between [min,max]. + * @param max Returned value will be <= max + * @param min Returned value will be >= min + * + * @throws {@link RangeError} if max <= min + * + * @returns A cryptographically secure random bigint between [min,max] + */ declare function randBetween(max: bigint, min?: bigint): bigint; +/** + * Secure random bits for both node and browsers. Node version uses crypto.randomFill() and browser one self.crypto.getRandomValues() + * + * @param bitLength - The desired number of random bits + * @param forceLength - Set to true if you want to force the output to have a specific bit length. It basically forces the msb to be 1 + * + * @throws {@link RangeError} if bitLength < 1 + * + * @returns A Promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cryptographically secure random bits + */ declare function randBits(bitLength: number, forceLength?: boolean): Promise; +/** + * Secure random bits for both node and browsers. Node version uses crypto.randomFill() and browser one self.crypto.getRandomValues() + * @param bitLength - The desired number of random bits + * @param forceLength - Set to true if you want to force the output to have a specific bit length. It basically forces the msb to be 1 + * + * @throws {@link RangeError} if bitLength < 1 + * + * @returns A Uint8Array/Buffer (Browser/Node.js) filled with cryptographically secure random bits + */ declare function randBitsSync(bitLength: number, forceLength?: boolean): Uint8Array | Buffer; +/** + * Secure random bytes for both node and browsers. Node version uses crypto.randomBytes() and browser one self.crypto.getRandomValues() + * + * @param byteLength - The desired number of random bytes + * @param forceLength - Set to true if you want to force the output to have a bit length of 8*byteLength. It basically forces the msb to be 1 + * + * @throws {@link RangeError} if byteLength < 1 + * + * @returns A promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cryptographically secure random bytes + */ declare function randBytes(byteLength: number, forceLength?: boolean): Promise; +/** + * Secure random bytes for both node and browsers. Node version uses crypto.randomFill() and browser one self.crypto.getRandomValues() + * This is the synchronous version, consider using the asynchronous one for improved efficiency. + * + * @param byteLength - The desired number of random bytes + * @param forceLength - Set to true if you want to force the output to have a bit length of 8*byteLength. It basically forces the msb to be 1 + * + * @throws {@link RangeError} if byteLength < 1 + * + * @returns A UInt8Array/Buffer (Browser/Node.js) filled with cryptographically secure random bytes + */ declare function randBytesSync(byteLength: number, forceLength?: boolean): Uint8Array | Buffer; export { abs, bitLength, eGcd, gcd, isProbablyPrime, lcm, max, min, modInv, modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, toZn }; diff --git a/dist/index.node.cjs b/dist/index.node.cjs index 90423f0..da9c226 100644 --- a/dist/index.node.cjs +++ b/dist/index.node.cjs @@ -1,2 +1,2 @@ -"use strict";function n(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let e=1;do{e++}while((n>>=1n)>1n);return e}function t(n,e){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),n<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const u=e/n,s=e%n,c=t-o*u,f=r-i*u;e=n,n=s,t=o,r=i,o=c,i=f}return{g:e,x:t,y:r}}function r(e,t){let r="number"==typeof e?BigInt(n(e)):n(e),o="number"==typeof t?BigInt(n(t)):n(t);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");const t=n%e;return t<0n?t+e:t}function i(n,e){const r=t(o(n,e),e);if(1n!==r.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${e.toString()}`);return o(r.x,e)}function u(e,t,r){if("number"==typeof e&&(e=BigInt(e)),"number"==typeof t&&(t=BigInt(t)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(e=o(e,r),t<0n)return i(u(e,n(t),r),r);let s=1n;for(;t>0;)t%2n===1n&&(s=s*e%r),t/=2n,e=e**2n%r;return s}function s(n){let e=0n;for(const t of n.values()){e=(e<<8n)+BigInt(t)}return e}var c=require("crypto");function f(n,e=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(t,r){c.randomBytes(n,(function(n,o){null!==n&&r(n),e&&(o[0]=128|o[0]),t(o)}))}))}function a(n,e=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const t=c.randomBytes(n);return e&&(t[0]=128|t[0]),t}}function g(n,e=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const t=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{f(t,!1).then((function(t){if(0!==r&&(t[0]=t[0]&2**r-1),e){const n=0!==r?2**(r-1):128;t[0]=t[0]|n}n(t)}))}))}function b(n,e=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const t=a(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(t[0]=t[0]&2**r-1),e){const n=0!==r?2**(r-1):128;t[0]=t[0]|n}return t}function h(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=s(b(o))}while(i>r);return i+t}let l=!1;try{require("worker_threads"),l=!0}catch(r){console.log("[bigint-crypto-utils] WARNING:\nThis node version doesn't support worker_threads. You should enable them in order to greatly speedup the generation of big prime numbers.\n · With Node >=11 it is enabled by default (consider upgrading).\n · With Node 10, starting with 10.5.0, you can enable worker_threads at runtime executing node --experimental-worker ")}function d(n,e){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const t=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let e=0;e= 0");return new Promise(!t&&l?(t,r)=>{const o=new p.Worker(__filename);o.on("message",(n=>{void 0!==n?._bcu?.isPrime&&(o.terminate().catch(r),t(n._bcu.isPrime))})),o.on("error",r);const i={_bcu:{rnd:n,iterations:e,id:0}};o.postMessage(i)}:t=>{t(d(n,e))})},exports.lcm=function(e,t){return"number"==typeof e&&(e=BigInt(e)),"number"==typeof t&&(t=BigInt(t)),0n===e&&0n===t?BigInt(0):n(e/r(e,t)*t)},exports.max=function(n,e){return n>=e?n:e},exports.min=function(n,e){return n>=e?e:n},exports.modInv=i,exports.modPow=u,exports.prime=function(n,e=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!l){let t=0n;do{t=s(b(n,!0))}while(!d(t,e));return new Promise((n=>{n(t)}))}return new Promise(((t,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();t(r._bcu.value)}else{const t=s(b(n,!0));try{const n={_bcu:{rnd:t,iterations:e,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};for(let n=0;ni(e,n))),o.push(n)}for(let t=0;t 0");let t=0n;do{t=s(b(n,!0))}while(!d(t,e));return t},exports.randBetween=h,exports.randBits=g,exports.randBitsSync=b,exports.randBytes=f,exports.randBytesSync=a,exports.toZn=o; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9iaWdpbnQtbW9kLWFyaXRoL2Rpc3QvaW5kZXgubm9kZS5lc20uanMiLCIuLi9zcmMvdHMvZnJvbUJ1ZmZlci50cyIsIi4uL3NyYy90cy9yYW5kQnl0ZXMudHMiLCIuLi9zcmMvdHMvcmFuZEJpdHMudHMiLCIuLi9zcmMvdHMvcmFuZEJldHdlZW4udHMiLCIuLi9zcmMvdHMvd29ya2VyVXRpbHMudHMiLCIuLi9zcmMvdHMvaXNQcm9iYWJseVByaW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W9CLEdBQUlILEVBQUlELEtBQUtJLEtBR2pCWSxFQUFVWCxZQUFZYSxFQUN2QixDQUFDLE1BQU9aLEdBRVIsQ0FDRixHQVVELElBQUssSUFBSWhFLEVBQUksRUFBR0EsRUFBSWlFLEVBQUdZLE9BQU9qQyxPQUFTLEVBQUc1QyxJQUFLLENBQzdDLE1BQU0wRSxFQUFZLElBQUlyQixFQUFjZSxPQUFPQyxZQUMzQ0ssRUFBVW5CLEdBQUcsV0FBWUksR0FBeUJjLEVBQVdkLEVBQUtlLEtBQ2xFRixFQUFXTSxLQUFLSixFQUNqQixDQUVILElBQUssSUFBSTFFLEVBQUksRUFBR0EsRUFBSXdFLEVBQVc1QixPQUFRNUMsSUFDckNzQixFQUFTQyxHQUFXLEdBQU1JLE1BQUssU0FBVW5CLEdBQ3ZDLE1BQU00QixFQUFNN0IsRUFBV0MsR0FDdkJnRSxFQUFXeEUsR0FBRytELFlBQVksQ0FDeEJMLEtBQU0sQ0FDSnRCLE1BQ0FNLGFBQ0FvQixHQUFJOUQsSUFHVixJQUFHdUUsTUFBTXJELEVBQ1YsR0FFTCw2QkFhMkJLLEVBQW1CbUIsRUFBcUIsSUFDakUsR0FBSW5CLEVBQVksRUFBRyxNQUFNLElBQUkzQixXQUFXLHlCQUN4QyxJQUFJd0MsRUFBTSxHQUNWLEdBQ0VBLEVBQU03QixFQUFXdUIsRUFBYVAsR0FBVyxXQUNqQ2lCLEVBQWlCSixFQUFLTSxJQUNoQyxPQUFPTixDQUNUIiwieF9nb29nbGVfaWdub3JlTGlzdCI6WzBdfQ== +"use strict";function n(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let e=1;do{e++}while((n>>=1n)>1n);return e}function t(n,e){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),n<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const u=e/n,s=e%n,c=t-o*u,f=r-i*u;e=n,n=s,t=o,r=i,o=c,i=f}return{g:e,x:t,y:r}}function r(n,e){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");const t=n%e;return t<0n?t+e:t}function o(n,e){const o=t(r(n,e),e);if(1n!==o.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${e.toString()}`);return r(o.x,e)}function i(n,e,t){if(n.length!==e.length)throw new RangeError("The remainders and modulos arrays should have the same length");const i=t??e.reduce(((n,e)=>n*e),1n);return e.reduce(((e,t,u)=>{const s=i/t;return r(e+s*o(s,t)%i*n[u]%i,i)}),0n)}function u(e,t){let r="number"==typeof e?BigInt(n(e)):n(e),o="number"==typeof t?BigInt(n(t)):n(t);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r< 0");if(1n===u)return 0n;if(e=r(e,u),t<0n)return o(s(e,n(t),u,c),u);if(void 0!==c)return function(n,e,t,r){const o=r.map((n=>n[0]**n[1])),u=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,e)=>e*n),1n)}([n]))),c=u.map(((t,r)=>s(n,e%t,o[r])));return i(c,o,t)}(e,t,u,function(n){const e={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const t=String(n);void 0===e[t]?e[t]={p:BigInt(n),k:1n}:e[t].k+=1n}else{const t=String(n[0]);void 0===e[t]?e[t]={p:BigInt(n[0]),k:BigInt(n[1])}:e[t].k+=BigInt(n[1])}})),Object.values(e).map((n=>[n.p,n.k]))}(c));let f=1n;for(;t>0;)t%2n===1n&&(f=f*e%u),t/=2n,e=e**2n%u;return f}function c(n){let e=0n;for(const t of n.values()){e=(e<<8n)+BigInt(t)}return e}var f=require("crypto");function a(n,e=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(t,r){f.randomBytes(n,(function(n,o){null!==n&&r(n),e&&(o[0]=128|o[0]),t(o)}))}))}function g(n,e=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const t=f.randomBytes(n);return e&&(t[0]=128|t[0]),t}}function h(n,e=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const t=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{a(t,!1).then((function(t){if(0!==r&&(t[0]=t[0]&2**r-1),e){const n=0!==r?2**(r-1):128;t[0]=t[0]|n}n(t)}))}))}function d(n,e=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const t=g(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(t[0]=t[0]&2**r-1),e){const n=0!==r?2**(r-1):128;t[0]=t[0]|n}return t}function p(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=c(d(o))}while(i>r);return i+t}let l=!1;try{require("worker_threads"),l=!0}catch(r){console.log("[bigint-crypto-utils] WARNING:\nThis node version doesn't support worker_threads. You should enable them in order to greatly speedup the generation of big prime numbers.\n · With Node >=11 it is enabled by default (consider upgrading).\n · With Node 10, starting with 10.5.0, you can enable worker_threads at runtime executing node --experimental-worker ")}function b(n,e){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const t=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let e=0;e= 0");return new Promise(!t&&l?(t,r)=>{const o=new m.Worker(__filename);o.on("message",(n=>{void 0!==n?._bcu?.isPrime&&(o.terminate().catch(r),t(n._bcu.isPrime))})),o.on("error",r);const i={_bcu:{rnd:n,iterations:e,id:0}};o.postMessage(i)}:t=>{t(b(n,e))})},exports.lcm=function(e,t){return"number"==typeof e&&(e=BigInt(e)),"number"==typeof t&&(t=BigInt(t)),0n===e&&0n===t?BigInt(0):n(e/u(e,t)*t)},exports.max=function(n,e){return n>=e?n:e},exports.min=function(n,e){return n>=e?e:n},exports.modInv=o,exports.modPow=s,exports.prime=function(n,e=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!l){let t=0n;do{t=c(d(n,!0))}while(!b(t,e));return new Promise((n=>{n(t)}))}return new Promise(((t,r)=>{const o=[],i=(r,i)=>{if(r._bcu.isPrime){for(let n=0;n0;)o.pop();t(r._bcu.value)}else{const t=c(d(n,!0));try{const n={_bcu:{rnd:t,iterations:e,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};for(let n=0;ni(e,n))),o.push(n)}for(let t=0;t 0");let t=0n;do{t=c(d(n,!0))}while(!b(t,e));return t},exports.randBetween=p,exports.randBits=h,exports.randBitsSync=d,exports.randBytes=a,exports.randBytesSync=g,exports.toZn=r; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9iaWdpbnQtbW9kLWFyaXRoL2Rpc3QvaW5kZXgubm9kZS5lc20uanMiLCIuLi9zcmMvdHMvZnJvbUJ1ZmZlci50cyIsIi4uL3NyYy90cy9yYW5kQnl0ZXMudHMiLCIuLi9zcmMvdHMvcmFuZEJpdHMudHMiLCIuLi9zcmMvdHMvcmFuZEJldHdlZW4udHMiLCIuLi9zcmMvdHMvd29ya2VyVXRpbHMudHMiLCIuLi9zcmMvdHMvaXNQcm9iYWJseVByaW1lLnRzIiwiLi4vc3JjL3RzL3ByaW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpudWxsLCJuYW1lcyI6WyJuIiwidCIsIkJpZ0ludCIsInIiLCJSYW5nZUVycm9yIiwiZSIsIm8iLCJpIiwidSIsImYiLCJnIiwiYyIsIngiLCJ5IiwidG9TdHJpbmciLCJsZW5ndGgiLCJyZWR1Y2UiLCJzIiwibWFwIiwiYSIsImZvckVhY2giLCJTdHJpbmciLCJwIiwiayIsIk9iamVjdCIsInZhbHVlcyIsImZyb21CdWZmZXIiLCJidWYiLCJyZXQiLCJjcnlwdG8iLCJyZXF1aXJlIiwicmFuZEJ5dGVzIiwiYnl0ZUxlbmd0aCIsImZvcmNlTGVuZ3RoIiwiUHJvbWlzZSIsInJlc29sdmUiLCJyZWplY3QiLCJyYW5kb21CeXRlcyIsImVyciIsInJhbmRCeXRlc1N5bmMiLCJyYW5kQml0cyIsImJpdExlbmd0aCIsIk1hdGgiLCJjZWlsIiw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1rRCxFQUErQixDQUNuQ2xCLEtBQU0sQ0FDSm5CLE1BQ0FNLGFBQ0FpQixHQUFJSCxFQUFJRCxLQUFLSSxLQUdqQlksRUFBVVgsWUFBWWEsRUFDdkIsQ0FBQyxNQUFPWixHQUVSLENBQ0YsR0FVRCxJQUFLLElBQUl4RSxFQUFJLEVBQUdBLEVBQUl5RSxFQUFHWSxPQUFPN0UsT0FBUyxFQUFHUixJQUFLLENBQzdDLE1BQU1rRixFQUFZLElBQUlyQixFQUFjZSxPQUFPQyxZQUMzQ0ssRUFBVW5CLEdBQUcsV0FBWUksR0FBeUJjLEVBQVdkLEVBQUtlLEtBQ2xFRixFQUFXTSxLQUFLSixFQUNqQixDQUVILElBQUssSUFBSWxGLEVBQUksRUFBR0EsRUFBSWdGLEVBQVd4RSxPQUFRUixJQUNyQ2lDLEVBQVNDLEdBQVcsR0FBTUksTUFBSyxTQUFVbEIsR0FDdkMsTUFBTTJCLEVBQU01QixFQUFXQyxHQUN2QjRELEVBQVdoRixHQUFHdUUsWUFBWSxDQUN4QkwsS0FBTSxDQUNKbkIsTUFDQU0sYUFDQWlCLEdBQUl0RSxJQUdWLElBQUcrRSxNQUFNbEQsRUFDVixHQUVMLDZCQWEyQkssRUFBbUJtQixFQUFxQixJQUNqRSxHQUFJbkIsRUFBWSxFQUFHLE1BQU0sSUFBSXJDLFdBQVcseUJBQ3hDLElBQUlrRCxFQUFNLEdBQ1YsR0FDRUEsRUFBTTVCLEVBQVdzQixFQUFhUCxHQUFXLFdBQ2pDaUIsRUFBaUJKLEVBQUtNLElBQ2hDLE9BQU9OLENBQ1QiLCJ4X2dvb2dsZV9pZ25vcmVMaXN0IjpbMF19 diff --git a/dist/index.node.esm.js b/dist/index.node.esm.js index 15aaa51..7b96b95 100644 --- a/dist/index.node.esm.js +++ b/dist/index.node.esm.js @@ -1,2 +1,2 @@ -import{fileURLToPath as n}from"url";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const u=t/n,s=t%n,a=e-o*u,c=r-i*u;t=n,n=s,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function o(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function s(n,t){return n>=t?t:n}function a(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function c(n,t){const e=r(a(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return a(e.x,t)}function f(n,e,r){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(n=a(n,r),e<0n)return c(f(n,t(e),r),r);let o=1n;for(;e>0;)e%2n===1n&&(o=o*n%r),e/=2n,n=n**2n%r;return o}function g(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}var m=await import("crypto");function b(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){m.randomBytes(n,(function(n,o){null!==n&&r(n),t&&(o[0]=128|o[0]),e(o)}))}))}function h(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=m.randomBytes(n);return t&&(e[0]=128|e[0]),e}}function l(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{b(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function w(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=h(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function d(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=g(w(o))}while(i>r);return i+t}let p=!1;try{await import("worker_threads"),p=!0}catch(o){console.log("[bigint-crypto-utils] WARNING:\nThis node version doesn't support worker_threads. You should enable them in order to greatly speedup the generation of big prime numbers.\n · With Node >=11 it is enabled by default (consider upgrading).\n · With Node 10, starting with 10.5.0, you can enable worker_threads at runtime executing node --experimental-worker ")}function y(t,e=16,r=!1){if("number"==typeof t&&(t=BigInt(t)),t<0n)throw RangeError("w MUST be >= 0");return new Promise(!r&&p?(r,o)=>{const i=new B.Worker(n(import.meta.url));i.on("message",(n=>{void 0!==n?._bcu?.isPrime&&(i.terminate().catch(o),r(n._bcu.isPrime))})),i.on("error",o);const u={_bcu:{rnd:t,iterations:e,id:0}};i.postMessage(u)}:n=>{n(_(t,e))})}function _(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t 0");if(!p){let n=0n;do{n=g(w(t,!0))}while(!_(n,e));return new Promise((t=>{t(n)}))}return new Promise(((r,o)=>{const i=[],u=(n,o)=>{if(n._bcu.isPrime){for(let n=0;n0;)i.pop();r(n._bcu.value)}else{const r=g(w(t,!0));try{const t={_bcu:{rnd:r,iterations:e,id:n._bcu.id}};o.postMessage(t)}catch(n){}}};for(let t=0;tu(n,t))),i.push(t)}for(let n=0;n 0");let e=0n;do{e=g(w(n,!0))}while(!_(e,t));return e}export{t as abs,e as bitLength,r as eGcd,o as gcd,y as isProbablyPrime,i as lcm,u as max,s as min,c as modInv,f as modPow,v as prime,R as primeSync,d as randBetween,l as randBits,w as randBitsSync,b as randBytes,h as randBytesSync,a as toZn}; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5lc20uanMiLCJzb3VyY2VzIjpbI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kIsRUFBWSxFQUFHLE1BQU0sSUFBSTNCLFdBQVcseUJBQ3hDLElBQUl3QyxFQUFNLEdBQ1YsR0FDRUEsRUFBTTdCLEVBQVd1QixFQUFhUCxHQUFXLFdBQ2pDb0MsRUFBaUJ2QixFQUFLTSxJQUNoQyxPQUFPTixDQUNUIiwieF9nb29nbGVfaWdub3JlTGlzdCI6WzBdfQ== +import{fileURLToPath as n}from"url";function t(n){return n>=0?n:-n}function e(n){if("number"==typeof n&&(n=BigInt(n)),1n===n)return 1;let t=1;do{t++}while((n>>=1n)>1n);return t}function r(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),n<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let e=0n,r=1n,o=1n,i=0n;for(;0n!==n;){const u=t/n,s=t%n,a=e-o*u,c=r-i*u;t=n,n=s,e=o,r=i,o=a,i=c}return{g:t,x:e,y:r}}function o(n,t){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof t&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");const e=n%t;return e<0n?e+t:e}function i(n,t){const e=r(o(n,t),t);if(1n!==e.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return o(e.x,t)}function u(n,t,e){if(n.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");const r=e??t.reduce(((n,t)=>n*t),1n);return t.reduce(((t,e,u)=>{const s=r/e;return o(t+s*i(s,e)%r*n[u]%r,r)}),0n)}function s(n,e){let r="number"==typeof n?BigInt(t(n)):t(n),o="number"==typeof e?BigInt(t(e)):t(e);if(0n===r)return o;if(0n===o)return r;let i=0n;for(;0n===(1n&(r|o));)r>>=1n,o>>=1n,i++;for(;0n===(1n&r);)r>>=1n;do{for(;0n===(1n&o);)o>>=1n;if(r>o){const n=r;r=o,o=n}o-=r}while(0n!==o);return r<=t?n:t}function f(n,t){return n>=t?t:n}function g(n,e,r,s){if("number"==typeof n&&(n=BigInt(n)),"number"==typeof e&&(e=BigInt(e)),"number"==typeof r&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(1n===r)return 0n;if(n=o(n,r),e<0n)return i(g(n,t(e),r,s),r);if(void 0!==s)return function(n,t,e,r){const o=r.map((n=>n[0]**n[1])),i=r.map((n=>function(n){return n.map((n=>n[0]**(n[1]-1n)*(n[0]-1n))).reduce(((n,t)=>t*n),1n)}([n]))),s=i.map(((e,r)=>g(n,t%e,o[r])));return u(s,o,e)}(n,e,r,function(n){const t={};return n.forEach((n=>{if("bigint"==typeof n||"number"==typeof n){const e=String(n);void 0===t[e]?t[e]={p:BigInt(n),k:1n}:t[e].k+=1n}else{const e=String(n[0]);void 0===t[e]?t[e]={p:BigInt(n[0]),k:BigInt(n[1])}:t[e].k+=BigInt(n[1])}})),Object.values(t).map((n=>[n.p,n.k]))}(s));let a=1n;for(;e>0;)e%2n===1n&&(a=a*n%r),e/=2n,n=n**2n%r;return a}function m(n){let t=0n;for(const e of n.values()){t=(t<<8n)+BigInt(e)}return t}var h=await import("crypto");function l(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){h.randomBytes(n,(function(n,o){null!==n&&r(n),t&&(o[0]=128|o[0]),e(o)}))}))}function b(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=h.randomBytes(n);return t&&(e[0]=128|e[0]),e}}function d(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=Math.ceil(n/8),r=n%8;return new Promise(((n,o)=>{l(e,!1).then((function(e){if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}n(e)}))}))}function w(n,t=!1){if(n<1)throw new RangeError("bitLength MUST be > 0");const e=b(Math.ceil(n/8),!1),r=n%8;if(0!==r&&(e[0]=e[0]&2**r-1),t){const n=0!==r?2**(r-1):128;e[0]=e[0]|n}return e}function p(n,t=1n){if(n<=t)throw new RangeError("Arguments MUST be: max > min");const r=n-t,o=e(r);let i;do{i=m(w(o))}while(i>r);return i+t}let y=!1;try{await import("worker_threads"),y=!0}catch(o){console.log("[bigint-crypto-utils] WARNING:\nThis node version doesn't support worker_threads. You should enable them in order to greatly speedup the generation of big prime numbers.\n · With Node >=11 it is enabled by default (consider upgrading).\n · With Node 10, starting with 10.5.0, you can enable worker_threads at runtime executing node --experimental-worker ")}function B(t,e=16,r=!1){if("number"==typeof t&&(t=BigInt(t)),t<0n)throw RangeError("w MUST be >= 0");return new Promise(!r&&y?(r,o)=>{const i=new _.Worker(n(import.meta.url));i.on("message",(n=>{void 0!==n?._bcu?.isPrime&&(i.terminate().catch(o),r(n._bcu.isPrime))})),i.on("error",o);const u={_bcu:{rnd:t,iterations:e,id:0}};i.postMessage(u)}:n=>{n(I(t,e))})}function I(n,t){if(2n===n)return!0;if(0n===(1n&n)||1n===n)return!1;const e=[3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n,1009n,1013n,1019n,1021n,1031n,1033n,1039n,1049n,1051n,1061n,1063n,1069n,1087n,1091n,1093n,1097n,1103n,1109n,1117n,1123n,1129n,1151n,1153n,1163n,1171n,1181n,1187n,1193n,1201n,1213n,1217n,1223n,1229n,1231n,1237n,1249n,1259n,1277n,1279n,1283n,1289n,1291n,1297n,1301n,1303n,1307n,1319n,1321n,1327n,1361n,1367n,1373n,1381n,1399n,1409n,1423n,1427n,1429n,1433n,1439n,1447n,1451n,1453n,1459n,1471n,1481n,1483n,1487n,1489n,1493n,1499n,1511n,1523n,1531n,1543n,1549n,1553n,1559n,1567n,1571n,1579n,1583n,1597n];for(let t=0;t 0");if(!y){let n=0n;do{n=m(w(t,!0))}while(!I(n,e));return new Promise((t=>{t(n)}))}return new Promise(((r,o)=>{const i=[],u=(n,o)=>{if(n._bcu.isPrime){for(let n=0;n0;)i.pop();r(n._bcu.value)}else{const r=m(w(t,!0));try{const t={_bcu:{rnd:r,iterations:e,id:n._bcu.id}};o.postMessage(t)}catch(n){}}};for(let t=0;tu(n,t))),i.push(t)}for(let n=0;n 0");let e=0n;do{e=m(w(n,!0))}while(!I(e,t));return e}export{t as abs,e as bitLength,r as eGcd,s as gcd,B as isProbablyPrime,a as lcm,c as max,f as min,i as modInv,g as modPow,E as prime,R as primeSync,p as randBetween,d as randBits,w as randBitsSync,l as randBytes,b as randBytesSync,o as toZn}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5lc20uanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9iaWdpbnQtbW9kLWFyaXRoL2Rpc3QvaW5kZXgubm9kZS5lc20uanMiLCIuLi9zcmMvdHMvZnJvbUJ1ZmZlci50cyIsIi4uL3NyYy90cy9yYW5kQnl0ZXMudHMiLCIuLi9zcmMvdHMvcmFuZEJpdHMudHMiLCIuLi9zcmMvdHMvcmFuZEJldHdlZW4udHMiLCIuLi9zcmMvdHMvd29ya2VyVXRpbHMudHMiLCIuLi9zcmMvdHMvaXNQcm9iYWJseVByaW1lLnRzIiwiLi4vc3JjL3RzL3By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ENBRUgsSUFBSyxJQUFJckYsRUFBSSxFQUFHQSxFQUFJbUYsRUFBVzNFLE9BQVFSLElBQ3JDaUMsRUFBU0MsR0FBVyxHQUFNSSxNQUFLLFNBQVVsQixHQUN2QyxNQUFNMkIsRUFBTTVCLEVBQVdDLEdBQ3ZCK0QsRUFBV25GLEdBQUdxRSxZQUFZLENBQ3hCTixLQUFNLENBQ0poQixNQUNBTSxhQUNBZSxHQUFJcEUsSUFHVixJQUFHa0UsTUFBTXJDLEVBQ1YsR0FFTCxVQWFnQjZELEVBQVd4RCxFQUFtQm1CLEVBQXFCLElBQ2pFLEdBQUluQixFQUFZLEVBQUcsTUFBTSxJQUFJckMsV0FBVyx5QkFDeEMsSUFBSWtELEVBQU0sR0FDVixHQUNFQSxFQUFNNUIsRUFBV3NCLEVBQWFQLEdBQVcsV0FDakNvQyxFQUFpQnZCLEVBQUtNLElBQ2hDLE9BQU9OLENBQ1QiLCJ4X2dvb2dsZV9pZ25vcmVMaXN0IjpbMF19 diff --git a/docs/API.md b/docs/API.md index 54f3cfd..e42499b 100644 --- a/docs/API.md +++ b/docs/API.md @@ -29,6 +29,8 @@ ▸ **abs**(`a`): `number` \| `bigint` +Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0 + #### Parameters | Name | Type | @@ -39,9 +41,7 @@ `number` \| `bigint` -#### Defined in - -node_modules/bigint-mod-arith/dist/index.d.ts:1 +The absolute value of a ___ @@ -49,6 +49,8 @@ ___ ▸ **bitLength**(`a`): `number` +Returns the (minimum) length of a number expressed in bits. + #### Parameters | Name | Type | @@ -59,9 +61,7 @@ ___ `number` -#### Defined in - -node_modules/bigint-mod-arith/dist/index.d.ts:3 +The bit length ___ @@ -69,6 +69,13 @@ ___ ▸ **eGcd**(`a`, `b`): `Egcd` +An iterative implementation of the extended euclidean algorithm or extended greatest common divisor algorithm. +Take positive integers a, b as input, and return a triple (g, x, y), such that ax + by = g = gcd(a, b). + +**`Throws`** + +RangeError if a or b are <= 0 + #### Parameters | Name | Type | @@ -80,9 +87,7 @@ ___ `Egcd` -#### Defined in - -node_modules/bigint-mod-arith/dist/index.d.ts:10 +A triple (g, x, y), such that ax + by = g = gcd(a, b). ___ @@ -90,6 +95,8 @@ ___ ▸ **gcd**(`a`, `b`): `bigint` +Greatest common divisor of two integers based on the iterative binary algorithm. + #### Parameters | Name | Type | @@ -101,9 +108,7 @@ ___ `bigint` -#### Defined in - -node_modules/bigint-mod-arith/dist/index.d.ts:12 +The greatest common divisor of a and b ___ @@ -132,16 +137,14 @@ RangeError if w<0 A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) -#### Defined in - -[src/ts/isProbablyPrime.ts:20](https://github.com/juanelas/bigint-crypto-utils/blob/f4ea3d5/src/ts/isProbablyPrime.ts#L20) - ___ ### lcm ▸ **lcm**(`a`, `b`): `bigint` +The least common multiple computed as abs(a*b)/gcd(a,b) + #### Parameters | Name | Type | @@ -153,9 +156,7 @@ ___ `bigint` -#### Defined in - -node_modules/bigint-mod-arith/dist/index.d.ts:14 +The least common multiple of a and b ___ @@ -163,6 +164,8 @@ ___ ▸ **max**(`a`, `b`): `number` \| `bigint` +Maximum. max(a,b)==a if a>=b. max(a,b)==b if a=b. min(a,b)==a if a=14.0.0" @@ -397,17 +397,16 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-0.4.1.tgz", - "integrity": "sha512-4IICvy1McAkT/HyNZHIs7sp8ngBX1dmO0TPQ+FWq9ATQMqI8p+Ulm5A3kS2wYDh5HDHHkYrrETOu6rlj64VuTw==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.4.2.tgz", + "integrity": "sha512-5MLU1RFaJh1Beb9FH6raowtZErcsZ0ojYJvdG3OWXfnc3wZiDAa0PgXU2QOKtbW2S+Z731K/2n3YczGA3KbLbQ==", "dev": true, "dependencies": { "debug": "4.3.4", "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.1", "progress": "2.0.3", - "proxy-from-env": "1.1.0", - "tar-fs": "2.1.1", + "proxy-agent": "6.2.1", + "tar-fs": "3.0.2", "unbzip2-stream": "1.4.3", "yargs": "17.7.1" }, @@ -415,7 +414,7 @@ "browsers": "lib/cjs/main-cli.js" }, "engines": { - "node": ">=14.1.0" + "node": ">=16.3.0" }, "peerDependencies": { "typescript": ">= 4.7.4" @@ -468,9 +467,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.1.0.tgz", - "integrity": "sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==", + "version": "25.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.2.tgz", + "integrity": "sha512-NGTwaJxIO0klMs+WSFFtBP7b9TdTJ3K76HZkewT8/+yHzMiUGVQgaPtLQxNVYIgT5F7lxkEyVID+yS3K7bhCow==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -756,9 +755,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "version": "20.3.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.2.tgz", + "integrity": "sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==", "dev": true, "optional": true }, @@ -1074,16 +1073,25 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ajv": { @@ -1259,6 +1267,18 @@ "node": "*" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -1271,6 +1291,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "dev": true + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1297,10 +1323,19 @@ } ] }, + "node_modules/basic-ftp": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", + "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/bigint-mod-arith": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.2.1.tgz", - "integrity": "sha512-roLlzeQ0okNjT8Ph9zL9Nvw85ucHSQkNndLRfAR2CVaYOEAMtbpIK3f6oJb3Jv/hg9mkrYaw/DknysTuvc8QhA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.3.1.tgz", + "integrity": "sha512-pX/cYW3dCa87Jrzv6DAr8ivbbJRzEX5yGhdt8IutnX/PCIXfpx+mabWNK/M8qqh+zQ0J3thftUBHW0ByuUlG0w==", "dev": true, "engines": { "node": ">=10.4.0" @@ -1315,17 +1350,6 @@ "node": ">=8" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1441,9 +1465,9 @@ } }, "node_modules/c8": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-7.13.0.tgz", - "integrity": "sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-8.0.0.tgz", + "integrity": "sha512-XHA5vSfCLglAc0Xt8eLBZMv19lgiBSjnb1FLAQgnwkuhJYEonpilhEB4Ea3jPAbm0FhD6VVJrc0z73jPe7JyGQ==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", @@ -1463,7 +1487,7 @@ "c8": "bin/c8.js" }, "engines": { - "node": ">=10.12.0" + "node": ">=12" } }, "node_modules/c8/node_modules/brace-expansion": { @@ -1627,16 +1651,10 @@ "fsevents": "~2.3.2" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "node_modules/chromium-bidi": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.6.tgz", - "integrity": "sha512-TQOkWRaLI/IWvoP8XC+7jO4uHTIiAUiklXU1T0qszlUFEai9LgKXIBXy3pOS3EnQZ3bQtMbKUPkug0fTAEHCSw==", + "version": "0.4.12", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.12.tgz", + "integrity": "sha512-yl0ngMHtYUGJa2G0lkcbPvbnUZ9WMQyMNSfYmlrGD1nHRNyI9KOGw3dOaofFugXHHToneUaSmF9iUdgCBamCjA==", "dev": true, "dependencies": { "mitt": "3.0.0" @@ -1699,9 +1717,9 @@ "dev": true }, "node_modules/cosmiconfig": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", - "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, "dependencies": { "import-fresh": "^3.2.1", @@ -1717,12 +1735,12 @@ } }, "node_modules/cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", + "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", "dev": true, "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.11" } }, "node_modules/cross-spawn": { @@ -1739,6 +1757,15 @@ "node": ">= 8" } }, + "node_modules/data-uri-to-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz", + "integrity": "sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1817,10 +1844,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/degenerator": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-4.0.3.tgz", + "integrity": "sha512-2wY8vmCfxrQpe2PKGYdiWRre5HQRwsAXbAAWRbC+z2b80MEpnWc8A3a9k4TwqwN3Z/Fm3uhNm5vYUZIbMhyRxQ==", + "dev": true, + "dependencies": { + "ast-types": "^0.13.2", + "escodegen": "^1.8.1", + "esprima": "^4.0.0", + "vm2": "^3.9.19" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/devtools-protocol": { - "version": "0.0.1107588", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1107588.tgz", - "integrity": "sha512-yIR+pG9x65Xko7bErCUSQaDLrO/P1p3JUzEk7JCU4DowPcGHkTGUGQapcfcLc4qj0UaALwZ+cr0riFgiqpixcg==", + "version": "0.0.1135028", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1135028.tgz", + "integrity": "sha512-jEcNGrh6lOXNRJvZb9RjeevtZGrgugPKSMJZxfyxWQnhlKawMPhMtk/dfC+Z/6xNXExlzTKlY5LzIAK/fRpQIw==", "dev": true }, "node_modules/diff": { @@ -1998,6 +2040,88 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/eslint": { "version": "8.38.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz", @@ -2575,6 +2699,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -2649,6 +2786,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", + "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -2842,11 +2985,19 @@ "node": ">=8.0.0" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -2976,6 +3127,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-uri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.1.tgz", + "integrity": "sha512-7ZqONUVqaabogsYNWlYj0t3YZaL6dhuEueZXGF+/YVmf6dHmaFg8/6psJKqhx9QykIDKzpGcy2cn4oV4YC7V/Q==", + "dev": true, + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^5.0.1", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/glob": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.0.0.tgz", @@ -3203,17 +3369,30 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz", + "integrity": "sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/ieee754": { @@ -3300,6 +3479,12 @@ "node": ">= 0.4" } }, + "node_modules/ip": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "dev": true + }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -3726,6 +3911,15 @@ "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", @@ -4195,6 +4389,15 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4202,9 +4405,9 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -4607,6 +4810,38 @@ "node": ">=6" } }, + "node_modules/pac-proxy-agent": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-6.0.3.tgz", + "integrity": "sha512-5Hr1KgPDoc21Vn3rsXBirwwDnF/iac1jN/zkpsOYruyT+ZgsUhUOgVwq3v9+ukjZd/yGm/0nzO1fDfl7rkGoHQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "pac-resolver": "^6.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-6.0.1.tgz", + "integrity": "sha512-dg497MhVT7jZegPRuOScQ/z0aV/5WR0gTdRu1md+Irs9J9o+ls5jIuxjo1WfaTG+eQQkxyn5HMGvWK+w7EIBkQ==", + "dev": true, + "dependencies": { + "degenerator": "^4.0.1", + "ip": "^1.1.5", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4891,6 +5126,34 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.2.1.tgz", + "integrity": "sha512-OIbBKlRAT+ycCm6wAYIzMwPejzRtjy8F3QiDX0eKOA3e4pe3U9F/IvzcHP42bmgQxVv97juG+J8/gx+JIeCX/Q==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^6.0.3", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -4917,40 +5180,35 @@ } }, "node_modules/puppeteer": { - "version": "19.9.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-19.9.0.tgz", - "integrity": "sha512-JDx8WwGlkdQYTaa3OMYDF+uFWimiwNnacg5FGEC5J6+VxDsLK30wHKU/Db2LqEhtAoIu4RwS+BRH4zRPlCsFpA==", + "version": "20.7.3", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-20.7.3.tgz", + "integrity": "sha512-3tw12ykFRLvzTRc9PyUOE5xeHQhhLEcKEOVjSfNtRmZqlAnvfhAP8ue+mjojy8NJ1LIfF6fps7OKzSc4JSJSlA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@puppeteer/browsers": "0.4.1", - "cosmiconfig": "8.1.3", - "https-proxy-agent": "5.0.1", - "progress": "2.0.3", - "proxy-from-env": "1.1.0", - "puppeteer-core": "19.9.0" + "@puppeteer/browsers": "1.4.2", + "cosmiconfig": "8.2.0", + "puppeteer-core": "20.7.3" + }, + "engines": { + "node": ">=16.3.0" } }, "node_modules/puppeteer-core": { - "version": "19.9.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-19.9.0.tgz", - "integrity": "sha512-IJYfCE0oFpi5dTvNFqOwo8Dey6zzx7hANy7z6K2bjpCux9oPOSOIubq40awNhaHlfi8soYtgU4qabnzMXB7xBQ==", + "version": "20.7.3", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-20.7.3.tgz", + "integrity": "sha512-OraI71GPPfUMosLqaOsDGbp/ZLoxLTm0BAda0uE6G+H3onmljfoaJcIPm8X5y1LMq1K1HF1bipcCI7hWGkd3bQ==", "dev": true, "dependencies": { - "@puppeteer/browsers": "0.4.1", - "chromium-bidi": "0.4.6", - "cross-fetch": "3.1.5", + "@puppeteer/browsers": "1.4.2", + "chromium-bidi": "0.4.12", + "cross-fetch": "3.1.6", "debug": "4.3.4", - "devtools-protocol": "0.0.1107588", - "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.1", - "proxy-from-env": "1.1.0", - "tar-fs": "2.1.1", - "unbzip2-stream": "1.4.3", + "devtools-protocol": "0.0.1135028", "ws": "8.13.0" }, "engines": { - "node": ">=14.14.0" + "node": ">=16.3.0" }, "peerDependencies": { "typescript": ">= 4.7.4" @@ -4981,6 +5239,12 @@ } ] }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -5022,20 +5286,6 @@ "node": ">=4" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5336,12 +5586,56 @@ "node": ">=8" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/smob": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/smob/-/smob-0.0.6.tgz", "integrity": "sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==", "dev": true }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dev": true, + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.1.tgz", + "integrity": "sha512-59EjPbbgg8U3x62hhKOFVAmySQUcfRQ4C7Q/D5sEHnZTQRrQlNKINks44DMR1gwXp0p4LaVIeccX2KHTTcHVqQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks/node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "dev": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5543,13 +5837,14 @@ "node": ">=6" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/streamx": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", + "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", "dev": true, "dependencies": { - "safe-buffer": "~5.2.0" + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" } }, "node_modules/string-width": { @@ -5705,31 +6000,25 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.2.tgz", + "integrity": "sha512-mLQ5iTTCv2tt3a4BwvD8QX1YFVBL/94/Nd+U2il38wt2+zaJSusp1VwJSNkBmB48FeTdOqptf1DAUIosXQBRrQ==", "dev": true, "dependencies": { - "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", - "tar-stream": "^2.1.4" + "tar-stream": "^3.1.0" } }, "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.4.tgz", + "integrity": "sha512-IlHr7ZOW6XaVBCrSCokUJG4IqUuRcWW76B8XbrtCotbaDh6zVGE7WPCzaSz1CN+acFmWiwoa+cE4RZsom0RzXg==", "dev": true, "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" } }, "node_modules/terser": { @@ -6012,16 +6301,16 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=4.2.0" } }, "node_modules/uglify-js": { @@ -6062,6 +6351,15 @@ "through": "^2.3.8" } }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6071,12 +6369,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -6101,6 +6393,22 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/vm2": { + "version": "3.9.19", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", + "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", + "dev": true, + "dependencies": { + "acorn": "^8.7.0", + "acorn-walk": "^8.2.0" + }, + "bin": { + "vm2": "bin/vm2" + }, + "engines": { + "node": ">=6.0" + } + }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", diff --git a/package.json b/package.json index fb177f0..1df2114 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ } }, "devDependencies": { - "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-commonjs": "^25.0.2", "@rollup/plugin-inject": "^5.0.3", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", @@ -146,8 +146,8 @@ "@rollup/plugin-typescript": "^11.1.0", "@types/chai": "^4.2.22", "@types/mocha": "^10.0.0", - "bigint-mod-arith": "^3.2.1", - "c8": "^7.12.0", + "bigint-mod-arith": "^3.3.1", + "c8": "^8.0.0", "chai": "^4.3.3", "dotenv": "^16.0.3", "glob": "^10.0.0", @@ -156,7 +156,7 @@ "mocha": "^10.0.0", "npm-run-all": "^4.1.5", "pirates": "^4.0.1", - "puppeteer": "^19.1.2", + "puppeteer": "^20.7.3", "rimraf": "^5.0.0", "rollup": "^3.20.2", "rollup-plugin-dts": "^5.3.0", @@ -164,6 +164,6 @@ "tslib": "^2.3.1", "typedoc": "~0.23.0", "typedoc-plugin-markdown": "~3.14.0", - "typescript": "^5.0.3" + "typescript": "^4.4.3" } }