fixed typo

This commit is contained in:
juanelas 2019-04-23 15:22:48 +02:00
parent 127bb0a1ca
commit 4069f4a335
5 changed files with 6 additions and 6 deletions

View File

@ -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 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 (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) 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. 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 _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) iterations of Miller-Rabin Probabilistic Primality Test (FIPS 186-4 C.3.1)
**Kind**: global function **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 | | Param | Type | Description |
| --- | --- | --- | | --- | --- | --- |

View File

@ -94,7 +94,7 @@ var bigintCryptoUtils = (function (exports) {
* @param {bigint} w An integer to be tested for primality * @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 * @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) { async function isProbablyPrime(w, iterations = 16) {
{ // browser { // browser

View File

@ -91,7 +91,7 @@ function gcd(a, b) {
* @param {bigint} w An integer to be tested for primality * @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 * @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) { async function isProbablyPrime(w, iterations = 16) {
{ // browser { // browser

View File

@ -95,7 +95,7 @@ function gcd(a, b) {
* @param {bigint} w An integer to be tested for primality * @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 * @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) { async function isProbablyPrime(w, iterations = 16) {
{ // Node.js { // Node.js

View File

@ -93,7 +93,7 @@ export function gcd(a, b) {
* @param {bigint} w An integer to be tested for primality * @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 * @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) { export async function isProbablyPrime(w, iterations = 16) {
if (!process.browser) { // Node.js if (!process.browser) { // Node.js