Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bigint-crypto-utils

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigint-crypto-utils - npm Package Compare versions

Comparing version 3.1.8 to 3.2.1

types/fromBuffer.d.cts

256

dist/bundles/esm.js

@@ -1,8 +0,1 @@

/**
* Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0
*
* @param a
*
* @returns The absolute value of a
*/
function abs(a) {

@@ -12,8 +5,2 @@ return (a >= 0) ? a : -a;

/**
* Returns the (minimum) length of a number expressed in bits.
*
* @param a
* @returns The bit length
*/
function bitLength(a) {

@@ -32,13 +19,2 @@ if (typeof a === 'number')

/**
* 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).
*/
function eGcd(a, b) {

@@ -50,3 +26,3 @@ if (typeof a === 'number')

if (a <= 0n || b <= 0n)
throw new RangeError('a and b MUST be > 0'); // a and b MUST be positive
throw new RangeError('a and b MUST be > 0');
let x = 0n;

@@ -70,15 +46,7 @@ let y = 1n;

g: b,
x: x,
y: y
x,
y
};
}
/**
* 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
*/
function gcd(a, b) {

@@ -111,13 +79,5 @@ let aAbs = (typeof a === 'number') ? BigInt(abs(a)) : abs(a);

} while (bAbs !== 0n);
// rescale
return aAbs << shift;
}
/**
* 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
*/
function lcm(a, b) {

@@ -130,14 +90,5 @@ if (typeof a === 'number')

return BigInt(0);
// return abs(a * b) as bigint / gcd(a, b)
return abs((a / gcd(a, b)) * b);
}
/**
* Maximum. max(a,b)==a if a>=b. max(a,b)==b if a<b
*
* @param a
* @param b
*
* @returns Maximum of numbers a and b
*/
function max(a, b) {

@@ -147,10 +98,2 @@ return (a >= b) ? a : b;

/**
* Minimum. min(a,b)==b if a>=b. min(a,b)==a if a<b
*
* @param a
* @param b
*
* @returns Minimum of numbers a and b
*/
function min(a, b) {

@@ -160,15 +103,2 @@ return (a >= b) ? b : a;

/**
* Finds the smallest positive element that is congruent to a in modulo n
*
* @remarks
* a and b must be the same type, either number or bigint
*
* @param a - An integer
* @param n - The modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns A bigint with the smallest positive representation of a modulo n
*/
function toZn(a, n) {

@@ -186,16 +116,6 @@ if (typeof a === 'number')

/**
* Modular inverse.
*
* @param a The number to find an inverse for
* @param n The modulo
*
* @throws {@link RangeError} if a does not have inverse modulo n
*
* @returns The inverse modulo n
*/
function modInv(a, n) {
const egcd = eGcd(toZn(a, n), n);
if (egcd.g !== 1n) {
throw new RangeError(`${a.toString()} does not have inverse modulo ${n.toString()}`); // modular inverse does not exist
throw new RangeError(`${a.toString()} does not have inverse modulo ${n.toString()}`);
}

@@ -207,13 +127,2 @@ else {

/**
* Modular exponentiation b**e mod n. Currently using the right-to-left binary method
*
* @param b base
* @param e exponent
* @param n modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns b**e mod n
*/
function modPow(b, e, n) {

@@ -256,12 +165,2 @@ if (typeof b === 'number')

/**
* 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
*/
function randBytes(byteLength, forceLength = false) {

@@ -271,5 +170,4 @@ if (byteLength < 1)

return new Promise(function (resolve, reject) {
{ // browser
{
const buf = new Uint8Array(byteLength);
// the maximum number of bytes of entropy available via self.crypto.getRandomValues is 65536
if (byteLength <= 65536) {

@@ -285,3 +183,2 @@ self.crypto.getRandomValues(buf);

}
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)

@@ -293,20 +190,7 @@ buf[0] = buf[0] | 128;

}
/**
* 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
*/
function randBytesSync(byteLength, forceLength = false) {
if (byteLength < 1)
throw new RangeError('byteLength MUST be > 0');
/* eslint-disable no-lone-blocks */
{ // browser
{
const buf = new Uint8Array(byteLength);
// the maximum number of bytes of entropy available via self.crypto.getRandomValues is 65536
if (byteLength <= 65536) {

@@ -322,3 +206,2 @@ self.crypto.getRandomValues(buf);

}
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)

@@ -328,15 +211,4 @@ buf[0] = buf[0] | 128;

}
/* eslint-enable no-lone-blocks */
}
/**
* 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
*/
function randBits(bitLength, forceLength = false) {

@@ -350,3 +222,2 @@ if (bitLength < 1)

if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);

@@ -362,11 +233,2 @@ }

}
/**
* 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
*/
function randBitsSync(bitLength, forceLength = false) {

@@ -379,3 +241,2 @@ if (bitLength < 1)

if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);

@@ -390,11 +251,2 @@ }

/**
* 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]
*/
function randBetween(max, min = 1n) {

@@ -414,9 +266,8 @@ if (max <= min)

function _workerUrl(workerCode) {
workerCode = `(() => {${workerCode}})()`; // encapsulate IIFE
workerCode = `(() => {${workerCode}})()`;
const _blob = new Blob([workerCode], { type: 'text/javascript' });
return window.URL.createObjectURL(_blob);
}
let _useWorkers = false; // The following is just to check whether we can use workers
/* eslint-disable no-lone-blocks */
{ // Native JS
let _useWorkers = false;
{
if (self.Worker !== undefined)

@@ -426,14 +277,2 @@ _useWorkers = true;

/**
* The test first tries if any of the first 250 small primes are a factor of the input number and then passes several
* iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1)
*
* @param w - A positive integer to be tested for primality
* @param iterations - The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 of FIPS 186-4
* @param disableWorkers - Disable the use of workers for the primality test
*
* @throws {@link RangeError} if w<0
*
* @returns A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite)
*/
function isProbablyPrime(w, iterations = 16, disableWorkers = false) {

@@ -445,3 +284,3 @@ if (typeof w === 'number') {

throw RangeError('w MUST be >= 0');
{ // browser
{
return new Promise((resolve, reject) => {

@@ -461,3 +300,3 @@ const worker = new Worker(_isProbablyPrimeWorkerUrl());

rnd: w,
iterations: iterations,
iterations,
id: 0

@@ -471,6 +310,2 @@ }

function _isProbablyPrime(w, iterations) {
/*
PREFILTERING. Even values but 2 are not primes, so don't test.
1 is not a prime and the M-R algorithm needs w>1.
*/
if (w === 2n)

@@ -480,5 +315,2 @@ return true;

return false;
/*
Test if any of the first 250 small primes are a factor of w. 2 is not tested because it was already tested above.
*/
const firstPrimes = [

@@ -743,21 +575,2 @@ 3n,

}
/*
1. Let a be the largest integer such that 2**a divides w−1.
2. m = (w−1) / 2**a.
3. wlen = len (w).
4. For i = 1 to iterations do
4.1 Obtain a string b of wlen bits from an RBG.
Comment: Ensure that 1 < b < w−1.
4.2 If ((b ≤ 1) or (b ≥ w−1)), then go to step 4.1.
4.3 z = b**m mod w.
4.4 If ((z = 1) or (z = w − 1)), then go to step 4.7.
4.5 For j = 1 to a − 1 do.
4.5.1 z = z**2 mod w.
4.5.2 If (z = w−1), then go to step 4.7.
4.5.3 If (z = 1), then go to step 4.6.
4.6 Return COMPOSITE.
4.7 Continue.
Comment: Increment i for the do-loop in step 4.
5. Return PROBABLY PRIME.
*/
let a = 0n;

@@ -791,3 +604,2 @@ const d = w - 1n;

function _isProbablyPrimeWorkerUrl() {
// Let's us first add all the required functions
let workerCode = `

@@ -821,21 +633,6 @@ 'use strict';

/**
* 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.
*/
function prime(bitLength, iterations = 16) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
/* c8 ignore start */
if (!_useWorkers) { // If there is no support for workers
if (!_useWorkers) {
let rnd = 0n;

@@ -847,3 +644,2 @@ do {

}
/* c8 ignore stop */
return new Promise((resolve, reject) => {

@@ -853,5 +649,4 @@ const workerList = [];

if (msg._bcu.isPrime) {
// if a prime number has been found, stop all the workers, and return it
for (let j = 0; j < workerList.length; j++) {
workerList[j].terminate(); // eslint-disable-line @typescript-eslint/no-floating-promises
workerList[j].terminate();
}

@@ -863,3 +658,3 @@ while (workerList.length > 0) {

}
else { // if a composite is found, make the worker test another random number
else {
const buf = randBitsSync(bitLength, true);

@@ -870,4 +665,4 @@ const rnd = fromBuffer(buf);

_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: msg._bcu.id

@@ -879,7 +674,6 @@ }

catch (error) {
// The worker has already terminated. There is nothing to handle here
}
}
};
{ // browser
{
const workerURL = _isProbablyPrimeWorkerUrl();

@@ -897,4 +691,4 @@ for (let i = 0; i < self.navigator.hardwareConcurrency - 1; i++) {

_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: i

@@ -907,13 +701,2 @@ }

}
/**
* 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.
*/
function primeSync(bitLength, iterations = 16) {

@@ -930,2 +713,1 @@ if (bitLength < 1)

export { abs, bitLength, eGcd, gcd, isProbablyPrime, lcm, max, min, modInv, modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, toZn };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNtLmpzIiwic291cmNlcyI6WyIuLi8uLi9ub2RlX21vZHVsZXMvYmlnaW50LW1vZC1hcml0aC9kaXN0L2VzbS9pbmRleC5icm93c2VyLmpzIiwiLi4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0FBQyxZQUFZLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUE7QUFDaEQsS0FBQSxRQUFRLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxFQUFFLFVBQVUsQ0FBQyxFQUFDO0FBQzVDLElBQUEsT0FBTyxHQUFHLENBQUE7QUFDWjs7OzsifQ==

@@ -1,1 +0,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<<i}function i(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 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<Math.ceil(n/65536);t++){const e=65536*t,o=e+65535<n?e+65535:n-1;self.crypto.getRandomValues(r.subarray(e,o))}t&&(r[0]=128|r[0]),e(r)}}))}function f(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t<Math.ceil(n/65536);t++){const r=65536*t,o=r+65535<n?r+65535:n-1;self.crypto.getRandomValues(e.subarray(r,o))}return t&&(e[0]=128|e[0]),e}}function g(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)=>{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<e.length&&e[t]<=n;t++){const r=e[t];if(n===r)return!0;if(n%r===0n)return!1}let r=0n;const o=n-1n;let i=o;for(;i%2n===0n;)i/=2n,++r;const s=o/2n**r;do{let t=u(d(o,2n),s,n);if(1n===t||t===o)continue;let e=1;for(;e<r&&(t=u(t,2n,n),t!==o);){if(1n===t)return!1;e++}if(t!==o)return!1}while(0!=--t);return!0}function h(){let n=`\n 'use strict';\n const ${r.name} = ${r.toString()};\n const ${s.name} = ${s.toString()};\n const ${u.name} = ${u.toString()};\n const ${i.name} = ${i.toString()};\n const ${m.name} = ${m.toString()};\n const ${f.name} = ${f.toString()};\n const ${d.name} = ${d.toString()};\n const ${l.name} = ${w.toString()};\n ${e.toString()};\n ${a.toString()};`;return n+=`\n onmessage = async function(msg) {\n if (msg !== undefined && msg.data !== undefined && msg.data._bcu !== undefined && msg.data._bcu.id !== undefined && msg.data._bcu.iterations !== undefined && msg.data._bcu.rnd !== undefined) {\n const msgToParent = {\n _bcu: {\n isPrime: await ${l.name}(msg.data._bcu.rnd, msg.data._bcu.iterations),\n value: msg.data._bcu.rnd,\n id: msg.data._bcu.id\n }\n };\n postMessage(msgToParent);\n }\n }`,function(n){n=`(() => {${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;n<o.length;n++)o[n].terminate();for(;o.length>0;)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;t<self.navigator.hardwareConcurrency-1;t++){const t=new Worker(n);t.onmessage=n=>i(n.data,t),o.push(t)}}for(let e=0;e<o.length;e++)g(n,!0).then((function(n){const r=a(n);o[e].postMessage({_bcu:{rnd:r,iterations:t,id:e}})})).catch(r)}))},n.primeSync=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 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,Object.defineProperty(n,"__esModule",{value:!0}),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 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<<i}function i(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 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<Math.ceil(n/65536);t++){const e=65536*t,o=e+65535<n?e+65535:n-1;self.crypto.getRandomValues(r.subarray(e,o))}t&&(r[0]=128|r[0]),e(r)}}))}function f(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t<Math.ceil(n/65536);t++){const r=65536*t,o=r+65535<n?r+65535:n-1;self.crypto.getRandomValues(e.subarray(r,o))}return t&&(e[0]=128|e[0]),e}}function g(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)=>{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<e.length&&e[t]<=n;t++){const r=e[t];if(n===r)return!0;if(n%r===0n)return!1}let r=0n;const o=n-1n;let i=o;for(;i%2n===0n;)i/=2n,++r;const s=o/2n**r;do{let t=u(d(o,2n),s,n);if(1n===t||t===o)continue;let e=1;for(;e<r&&(t=u(t,2n,n),t!==o);){if(1n===t)return!1;e++}if(t!==o)return!1}while(0!=--t);return!0}function h(){let n=`\n 'use strict';\n const ${r.name} = ${r.toString()};\n const ${s.name} = ${s.toString()};\n const ${u.name} = ${u.toString()};\n const ${i.name} = ${i.toString()};\n const ${m.name} = ${m.toString()};\n const ${f.name} = ${f.toString()};\n const ${d.name} = ${d.toString()};\n const ${l.name} = ${w.toString()};\n ${e.toString()};\n ${a.toString()};`;return n+=`\n onmessage = async function(msg) {\n if (msg !== undefined && msg.data !== undefined && msg.data._bcu !== undefined && msg.data._bcu.id !== undefined && msg.data._bcu.iterations !== undefined && msg.data._bcu.rnd !== undefined) {\n const msgToParent = {\n _bcu: {\n isPrime: await ${l.name}(msg.data._bcu.rnd, msg.data._bcu.iterations),\n value: msg.data._bcu.rnd,\n id: msg.data._bcu.id\n }\n };\n postMessage(msgToParent);\n }\n }`,function(n){n=`(() => {${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;n<o.length;n++)o[n].terminate();for(;o.length>0;)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;t<self.navigator.hardwareConcurrency-1;t++){const t=new Worker(n);t.onmessage=n=>i(n.data,t),o.push(t)}}for(let e=0;e<o.length;e++)g(n,!0).then((function(n){const r=a(n);o[e].postMessage({_bcu:{rnd:r,iterations:t,id:e}})})).catch(r)}))},n.primeSync=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 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}({});

@@ -1,1 +0,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<<i}function i(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 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<Math.ceil(n/65536);t++){const e=65536*t,o=e+65535<n?e+65535:n-1;self.crypto.getRandomValues(r.subarray(e,o))}t&&(r[0]=128|r[0]),e(r)}}))}function c(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t<Math.ceil(n/65536);t++){const r=65536*t,o=r+65535<n?r+65535:n-1;self.crypto.getRandomValues(e.subarray(r,o))}return t&&(e[0]=128|e[0]),e}}function g(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)=>{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<e.length&&e[t]<=n;t++){const r=e[t];if(n===r)return!0;if(n%r===0n)return!1}let r=0n;const o=n-1n;let i=o;for(;i%2n===0n;)i/=2n,++r;const s=o/2n**r;do{let t=u(m(o,2n),s,n);if(1n===t||t===o)continue;let e=1;for(;e<r&&(t=u(t,2n,n),t!==o);){if(1n===t)return!1;e++}if(t!==o)return!1}while(0!=--t);return!0}function h(){let n=`\n 'use strict';\n const ${r.name} = ${r.toString()};\n const ${s.name} = ${s.toString()};\n const ${u.name} = ${u.toString()};\n const ${i.name} = ${i.toString()};\n const ${d.name} = ${d.toString()};\n const ${c.name} = ${c.toString()};\n const ${m.name} = ${m.toString()};\n const ${b.name} = ${w.toString()};\n ${e.toString()};\n ${f.toString()};`;return n+=`\n onmessage = async function(msg) {\n if (msg !== undefined && msg.data !== undefined && msg.data._bcu !== undefined && msg.data._bcu.id !== undefined && msg.data._bcu.iterations !== undefined && msg.data._bcu.rnd !== undefined) {\n const msgToParent = {\n _bcu: {\n isPrime: await ${b.name}(msg.data._bcu.rnd, msg.data._bcu.iterations),\n value: msg.data._bcu.rnd,\n id: msg.data._bcu.id\n }\n };\n postMessage(msgToParent);\n }\n }`,function(n){n=`(() => {${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;n<o.length;n++)o[n].terminate();for(;o.length>0;)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;t<self.navigator.hardwareConcurrency-1;t++){const t=new Worker(n);t.onmessage=n=>i(n.data,t),o.push(t)}}for(let e=0;e<o.length;e++)g(n,!0).then((function(n){const r=f(n);o[e].postMessage({_bcu:{rnd:r,iterations:t,id:e}})})).catch(r)}))},n.primeSync=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 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,Object.defineProperty(n,"__esModule",{value:!0})}));
!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<<i}function i(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 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<Math.ceil(n/65536);t++){const e=65536*t,o=e+65535<n?e+65535:n-1;self.crypto.getRandomValues(r.subarray(e,o))}t&&(r[0]=128|r[0]),e(r)}}))}function c(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t<Math.ceil(n/65536);t++){const r=65536*t,o=r+65535<n?r+65535:n-1;self.crypto.getRandomValues(e.subarray(r,o))}return t&&(e[0]=128|e[0]),e}}function g(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)=>{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<e.length&&e[t]<=n;t++){const r=e[t];if(n===r)return!0;if(n%r===0n)return!1}let r=0n;const o=n-1n;let i=o;for(;i%2n===0n;)i/=2n,++r;const s=o/2n**r;do{let t=u(m(o,2n),s,n);if(1n===t||t===o)continue;let e=1;for(;e<r&&(t=u(t,2n,n),t!==o);){if(1n===t)return!1;e++}if(t!==o)return!1}while(0!=--t);return!0}function h(){let n=`\n 'use strict';\n const ${r.name} = ${r.toString()};\n const ${s.name} = ${s.toString()};\n const ${u.name} = ${u.toString()};\n const ${i.name} = ${i.toString()};\n const ${d.name} = ${d.toString()};\n const ${c.name} = ${c.toString()};\n const ${m.name} = ${m.toString()};\n const ${b.name} = ${w.toString()};\n ${e.toString()};\n ${f.toString()};`;return n+=`\n onmessage = async function(msg) {\n if (msg !== undefined && msg.data !== undefined && msg.data._bcu !== undefined && msg.data._bcu.id !== undefined && msg.data._bcu.iterations !== undefined && msg.data._bcu.rnd !== undefined) {\n const msgToParent = {\n _bcu: {\n isPrime: await ${b.name}(msg.data._bcu.rnd, msg.data._bcu.iterations),\n value: msg.data._bcu.rnd,\n id: msg.data._bcu.id\n }\n };\n postMessage(msgToParent);\n }\n }`,function(n){n=`(() => {${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;n<o.length;n++)o[n].terminate();for(;o.length>0;)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;t<self.navigator.hardwareConcurrency-1;t++){const t=new Worker(n);t.onmessage=n=>i(n.data,t),o.push(t)}}for(let e=0;e<o.length;e++)g(n,!0).then((function(n){const r=f(n);o[e].postMessage({_bcu:{rnd:r,iterations:t,id:e}})})).catch(r)}))},n.primeSync=function(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 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}));

@@ -1,8 +0,1 @@

/**
* Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0
*
* @param a
*
* @returns The absolute value of a
*/
function abs(a) {

@@ -12,8 +5,2 @@ return (a >= 0) ? a : -a;

/**
* Returns the (minimum) length of a number expressed in bits.
*
* @param a
* @returns The bit length
*/
function bitLength(a) {

@@ -32,13 +19,2 @@ if (typeof a === 'number')

/**
* 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).
*/
function eGcd(a, b) {

@@ -50,3 +26,3 @@ if (typeof a === 'number')

if (a <= 0n || b <= 0n)
throw new RangeError('a and b MUST be > 0'); // a and b MUST be positive
throw new RangeError('a and b MUST be > 0');
let x = 0n;

@@ -70,15 +46,7 @@ let y = 1n;

g: b,
x: x,
y: y
x,
y
};
}
/**
* 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
*/
function gcd(a, b) {

@@ -111,13 +79,5 @@ let aAbs = (typeof a === 'number') ? BigInt(abs(a)) : abs(a);

} while (bAbs !== 0n);
// rescale
return aAbs << shift;
}
/**
* 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
*/
function lcm(a, b) {

@@ -130,14 +90,5 @@ if (typeof a === 'number')

return BigInt(0);
// return abs(a * b) as bigint / gcd(a, b)
return abs((a / gcd(a, b)) * b);
}
/**
* Maximum. max(a,b)==a if a>=b. max(a,b)==b if a<b
*
* @param a
* @param b
*
* @returns Maximum of numbers a and b
*/
function max(a, b) {

@@ -147,10 +98,2 @@ return (a >= b) ? a : b;

/**
* Minimum. min(a,b)==b if a>=b. min(a,b)==a if a<b
*
* @param a
* @param b
*
* @returns Minimum of numbers a and b
*/
function min(a, b) {

@@ -160,15 +103,2 @@ return (a >= b) ? b : a;

/**
* Finds the smallest positive element that is congruent to a in modulo n
*
* @remarks
* a and b must be the same type, either number or bigint
*
* @param a - An integer
* @param n - The modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns A bigint with the smallest positive representation of a modulo n
*/
function toZn(a, n) {

@@ -186,16 +116,6 @@ if (typeof a === 'number')

/**
* Modular inverse.
*
* @param a The number to find an inverse for
* @param n The modulo
*
* @throws {@link RangeError} if a does not have inverse modulo n
*
* @returns The inverse modulo n
*/
function modInv(a, n) {
const egcd = eGcd(toZn(a, n), n);
if (egcd.g !== 1n) {
throw new RangeError(`${a.toString()} does not have inverse modulo ${n.toString()}`); // modular inverse does not exist
throw new RangeError(`${a.toString()} does not have inverse modulo ${n.toString()}`);
}

@@ -207,13 +127,2 @@ else {

/**
* Modular exponentiation b**e mod n. Currently using the right-to-left binary method
*
* @param b base
* @param e exponent
* @param n modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns b**e mod n
*/
function modPow(b, e, n) {

@@ -256,12 +165,2 @@ if (typeof b === 'number')

/**
* 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
*/
function randBytes(byteLength, forceLength = false) {

@@ -271,5 +170,4 @@ if (byteLength < 1)

return new Promise(function (resolve, reject) {
{ // browser
{
const buf = new Uint8Array(byteLength);
// the maximum number of bytes of entropy available via self.crypto.getRandomValues is 65536
if (byteLength <= 65536) {

@@ -285,3 +183,2 @@ self.crypto.getRandomValues(buf);

}
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)

@@ -293,20 +190,7 @@ buf[0] = buf[0] | 128;

}
/**
* 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
*/
function randBytesSync(byteLength, forceLength = false) {
if (byteLength < 1)
throw new RangeError('byteLength MUST be > 0');
/* eslint-disable no-lone-blocks */
{ // browser
{
const buf = new Uint8Array(byteLength);
// the maximum number of bytes of entropy available via self.crypto.getRandomValues is 65536
if (byteLength <= 65536) {

@@ -322,3 +206,2 @@ self.crypto.getRandomValues(buf);

}
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)

@@ -328,15 +211,4 @@ buf[0] = buf[0] | 128;

}
/* eslint-enable no-lone-blocks */
}
/**
* 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
*/
function randBits(bitLength, forceLength = false) {

@@ -350,3 +222,2 @@ if (bitLength < 1)

if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);

@@ -362,11 +233,2 @@ }

}
/**
* 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
*/
function randBitsSync(bitLength, forceLength = false) {

@@ -379,3 +241,2 @@ if (bitLength < 1)

if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);

@@ -390,11 +251,2 @@ }

/**
* 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]
*/
function randBetween(max, min = 1n) {

@@ -414,9 +266,8 @@ if (max <= min)

function _workerUrl(workerCode) {
workerCode = `(() => {${workerCode}})()`; // encapsulate IIFE
workerCode = `(() => {${workerCode}})()`;
const _blob = new Blob([workerCode], { type: 'text/javascript' });
return window.URL.createObjectURL(_blob);
}
let _useWorkers = false; // The following is just to check whether we can use workers
/* eslint-disable no-lone-blocks */
{ // Native JS
let _useWorkers = false;
{
if (self.Worker !== undefined)

@@ -426,14 +277,2 @@ _useWorkers = true;

/**
* The test first tries if any of the first 250 small primes are a factor of the input number and then passes several
* iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1)
*
* @param w - A positive integer to be tested for primality
* @param iterations - The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 of FIPS 186-4
* @param disableWorkers - Disable the use of workers for the primality test
*
* @throws {@link RangeError} if w<0
*
* @returns A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite)
*/
function isProbablyPrime(w, iterations = 16, disableWorkers = false) {

@@ -445,3 +284,3 @@ if (typeof w === 'number') {

throw RangeError('w MUST be >= 0');
{ // browser
{
return new Promise((resolve, reject) => {

@@ -461,3 +300,3 @@ const worker = new Worker(_isProbablyPrimeWorkerUrl());

rnd: w,
iterations: iterations,
iterations,
id: 0

@@ -471,6 +310,2 @@ }

function _isProbablyPrime(w, iterations) {
/*
PREFILTERING. Even values but 2 are not primes, so don't test.
1 is not a prime and the M-R algorithm needs w>1.
*/
if (w === 2n)

@@ -480,5 +315,2 @@ return true;

return false;
/*
Test if any of the first 250 small primes are a factor of w. 2 is not tested because it was already tested above.
*/
const firstPrimes = [

@@ -743,21 +575,2 @@ 3n,

}
/*
1. Let a be the largest integer such that 2**a divides w−1.
2. m = (w−1) / 2**a.
3. wlen = len (w).
4. For i = 1 to iterations do
4.1 Obtain a string b of wlen bits from an RBG.
Comment: Ensure that 1 < b < w−1.
4.2 If ((b ≤ 1) or (b ≥ w−1)), then go to step 4.1.
4.3 z = b**m mod w.
4.4 If ((z = 1) or (z = w − 1)), then go to step 4.7.
4.5 For j = 1 to a − 1 do.
4.5.1 z = z**2 mod w.
4.5.2 If (z = w−1), then go to step 4.7.
4.5.3 If (z = 1), then go to step 4.6.
4.6 Return COMPOSITE.
4.7 Continue.
Comment: Increment i for the do-loop in step 4.
5. Return PROBABLY PRIME.
*/
let a = 0n;

@@ -791,3 +604,2 @@ const d = w - 1n;

function _isProbablyPrimeWorkerUrl() {
// Let's us first add all the required functions
let workerCode = `

@@ -821,21 +633,6 @@ 'use strict';

/**
* 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.
*/
function prime(bitLength, iterations = 16) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
/* c8 ignore start */
if (!_useWorkers) { // If there is no support for workers
if (!_useWorkers) {
let rnd = 0n;

@@ -847,3 +644,2 @@ do {

}
/* c8 ignore stop */
return new Promise((resolve, reject) => {

@@ -853,5 +649,4 @@ const workerList = [];

if (msg._bcu.isPrime) {
// if a prime number has been found, stop all the workers, and return it
for (let j = 0; j < workerList.length; j++) {
workerList[j].terminate(); // eslint-disable-line @typescript-eslint/no-floating-promises
workerList[j].terminate();
}

@@ -863,3 +658,3 @@ while (workerList.length > 0) {

}
else { // if a composite is found, make the worker test another random number
else {
const buf = randBitsSync(bitLength, true);

@@ -870,4 +665,4 @@ const rnd = fromBuffer(buf);

_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: msg._bcu.id

@@ -879,7 +674,6 @@ }

catch (error) {
// The worker has already terminated. There is nothing to handle here
}
}
};
{ // browser
{
const workerURL = _isProbablyPrimeWorkerUrl();

@@ -897,4 +691,4 @@ for (let i = 0; i < self.navigator.hardwareConcurrency - 1; i++) {

_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: i

@@ -907,13 +701,2 @@ }

}
/**
* 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.
*/
function primeSync(bitLength, iterations = 16) {

@@ -930,2 +713,2 @@ if (bitLength < 1)

export { abs, bitLength, eGcd, gcd, isProbablyPrime, lcm, max, min, modInv, modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, toZn };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5qcyIsInNvdXJjZXMiOlsiLi4vLi4vbm9kZV9tb2R1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DQUFDLENBQUE7QUFDakIsU0FBQTtBQUNILEtBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQztTQWFlLFNBQVMsQ0FBRSxTQUFpQixFQUFFLGFBQXFCLEVBQUUsRUFBQTtJQUNuRSxJQUFJLFNBQVMsR0FBRyxDQUFDO0FBQUUsUUFBQSxNQUFNLElBQUksVUFBVSxDQUFDLHVCQUF1QixDQUFDLENBQUE7SUFDaEUsSUFBSSxHQUFHLEdBQUcsRUFBRSxDQUFBO0lBQ1osR0FBRztRQUNELEdBQUcsR0FBRyxVQUFVLENBQUMsWUFBWSxDQUFDLFNBQVMsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFBO0FBQ2hELEtBQUEsUUFBUSxDQUFDLGdCQUFnQixDQUFDLEdBQUcsRUFBRSxVQUFVLENBQUMsRUFBQztBQUM1QyxJQUFBLE9BQU8sR0FBRyxDQUFBO0FBQ1o7Ozs7IiwieF9nb29nbGVfaWdub3JlTGlzdCI6WzBdfQ==

@@ -1,885 +0,2 @@

/**
* Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0
*
* @param a
*
* @returns The absolute value of a
*/
function abs(a) {
return (a >= 0) ? a : -a;
}
/**
* Returns the (minimum) length of a number expressed in bits.
*
* @param a
* @returns The bit length
*/
function bitLength(a) {
if (typeof a === 'number')
a = BigInt(a);
if (a === 1n) {
return 1;
}
let bits = 1;
do {
bits++;
} while ((a >>= 1n) > 1n);
return bits;
}
/**
* 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).
*/
function eGcd(a, b) {
if (typeof a === 'number')
a = BigInt(a);
if (typeof b === 'number')
b = BigInt(b);
if (a <= 0n || b <= 0n)
throw new RangeError('a and b MUST be > 0'); // a and b MUST be positive
let x = 0n;
let y = 1n;
let u = 1n;
let v = 0n;
while (a !== 0n) {
const q = b / a;
const r = b % a;
const m = x - (u * q);
const n = y - (v * q);
b = a;
a = r;
x = u;
y = v;
u = m;
v = n;
}
return {
g: b,
x: x,
y: y
};
}
/**
* 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
*/
function gcd(a, b) {
let aAbs = (typeof a === 'number') ? BigInt(abs(a)) : abs(a);
let bAbs = (typeof b === 'number') ? BigInt(abs(b)) : abs(b);
if (aAbs === 0n) {
return bAbs;
}
else if (bAbs === 0n) {
return aAbs;
}
let shift = 0n;
while (((aAbs | bAbs) & 1n) === 0n) {
aAbs >>= 1n;
bAbs >>= 1n;
shift++;
}
while ((aAbs & 1n) === 0n)
aAbs >>= 1n;
do {
while ((bAbs & 1n) === 0n)
bAbs >>= 1n;
if (aAbs > bAbs) {
const x = aAbs;
aAbs = bAbs;
bAbs = x;
}
bAbs -= aAbs;
} while (bAbs !== 0n);
// rescale
return aAbs << shift;
}
/**
* 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
*/
function lcm(a, b) {
if (typeof a === 'number')
a = BigInt(a);
if (typeof b === 'number')
b = BigInt(b);
if (a === 0n && b === 0n)
return BigInt(0);
// return abs(a * b) as bigint / gcd(a, b)
return abs((a / gcd(a, b)) * b);
}
/**
* Maximum. max(a,b)==a if a>=b. max(a,b)==b if a<b
*
* @param a
* @param b
*
* @returns Maximum of numbers a and b
*/
function max(a, b) {
return (a >= b) ? a : b;
}
/**
* Minimum. min(a,b)==b if a>=b. min(a,b)==a if a<b
*
* @param a
* @param b
*
* @returns Minimum of numbers a and b
*/
function min(a, b) {
return (a >= b) ? b : a;
}
/**
* Finds the smallest positive element that is congruent to a in modulo n
*
* @remarks
* a and b must be the same type, either number or bigint
*
* @param a - An integer
* @param n - The modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns A bigint with the smallest positive representation of a modulo n
*/
function toZn(a, n) {
if (typeof a === 'number')
a = BigInt(a);
if (typeof n === 'number')
n = BigInt(n);
if (n <= 0n) {
throw new RangeError('n must be > 0');
}
const aZn = a % n;
return (aZn < 0n) ? aZn + n : aZn;
}
/**
* Modular inverse.
*
* @param a The number to find an inverse for
* @param n The modulo
*
* @throws {@link RangeError} if a does not have inverse modulo n
*
* @returns The inverse modulo n
*/
function modInv(a, n) {
const egcd = eGcd(toZn(a, n), n);
if (egcd.g !== 1n) {
throw new RangeError(`${a.toString()} does not have inverse modulo ${n.toString()}`); // modular inverse does not exist
}
else {
return toZn(egcd.x, n);
}
}
/**
* Modular exponentiation b**e mod n. Currently using the right-to-left binary method
*
* @param b base
* @param e exponent
* @param n modulo
*
* @throws {@link RangeError} if n <= 0
*
* @returns b**e mod n
*/
function modPow(b, e, n) {
if (typeof b === 'number')
b = BigInt(b);
if (typeof e === 'number')
e = BigInt(e);
if (typeof n === 'number')
n = BigInt(n);
if (n <= 0n) {
throw new RangeError('n must be > 0');
}
else if (n === 1n) {
return 0n;
}
b = toZn(b, n);
if (e < 0n) {
return modInv(modPow(b, abs(e), n), n);
}
let r = 1n;
while (e > 0) {
if ((e % 2n) === 1n) {
r = r * b % n;
}
e = e / 2n;
b = b ** 2n % n;
}
return r;
}
function fromBuffer(buf) {
let ret = 0n;
for (const i of buf.values()) {
const bi = BigInt(i);
ret = (ret << 8n) + bi;
}
return ret;
}
var crypto = await import('crypto'); // eslint-disable-line no-var
/**
* 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
*/
function randBytes(byteLength, forceLength = false) {
if (byteLength < 1)
throw new RangeError('byteLength MUST be > 0');
return new Promise(function (resolve, reject) {
{
crypto.randomBytes(byteLength, function (err, buf) {
if (err !== null)
reject(err);
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)
buf[0] = buf[0] | 128;
resolve(buf);
});
}
});
}
/**
* 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
*/
function randBytesSync(byteLength, forceLength = false) {
if (byteLength < 1)
throw new RangeError('byteLength MUST be > 0');
/* eslint-disable no-lone-blocks */
{ // node
const buf = crypto.randomBytes(byteLength);
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
if (forceLength)
buf[0] = buf[0] | 128;
return buf;
}
/* eslint-enable no-lone-blocks */
}
/**
* 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
*/
function randBits(bitLength, forceLength = false) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
const byteLength = Math.ceil(bitLength / 8);
const bitLengthMod8 = bitLength % 8;
return new Promise((resolve, reject) => {
randBytes(byteLength, false).then(function (rndBytes) {
if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);
}
if (forceLength) {
const mask = (bitLengthMod8 !== 0) ? 2 ** (bitLengthMod8 - 1) : 128;
rndBytes[0] = rndBytes[0] | mask;
}
resolve(rndBytes);
});
});
}
/**
* 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
*/
function randBitsSync(bitLength, forceLength = false) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
const byteLength = Math.ceil(bitLength / 8);
const rndBytes = randBytesSync(byteLength, false);
const bitLengthMod8 = bitLength % 8;
if (bitLengthMod8 !== 0) {
// Fill with 0's the extra bits
rndBytes[0] = rndBytes[0] & (2 ** bitLengthMod8 - 1);
}
if (forceLength) {
const mask = (bitLengthMod8 !== 0) ? 2 ** (bitLengthMod8 - 1) : 128;
rndBytes[0] = rndBytes[0] | mask;
}
return rndBytes;
}
/**
* 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]
*/
function randBetween(max, min = 1n) {
if (max <= min)
throw new RangeError('Arguments MUST be: max > min');
const interval = max - min;
const bitLen = bitLength(interval);
let rnd;
do {
const buf = randBitsSync(bitLen);
rnd = fromBuffer(buf);
} while (rnd > interval);
return rnd + min;
}
let _useWorkers = false; // The following is just to check whether we can use workers
/* eslint-disable no-lone-blocks */
{ // Node.js
try {
await import('worker_threads');
_useWorkers = true;
} /* c8 ignore start */
catch (e) {
console.log(`[bigint-crypto-utils] WARNING:
This node version doesn't support worker_threads. You should enable them in order to greatly speedup the generation of big prime numbers.
· With Node >=11 it is enabled by default (consider upgrading).
· With Node 10, starting with 10.5.0, you can enable worker_threads at runtime executing node --experimental-worker `);
}
/* c8 ignore stop */
}
/**
* The test first tries if any of the first 250 small primes are a factor of the input number and then passes several
* iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1)
*
* @param w - A positive integer to be tested for primality
* @param iterations - The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 of FIPS 186-4
* @param disableWorkers - Disable the use of workers for the primality test
*
* @throws {@link RangeError} if w<0
*
* @returns A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite)
*/
function isProbablyPrime(w, iterations = 16, disableWorkers = false) {
if (typeof w === 'number') {
w = BigInt(w);
}
if (w < 0n)
throw RangeError('w MUST be >= 0');
{ // Node.js
if (!disableWorkers && _useWorkers) {
return new Promise((resolve, reject) => {
const worker = new workerThreads$1.Worker('./dist/esm/index.node.js');
worker.on('message', (data) => {
if (data?._bcu?.isPrime !== undefined) {
worker.terminate().catch(reject);
resolve(data._bcu.isPrime);
}
});
worker.on('error', reject);
const msg = {
_bcu: {
rnd: w,
iterations: iterations,
id: 0
}
};
worker.postMessage(msg);
});
}
else {
return new Promise((resolve) => {
resolve(_isProbablyPrime(w, iterations));
});
}
}
}
function _isProbablyPrime(w, iterations) {
/*
PREFILTERING. Even values but 2 are not primes, so don't test.
1 is not a prime and the M-R algorithm needs w>1.
*/
if (w === 2n)
return true;
else if ((w & 1n) === 0n || w === 1n)
return false;
/*
Test if any of the first 250 small primes are a factor of w. 2 is not tested because it was already tested above.
*/
const firstPrimes = [
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 i = 0; i < firstPrimes.length && (firstPrimes[i] <= w); i++) {
const p = firstPrimes[i];
if (w === p)
return true;
else if (w % p === 0n)
return false;
}
/*
1. Let a be the largest integer such that 2**a divides w−1.
2. m = (w−1) / 2**a.
3. wlen = len (w).
4. For i = 1 to iterations do
4.1 Obtain a string b of wlen bits from an RBG.
Comment: Ensure that 1 < b < w−1.
4.2 If ((b ≤ 1) or (b ≥ w−1)), then go to step 4.1.
4.3 z = b**m mod w.
4.4 If ((z = 1) or (z = w − 1)), then go to step 4.7.
4.5 For j = 1 to a − 1 do.
4.5.1 z = z**2 mod w.
4.5.2 If (z = w−1), then go to step 4.7.
4.5.3 If (z = 1), then go to step 4.6.
4.6 Return COMPOSITE.
4.7 Continue.
Comment: Increment i for the do-loop in step 4.
5. Return PROBABLY PRIME.
*/
let a = 0n;
const d = w - 1n;
let aux = d;
while (aux % 2n === 0n) {
aux /= 2n;
++a;
}
const m = d / (2n ** a);
do {
const b = randBetween(d, 2n);
let z = modPow(b, m, w);
if (z === 1n || z === d)
continue;
let j = 1;
while (j < a) {
z = modPow(z, 2n, w);
if (z === d)
break;
if (z === 1n)
return false;
j++;
}
if (z !== d)
return false;
} while (--iterations !== 0);
return true;
}
if (_useWorkers) { // node.js with support for workers
try {
var workerThreads$1 = await import('worker_threads'); // eslint-disable-line no-var
const isWorker = !(workerThreads$1.isMainThread);
if (isWorker && workerThreads$1.parentPort !== null) { // worker
const parentPort = workerThreads$1.parentPort;
parentPort.on('message', function (data) {
if (data?._bcu?.iterations !== undefined && data?._bcu?.rnd !== undefined) {
const isPrime = _isProbablyPrime(data._bcu.rnd, data._bcu.iterations);
const msg = {
_bcu: {
isPrime: isPrime,
value: data._bcu.rnd,
id: data._bcu.id
}
};
parentPort.postMessage(msg);
}
});
}
}
catch (error) { }
}
var os = await import('os'); // eslint-disable-line no-var
{
try {
var workerThreads = await import('worker_threads'); // eslint-disable-line no-var
}
catch { }
}
/**
* 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.
*/
function prime(bitLength, iterations = 16) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
/* c8 ignore start */
if (!_useWorkers) { // If there is no support for workers
let rnd = 0n;
do {
rnd = fromBuffer(randBitsSync(bitLength, true));
} while (!_isProbablyPrime(rnd, iterations));
return new Promise((resolve) => { resolve(rnd); });
}
/* c8 ignore stop */
return new Promise((resolve, reject) => {
const workerList = [];
const _onmessage = (msg, newWorker) => {
if (msg._bcu.isPrime) {
// if a prime number has been found, stop all the workers, and return it
for (let j = 0; j < workerList.length; j++) {
workerList[j].terminate(); // eslint-disable-line @typescript-eslint/no-floating-promises
}
while (workerList.length > 0) {
workerList.pop();
}
resolve(msg._bcu.value);
}
else { // if a composite is found, make the worker test another random number
const buf = randBitsSync(bitLength, true);
const rnd = fromBuffer(buf);
try {
const msgToWorker = {
_bcu: {
rnd: rnd,
iterations: iterations,
id: msg._bcu.id
}
};
newWorker.postMessage(msgToWorker);
}
catch (error) {
// The worker has already terminated. There is nothing to handle here
}
}
};
{ // Node.js
for (let i = 0; i < os.cpus().length - 1; i++) {
const newWorker = new workerThreads.Worker('./dist/esm/index.node.js');
newWorker.on('message', (msg) => _onmessage(msg, newWorker));
workerList.push(newWorker);
}
}
for (let i = 0; i < workerList.length; i++) {
randBits(bitLength, true).then(function (buf) {
const rnd = fromBuffer(buf);
workerList[i].postMessage({
_bcu: {
rnd: rnd,
iterations: iterations,
id: i
}
});
}).catch(reject);
}
});
}
/**
* 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.
*/
function primeSync(bitLength, iterations = 16) {
if (bitLength < 1)
throw new RangeError('bitLength MUST be > 0');
let rnd = 0n;
do {
rnd = fromBuffer(randBitsSync(bitLength, true));
} while (!_isProbablyPrime(rnd, iterations));
return rnd;
}
export { abs, bitLength, eGcd, gcd, isProbablyPrime, lcm, max, min, modInv, modPow, prime, primeSync, randBetween, randBits, randBitsSync, randBytes, randBytesSync, toZn };
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2pCLFNBQUE7QUFDSCxLQUFDLENBQUMsQ0FBQTtBQUNKLENBQUM7QUFFRDs7Ozs7Ozs7OztBQVVHO1NBQ2EsU0FBUyxDQUFFLFNBQWlCLEVBQUUsYUFBcUIsRUFBRSxFQUFBO0lBQ25FLElBQUksU0FBUyxHQUFHLENBQUM7QUFBRSxRQUFBLE1BQU0sSUFBSSxVQUFVLENBQUMsdUJBQXVCLENBQUMsQ0FBQTtJQUNoRSxJQUFJLEdBQUcsR0FBRyxFQUFFLENBQUE7SUFDWixHQUFHO1FBQ0QsR0FBRyxHQUFHLFVBQVUsQ0FBQyxZQUFZLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUE7QUFDaEQsS0FBQSxRQUFRLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxFQUFFLFVBQVUsQ0FBQyxFQUFDO0FBQzVDLElBQUEsT0FBTyxHQUFHLENBQUE7QUFDWjs7OzsifQ==
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 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 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<<i}function o(t,e){return"number"==typeof t&&(t=BigInt(t)),"number"==typeof e&&(e=BigInt(e)),0n===t&&0n===e?BigInt(0):n(t/r(t,e)*e)}function i(n,t){return n>=t?n:t}function u(n,t){return n>=t?t:n}function s(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(s(n,t),t);if(1n!==r.g)throw new RangeError(`${n.toString()} does not have inverse modulo ${t.toString()}`);return s(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=s(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}var g=await import("crypto");function b(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){g.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=g.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)=>{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 m(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 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(m(o))}while(i>r);return i+e}let w=!1;try{await import("worker_threads"),w=!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 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&&w?(e,r)=>{const o=new _.Worker("./dist/esm/index.node.js");o.on("message",(n=>{void 0!==n?._bcu?.isPrime&&(o.terminate().catch(r),e(n._bcu.isPrime))})),o.on("error",r);const i={_bcu:{rnd:n,iterations:t,id:0}};o.postMessage(i)}:e=>{e(y(n,t))})}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<e.length&&e[t]<=n;t++){const r=e[t];if(n===r)return!0;if(n%r===0n)return!1}let r=0n;const o=n-1n;let i=o;for(;i%2n===0n;)i/=2n,++r;const u=o/2n**r;do{let t=c(l(o,2n),u,n);if(1n===t||t===o)continue;let e=1;for(;e<r&&(t=c(t,2n,n),t!==o);){if(1n===t)return!1;e++}if(t!==o)return!1}while(0!=--t);return!0}if(w)try{var _=await import("worker_threads");if(!_.isMainThread&&null!==_.parentPort){const n=_.parentPort;n.on("message",(function(t){if(void 0!==t?._bcu?.iterations&&void 0!==t?._bcu?.rnd){const e={_bcu:{isPrime:y(t._bcu.rnd,t._bcu.iterations),value:t._bcu.rnd,id:t._bcu.id}};n.postMessage(e)}}))}}catch(n){}var B=await import("os");try{var I=await import("worker_threads")}catch{}function M(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");if(!w){let e=0n;do{e=f(m(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;n<o.length;n++)o[n].terminate();for(;o.length>0;)o.pop();e(r._bcu.value)}else{const e=f(m(n,!0));try{const n={_bcu:{rnd:e,iterations:t,id:r._bcu.id}};i.postMessage(n)}catch(n){}}};for(let n=0;n<B.cpus().length-1;n++){const n=new I.Worker("./dist/esm/index.node.js");n.on("message",(t=>i(t,n))),o.push(n)}for(let e=0;e<o.length;e++)d(n,!0).then((function(n){const r=f(n);o[e].postMessage({_bcu:{rnd:r,iterations:t,id:e}})})).catch(r)}))}function v(n,t=16){if(n<1)throw new RangeError("bitLength MUST be > 0");let e=0n;do{e=f(m(n,!0))}while(!y(e,t));return e}export{n as abs,t as bitLength,e as eGcd,r as gcd,p as isProbablyPrime,o as lcm,i as max,u as min,a as modInv,c as modPow,M as prime,v as primeSync,l as randBetween,d as randBits,m as randBitsSync,b as randBytes,h as randBytesSync,s as toZn};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vbm9kZV9tb2R1bGVzL2JpZ2ludC1tb2QtYXJpdGgvZGlzdC9lc20vaW5kZXgubm9kZS5qcyIsIi4uLy4uL3NyYy90cy9mcm9tQnVmZmVyLnRzIiwiLi4vLi4vc3JjL3RzL3JhbmRCeXRlcy50cyIsIi4uLy4uL3NyYy90cy9yYW5kQml0cy50cyIsIi4uLy4uL3NyYy90cy9yYW5kQmV0d2Vlbi50cyIsIi4uLy4uL3NyYy90cy93b3JrZXJVdGlscy50cyIsIi4uLy4uL3NyYy90cy9pc1Byb2JhYmx5UHJpbWUudHMiLCIuLi8uLi9zcmMvdHMvcHJpbWUudHMiXSwic291cmNlc0NvbnRlbnQiOm51bGwsIm5hbWVzIjpbIm4iLCJ0IiwiQmlnSW50IiwiciIsIlJhbmdlRXJyb3IiLCJlIiwibyIsInUiLCJpIiwiZiIsImciLCJiIiwieCIsInkiLCJ0b1N0cmluZyIsImZyb21CdWZmZXIiLCJidWYiLCJyZXQiLCJ2YWx1ZXMiLCJjcnlwdG8iLCJpbXBvcnQiLCJyYW5kQnl0ZXMiLCJieXRlTGVuZ3RoIiwiZm9yY2VMZW5ndGgiLCJQcm9taXNlIiwicmVzb2x2ZSIsInJlamVjdCIsInJhbmRvbUJ5dGVzIiwiZXJyIiwicmFuZEJ5dGVzU3luYyIsInJhbmRCaXRzIiwiYml0TGVuZ3RoIiwiTWF0aCIsImNlaWwiLCJiaXRMZW5ndGhNb2Q4IiwidGhlbiIsInJuZEJ5dGVzIiwibWFzayIsInJhbmRCaXRzU3luYyIsInJhbmRCZXR3Z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ixFQUFXQyxHQUN2QmlFLEVBQVd6RSxHQUFHd0QsWUFBWSxDQUN4Qk4sS0FBTSxDQUNKZCxNQUNBTSxhQUNBYSxHQUFJdkQsSUFHVixJQUFHcUQsTUFBTW5DLEVBQ1YsR0FFTCxVQWFnQjhELEVBQVd6RCxFQUFtQm1CLEVBQXFCLElBQ2pFLEdBQUluQixFQUFZLEVBQUcsTUFBTSxJQUFJM0IsV0FBVyx5QkFDeEMsSUFBSXdDLEVBQU0sR0FDVixHQUNFQSxFQUFNN0IsRUFBV3VCLEVBQWFQLEdBQVcsV0FDakNrQyxFQUFpQnJCLEVBQUtNLElBQ2hDLE9BQU9OLENBQ1QiLCJ4X2dvb2dsZV9pZ25vcmVMaXN0IjpbMF19

@@ -1,2 +0,2 @@

# bigint-crypto-utils - v3.1.8
# bigint-crypto-utils - v3.2.1

@@ -32,4 +32,2 @@ ## Table of contents

Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0
#### Parameters

@@ -45,7 +43,5 @@

The absolute value of a
#### Defined in
node_modules/bigint-mod-arith/types/abs.d.ts:8
node_modules/bigint-mod-arith/types/abs.d.ts:1

@@ -58,4 +54,2 @@ ___

Returns the (minimum) length of a number expressed in bits.
#### Parameters

@@ -71,7 +65,5 @@

The bit length
#### Defined in
node_modules/bigint-mod-arith/types/bitLength.d.ts:7
node_modules/bigint-mod-arith/types/bitLength.d.ts:1

@@ -84,9 +76,2 @@ ___

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

@@ -103,7 +88,5 @@

A triple (g, x, y), such that ax + by = g = gcd(a, b).
#### Defined in
node_modules/bigint-mod-arith/types/egcd.d.ts:17
node_modules/bigint-mod-arith/types/egcd.d.ts:6

@@ -116,4 +99,2 @@ ___

Greatest common divisor of two integers based on the iterative binary algorithm.
#### Parameters

@@ -130,7 +111,5 @@

The greatest common divisor of a and b
#### Defined in
node_modules/bigint-mod-arith/types/gcd.d.ts:9
node_modules/bigint-mod-arith/types/gcd.d.ts:1

@@ -166,3 +145,3 @@ ___

[src/ts/isProbablyPrime.ts:20](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/isProbablyPrime.ts#L20)
[src/ts/isProbablyPrime.ts:20](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/isProbablyPrime.ts#L20)

@@ -175,4 +154,2 @@ ___

The least common multiple computed as abs(a*b)/gcd(a,b)
#### Parameters

@@ -189,7 +166,5 @@

The least common multiple of a and b
#### Defined in
node_modules/bigint-mod-arith/types/lcm.d.ts:8
node_modules/bigint-mod-arith/types/lcm.d.ts:1

@@ -202,4 +177,2 @@ ___

Maximum. max(a,b)==a if a>=b. max(a,b)==b if a<b
#### Parameters

@@ -216,7 +189,5 @@

Maximum of numbers a and b
#### Defined in
node_modules/bigint-mod-arith/types/max.d.ts:9
node_modules/bigint-mod-arith/types/max.d.ts:1

@@ -229,4 +200,2 @@ ___

Minimum. min(a,b)==b if a>=b. min(a,b)==a if a<b
#### Parameters

@@ -243,7 +212,5 @@

Minimum of numbers a and b
#### Defined in
node_modules/bigint-mod-arith/types/min.d.ts:9
node_modules/bigint-mod-arith/types/min.d.ts:1

@@ -256,14 +223,8 @@ ___

Modular inverse.
**`Throws`**
RangeError if a does not have inverse modulo n
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `a` | `number` \| `bigint` | The number to find an inverse for |
| `n` | `number` \| `bigint` | The modulo |
| Name | Type |
| :------ | :------ |
| `a` | `number` \| `bigint` |
| `n` | `number` \| `bigint` |

@@ -274,7 +235,5 @@ #### Returns

The inverse modulo n
#### Defined in
node_modules/bigint-mod-arith/types/modInv.d.ts:11
node_modules/bigint-mod-arith/types/modInv.d.ts:1

@@ -287,15 +246,9 @@ ___

Modular exponentiation b**e mod n. Currently using the right-to-left binary method
**`Throws`**
RangeError if n <= 0
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `b` | `number` \| `bigint` | base |
| `e` | `number` \| `bigint` | exponent |
| `n` | `number` \| `bigint` | modulo |
| Name | Type |
| :------ | :------ |
| `b` | `number` \| `bigint` |
| `e` | `number` \| `bigint` |
| `n` | `number` \| `bigint` |

@@ -306,7 +259,5 @@ #### Returns

b**e mod n
#### Defined in
node_modules/bigint-mod-arith/types/modPow.d.ts:12
node_modules/bigint-mod-arith/types/modPow.d.ts:1

@@ -344,3 +295,3 @@ ___

[src/ts/prime.ts:28](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/prime.ts#L28)
[src/ts/prime.ts:28](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/prime.ts#L28)

@@ -375,3 +326,3 @@ ___

[src/ts/prime.ts:109](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/prime.ts#L109)
[src/ts/prime.ts:109](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/prime.ts#L109)

@@ -405,3 +356,3 @@ ___

[src/ts/randBetween.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/randBetween.ts#L14)
[src/ts/randBetween.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/randBetween.ts#L14)

@@ -435,3 +386,3 @@ ___

[src/ts/randBits.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/randBits.ts#L13)
[src/ts/randBits.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/randBits.ts#L13)

@@ -465,3 +416,3 @@ ___

[src/ts/randBits.ts:43](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/randBits.ts#L43)
[src/ts/randBits.ts:43](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/randBits.ts#L43)

@@ -495,3 +446,3 @@ ___

[src/ts/randBytes.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/randBytes.ts#L13)
[src/ts/randBytes.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/randBytes.ts#L13)

@@ -526,3 +477,3 @@ ___

[src/ts/randBytes.ts:54](https://github.com/juanelas/bigint-crypto-utils/blob/6894e72/src/ts/randBytes.ts#L54)
[src/ts/randBytes.ts:54](https://github.com/juanelas/bigint-crypto-utils/blob/8f2c2a5/src/ts/randBytes.ts#L54)

@@ -535,18 +486,8 @@ ___

Finds the smallest positive element that is congruent to a in modulo n
**`Remarks`**
a and b must be the same type, either number or bigint
**`Throws`**
RangeError if n <= 0
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `a` | `number` \| `bigint` | An integer |
| `n` | `number` \| `bigint` | The modulo |
| Name | Type |
| :------ | :------ |
| `a` | `number` \| `bigint` |
| `n` | `number` \| `bigint` |

@@ -557,6 +498,4 @@ #### Returns

A bigint with the smallest positive representation of a modulo n
#### Defined in
node_modules/bigint-mod-arith/types/toZn.d.ts:14
node_modules/bigint-mod-arith/types/toZn.d.ts:1
{
"name": "bigint-crypto-utils",
"version": "3.1.8",
"version": "3.2.1",
"description": "Arbitrary precision modular arithmetic, cryptographically secure random numbers and strong probable prime generation/testing. It works in modern browsers, Angular, React, Node.js, etc. since it uses the native JS implementation of BigInt",

@@ -25,7 +25,7 @@ "keywords": [

"engines": {
"node": ">=10.4.0"
"node": ">=14.0.0"
},
"type": "module",
"types": "./types/index.d.ts",
"main": "./dist/cjs/index.node.cjs",
"types": "./types/index.d.cts",
"browser": "./dist/esm/index.browser.js",

@@ -36,17 +36,36 @@ "module": "./dist/esm/index.node.js",

"node": {
"require": "./dist/cjs/index.node.cjs",
"import": "./dist/esm/index.node.js",
"module": "./dist/esm/index.node.js"
"require": {
"default": "./dist/cjs/index.node.cjs",
"types": "./types/index.d.cts"
},
"import": {
"default": "./dist/esm/index.node.js",
"types": "./types/index.d.ts"
}
},
"default": "./dist/esm/index.browser.js"
"default": {
"default": "./dist/esm/index.browser.js",
"types": "./types/index.d.ts"
}
},
"./esm-browser-bundle": "./dist/bundles/esm.min.js",
"./esm-browser-bundle-nomin": "./dist/bundles/esm.js",
"./iife-browser-bundle": "./dist/bundles/iife.js",
"./umd-browser-bundle": "./dist/bundles/umd.js",
"./types": "./types/index.d.ts"
"./types": "./types/index.d.cts"
},
"imports": {
"#pkg": {
"import": "./dist/esm/index.node.js",
"require": "./dist/cjs/index.node.cjs"
"require": {
"default": "./dist/cjs/index.node.cjs",
"types": "./types/index.d.cts"
},
"import": {
"default": "./dist/esm/index.node.js",
"types": "./types/index.d.ts"
},
"default": {
"default": "./dist/esm/index.browser.js",
"types": "./types/index.d.ts"
}
}

@@ -64,10 +83,12 @@ },

"scripts": {
"build": "run-s lint build:js docs",
"build": "run-s lint:src build:js lint:test docs",
"build:js": "rollup -c build/rollup.config.js",
"clean": "rimraf .mocha-ts coverage dist types docs",
"coverage": "c8 --clean --check-coverage --exclude '{src/ts/**/*.spec.ts,test,test-vectors,build}' --exclude-after-remap --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --commonjs ",
"coverage": "c8 --clean --check-coverage --exclude \"{src/ts/**/*.spec.ts,test,test-vectors,build}\" --exclude-after-remap --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --commonjs ",
"docs": "node build/build.docs.cjs",
"git:add": "git add -A",
"lint": "ts-standard --fix",
"mocha-ts": "node --experimental-modules --es-module-specifier-resolution=node ./build/bin/mocha-ts.cjs ",
"lint:src": "ts-standard --fix \"src/**/!(*.spec).ts\"",
"lint:test": "ts-standard --fix \"{test/**/*.ts,src/**/*.spec.ts}\"",
"mocha-ts": "node --experimental-modules --experimental-json-modules --es-module-specifier-resolution=node ./build/bin/mocha-ts.cjs ",
"mocha-ts:cjs": "node ./build/bin/mocha-ts.cjs --commonjs ",

@@ -77,3 +98,3 @@ "mocha-ts:watch": "npm run mocha-ts:cjs -- --watch ",

"mocha-ts:browser-headless": "node build/testing/browser/index.cjs headless ",
"preversion": "run-s clean lint build:js coverage test:browser-headless",
"preversion": "run-s clean lint:src build:js lint:test coverage test:browser-headless",
"version": "run-s docs git:add",

@@ -104,12 +125,23 @@ "postversion": "git push --follow-tags",

"types/**/*",
"build/testing/mocha/mocha-init.js"
"benchmark/**/*"
]
},
"nodeBrowserSkel": {
"badges": {
"workflow": true,
"coveralls": true
},
"git": {
"branch": "main"
}
},
"devDependencies": {
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.2.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-inject": "^5.0.3",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.0",
"@types/chai": "^4.2.22",

@@ -120,22 +152,20 @@ "@types/mocha": "^10.0.0",

"dotenv": "^16.0.3",
"fs-extra": "^10.1.0",
"glob": "^8.0.1",
"glob": "^9.3.4",
"json5": "^2.2.0",
"minimatch": "^5.0.1",
"minimatch": "^8.0.3",
"mocha": "^10.0.0",
"npm-run-all": "^4.1.5",
"pirates": "^4.0.1",
"puppeteer": "^18.0.5",
"rimraf": "^3.0.2",
"rollup": "^2.57.0",
"rollup-plugin-terser": "^7.0.2",
"ts-standard": "^11.0.0",
"puppeteer": "^19.1.2",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"ts-standard": "^12.0.2",
"tslib": "^2.3.1",
"typedoc": "^0.23.0",
"typedoc-plugin-markdown": "^3.11.0",
"typescript": "^4.4.3"
"typedoc": "~0.23.0",
"typedoc-plugin-markdown": "~3.14.0",
"typescript": "^5.0.3"
},
"dependencies": {
"bigint-mod-arith": "^3.1.0"
"bigint-mod-arith": "^3.2.0"
}
}

@@ -1,2 +0,2 @@

export function fromBuffer (buf: Uint8Array|Buffer): bigint {
export function fromBuffer (buf: Uint8Array | Buffer): bigint {
let ret = 0n

@@ -3,0 +3,0 @@ for (const i of buf.values()) {

export { abs, bitLength, eGcd, gcd, lcm, max, min, modInv, modPow, toZn } from 'bigint-mod-arith'
export { isProbablyPrime } from './isProbablyPrime'
export { prime, primeSync } from './prime'
export { randBetween } from './randBetween'
export { randBits, randBitsSync } from './randBits'
export { randBytes, randBytesSync } from './randBytes'
export { isProbablyPrime } from './isProbablyPrime.js'
export { prime, primeSync } from './prime.js'
export { randBetween } from './randBetween.js'
export { randBits, randBitsSync } from './randBits.js'
export { randBytes, randBytesSync } from './randBytes.js'
import { eGcd, modInv, modPow, toZn, bitLength } from 'bigint-mod-arith'
import { fromBuffer } from './fromBuffer'
import { randBetween } from './randBetween'
import { randBitsSync } from './randBits'
import { randBytesSync } from './randBytes'
import { _useWorkers, _workerUrl, WorkerToMainMsg, MainToWorkerMsg } from './workerUtils'
import { fromBuffer } from './fromBuffer.js'
import { randBetween } from './randBetween.js'
import { randBitsSync } from './randBits.js'
import { randBytesSync } from './randBytes.js'
import { _useWorkers, _workerUrl, WorkerToMainMsg, MainToWorkerMsg } from './workerUtils.js'

@@ -43,3 +43,3 @@ /**

rnd: w as bigint,
iterations: iterations,
iterations,
id: 0

@@ -73,3 +73,3 @@ }

rnd: w as bigint,
iterations: iterations,
iterations,
id: 0

@@ -442,3 +442,3 @@ }

_bcu: {
isPrime: isPrime,
isPrime,
value: data._bcu.rnd,

@@ -445,0 +445,0 @@ id: data._bcu.id

@@ -1,5 +0,5 @@

import { fromBuffer } from './fromBuffer'
import { _isProbablyPrime, _isProbablyPrimeWorkerUrl } from './isProbablyPrime'
import { randBits, randBitsSync } from './randBits'
import { _useWorkers, WorkerToMainMsg, MainToWorkerMsg } from './workerUtils'
import { fromBuffer } from './fromBuffer.js'
import { _isProbablyPrime, _isProbablyPrimeWorkerUrl } from './isProbablyPrime.js'
import { randBits, randBitsSync } from './randBits.js'
import { _useWorkers, WorkerToMainMsg, MainToWorkerMsg } from './workerUtils.js'
import type { Worker as NodeWorker } from 'worker_threads'

@@ -58,4 +58,4 @@

_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: msg._bcu.id

@@ -85,8 +85,8 @@ }

for (let i = 0; i < workerList.length; i++) {
randBits(bitLength, true).then(function (buf: Uint8Array|Buffer) {
randBits(bitLength, true).then(function (buf: Uint8Array | Buffer) {
const rnd = fromBuffer(buf)
workerList[i].postMessage({
_bcu: {
rnd: rnd,
iterations: iterations,
rnd,
iterations,
id: i

@@ -93,0 +93,0 @@ }

import { bitLength } from 'bigint-mod-arith'
import { fromBuffer } from './fromBuffer'
import { randBitsSync } from './randBits'
import { fromBuffer } from './fromBuffer.js'
import { randBitsSync } from './randBits.js'

@@ -5,0 +5,0 @@ /**

@@ -1,2 +0,2 @@

import { randBytes, randBytesSync } from './randBytes'
import { randBytes, randBytesSync } from './randBytes.js'

@@ -43,3 +43,3 @@ /**

*/
export function randBitsSync (bitLength: number, forceLength: boolean = false): Uint8Array|Buffer {
export function randBitsSync (bitLength: number, forceLength: boolean = false): Uint8Array | Buffer {
if (bitLength < 1) throw new RangeError('bitLength MUST be > 0')

@@ -46,0 +46,0 @@

@@ -54,3 +54,3 @@ if (!IS_BROWSER) var crypto = await import('crypto') // eslint-disable-line no-var

*/
export function randBytesSync (byteLength: number, forceLength: boolean = false): Uint8Array|Buffer {
export function randBytesSync (byteLength: number, forceLength: boolean = false): Uint8Array | Buffer {
if (byteLength < 1) throw new RangeError('byteLength MUST be > 0')

@@ -57,0 +57,0 @@

export { abs, bitLength, eGcd, gcd, lcm, max, min, modInv, modPow, toZn } from 'bigint-mod-arith';
export { isProbablyPrime } from './isProbablyPrime';
export { prime, primeSync } from './prime';
export { randBetween } from './randBetween';
export { randBits, randBitsSync } from './randBits';
export { randBytes, randBytesSync } from './randBytes';
export { isProbablyPrime } from './isProbablyPrime.js';
export { prime, primeSync } from './prime.js';
export { randBetween } from './randBetween.js';
export { randBits, randBitsSync } from './randBits.js';
export { randBytes, randBytesSync } from './randBytes.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,13 +0,1 @@

/**
* The test first tries if any of the first 250 small primes are a factor of the input number and then passes several
* iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1)
*
* @param w - A positive integer to be tested for primality
* @param iterations - The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 of FIPS 186-4
* @param disableWorkers - Disable the use of workers for the primality test
*
* @throws {@link RangeError} if w<0
*
* @returns A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite)
*/
export declare function isProbablyPrime(w: number | bigint, iterations?: number, disableWorkers?: boolean): Promise<boolean>;

@@ -14,0 +2,0 @@ export declare function _isProbablyPrime(w: bigint, iterations: number): boolean;

@@ -1,28 +0,3 @@

/**
* 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.
*/
export declare function prime(bitLength: number, iterations?: number): Promise<bigint>;
/**
* 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.
*/
export declare function primeSync(bitLength: number, iterations?: number): bigint;
//# sourceMappingURL=prime.d.ts.map

@@ -1,11 +0,2 @@

/**
* 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]
*/
export declare function randBetween(max: bigint, min?: bigint): bigint;
//# sourceMappingURL=randBetween.d.ts.map
/// <reference types="node" />
/**
* 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
*/
export declare function randBits(bitLength: number, forceLength?: boolean): Promise<Uint8Array | Buffer>;
/**
* 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
*/
export declare function randBitsSync(bitLength: number, forceLength?: boolean): Uint8Array | Buffer;
//# sourceMappingURL=randBits.d.ts.map
/// <reference types="node" />
/**
* 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
*/
export declare function randBytes(byteLength: number, forceLength?: boolean): Promise<Uint8Array | Buffer>;
/**
* 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
*/
export declare function randBytesSync(byteLength: number, forceLength?: boolean): Uint8Array | Buffer;
//# sourceMappingURL=randBytes.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc