diff --git a/README.md b/README.md index cd14748..e48959a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Utils for working with cryptography using native JS (stage 3) implementation of to work with modular arithmetics along with secure random numbers and a fast strong probable prime generation/testing (parallelised multi-threaded Miller-Rabin primality test). It can be used by any [Web Browser or webview supporting BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility) -and with Node.js (>=10.4.0). In the former case, for multi-threaded primality tests, you should use Node.js 11 or enable +and with Node.js (>=10.4.0). In the latter case, for multi-threaded primality tests, you should use Node.js 11 or enable at runtime with `node --experimental-worker` with Node.js >=10.5.0. _The operations supported on BigInts are not constant time. BigInt can be therefore **[unsuitable for use in @@ -195,7 +195,7 @@ The test first tries if any of the first 250 small primes are a factor of the in iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1) **Kind**: global function -**Returns**: Promise - A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite) +**Returns**: Promise - A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) | Param | Type | Description | | --- | --- | --- | diff --git a/dist/bigint-crypto-utils-latest.browser.js b/dist/bigint-crypto-utils-latest.browser.js index f7f8130..e8d77d3 100644 --- a/dist/bigint-crypto-utils-latest.browser.js +++ b/dist/bigint-crypto-utils-latest.browser.js @@ -94,7 +94,7 @@ var bigintCryptoUtils = (function (exports) { * @param {bigint} w An integer to be tested for primality * @param {number} iterations The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 * - * @return {Promise} A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite) + * @return {Promise} A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) */ async function isProbablyPrime(w, iterations = 16) { { // browser diff --git a/dist/bigint-crypto-utils-latest.browser.mod.js b/dist/bigint-crypto-utils-latest.browser.mod.js index 3ffaeef..db939e1 100644 --- a/dist/bigint-crypto-utils-latest.browser.mod.js +++ b/dist/bigint-crypto-utils-latest.browser.mod.js @@ -91,7 +91,7 @@ function gcd(a, b) { * @param {bigint} w An integer to be tested for primality * @param {number} iterations The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 * - * @return {Promise} A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite) + * @return {Promise} A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) */ async function isProbablyPrime(w, iterations = 16) { { // browser diff --git a/dist/bigint-crypto-utils-latest.node.js b/dist/bigint-crypto-utils-latest.node.js index 5f4bfb6..60411a1 100644 --- a/dist/bigint-crypto-utils-latest.node.js +++ b/dist/bigint-crypto-utils-latest.node.js @@ -95,7 +95,7 @@ function gcd(a, b) { * @param {bigint} w An integer to be tested for primality * @param {number} iterations The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 * - * @return {Promise} A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite) + * @return {Promise} A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) */ async function isProbablyPrime(w, iterations = 16) { { // Node.js diff --git a/src/main.js b/src/main.js index 24d6b57..7998f73 100644 --- a/src/main.js +++ b/src/main.js @@ -93,7 +93,7 @@ export function gcd(a, b) { * @param {bigint} w An integer to be tested for primality * @param {number} iterations The number of iterations for the primality test. The value shall be consistent with Table C.1, C.2 or C.3 * - * @return {Promise} A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite) + * @return {Promise} A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite) */ export async function isProbablyPrime(w, iterations = 16) { if (!process.browser) { // Node.js