fixed typo
This commit is contained in:
parent
127bb0a1ca
commit
4069f4a335
|
@ -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**: <code>Promise</code> - A promise that resolve to a boolean that is either true (a probably prime number) or false (definitely composite)
|
||||
**Returns**: <code>Promise</code> - A promise that resolves to a boolean that is either true (a probably prime number) or false (definitely composite)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue