From 349fffcbdd8908d1df1731b2f0c204bd1b69b8b2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 10 Apr 2021 22:23:34 -0700 Subject: [PATCH] doc: standardize on pseudorandom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our docs use both _pseudo-random_ and _pseudorandom_. Standardize on _pseudorandom_. PR-URL: https://github.com/nodejs/node/pull/38196 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 14 +++++++------- doc/api/tls.md | 4 ++-- doc/api/webcrypto.md | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index bd27e27424f1e5..9b4559473ca7e5 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -3605,7 +3605,7 @@ added: v15.8.0 * `err` {Error} * `prime` {ArrayBuffer|bigint} -Generates a pseudo-random prime of `size` bits. +Generates a pseudorandom prime of `size` bits. If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. @@ -3645,7 +3645,7 @@ added: v15.8.0 as a `bigint`. * Returns: {ArrayBuffer|bigint} -Generates a pseudo-random prime of `size` bits. +Generates a pseudorandom prime of `size` bits. If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. @@ -4316,7 +4316,7 @@ changes: * `buf` {Buffer} * Returns: {Buffer} if the `callback` function is not provided. -Generates cryptographically strong pseudo-random data. The `size` argument +Generates cryptographically strong pseudorandom data. The `size` argument is a number indicating the number of bytes to generate. If a `callback` function is provided, the bytes are generated asynchronously @@ -5101,10 +5101,10 @@ When passing strings to cryptographic APIs, consider the following factors. * Not all byte sequences are valid UTF-8 strings. Therefore, when a byte sequence of length `n` is derived from a string, its entropy is generally - lower than the entropy of a random or pseudo-random `n` byte sequence. + lower than the entropy of a random or pseudorandom `n` byte sequence. For example, no UTF-8 string will result in the byte sequence `c0 af`. Secret - keys should almost exclusively be random or pseudo-random byte sequences. -* Similarly, when converting random or pseudo-random byte sequences to UTF-8 + keys should almost exclusively be random or pseudorandom byte sequences. +* Similarly, when converting random or pseudorandom byte sequences to UTF-8 strings, subsequences that do not represent valid code points may be replaced by the Unicode replacement character (`U+FFFD`). The byte representation of the resulting Unicode string may, therefore, not be equal to the byte sequence @@ -5119,7 +5119,7 @@ When passing strings to cryptographic APIs, consider the following factors. ``` The outputs of ciphers, hash functions, signature algorithms, and key - derivation functions are pseudo-random byte sequences and should not be + derivation functions are pseudorandom byte sequences and should not be used as Unicode strings. * When strings are obtained from user input, some Unicode characters can be represented in multiple equivalent ways that result in different byte diff --git a/doc/api/tls.md b/doc/api/tls.md index 6ccfb6ca2fd7a5..d1f07363c982ae 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1772,7 +1772,7 @@ changes: **Default:** none, see `minVersion`. * `sessionIdContext` {string} Opaque identifier used by servers to ensure session state is not shared between applications. Unused by clients. - * `ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudo-random + * `ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudorandom data. See [Session Resumption][] for more information. * `sessionTimeout` {number} The number of seconds after which a TLS session created by the server will no longer be resumable. See @@ -1915,7 +1915,7 @@ changes: If `callback` is called with a falsy `ctx` argument, the default secure context of the server will be used. If `SNICallback` wasn't provided the default callback with high-level API will be used (see below). - * `ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudo-random + * `ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudorandom data. See [Session Resumption][] for more information. * `pskCallback` {Function} * socket: {tls.TLSSocket} the server [`tls.TLSSocket`][] instance for diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 55a1c729e631c2..66d577192f5648 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -1175,7 +1175,7 @@ added: v15.0.0 * Type: {ArrayBuffer|TypedArray|DataView|Buffer} The salt value significantly improves the strength of the HKDF algorithm. -It should be random or pseudo-random and should be the same length as the +It should be random or pseudorandom and should be the same length as the output of the digest function (for instance, if using `'SHA-256'` as the digest, the salt should be 256-bits of random data). @@ -1327,7 +1327,7 @@ added: v15.0.0 * Type: {ArrayBuffer|TypedArray|DataView|Buffer} -Should be at least 16 random or pseudo-random bytes. +Should be at least 16 random or pseudorandom bytes. ### Class: `RsaHashedImportParams`