From 6e288c7c251e6f728d377911910dbf051d39a3cc Mon Sep 17 00:00:00 2001 From: Rich Trott <rtrott@gmail.com> Date: Sat, 10 Apr 2021 22:23:34 -0700 Subject: [PATCH 1/3] doc: standardize on pseudorandom in webcrypto docs Our docs use both _pseudo-random_ and _pseudorandom_. Standardize on _pseudorandom_. --- doc/api/webcrypto.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 43327f58e5b6ae..0c29d9e2231c9e 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` <!-- YAML From 6a7b803800bf3f6d7d1b3559a1f2af7279092a3c Mon Sep 17 00:00:00 2001 From: Rich Trott <rtrott@gmail.com> Date: Sat, 10 Apr 2021 22:25:30 -0700 Subject: [PATCH 2/3] doc: standardize on pseudorandom in tls docs Our docs use both _pseudo-random_ and _pseudorandom_. Standardize on _pseudorandom_. --- doc/api/tls.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 3a2edf72c07b7f58190b3358054089b1bd8e9d33 Mon Sep 17 00:00:00 2001 From: Rich Trott <rtrott@gmail.com> Date: Sat, 10 Apr 2021 22:26:48 -0700 Subject: [PATCH 3/3] doc: standardize on pseudorandom in crypto docs Our docs use both _pseudo-random_ and _pseudorandom_. Standardize on _pseudorandom_. --- doc/api/crypto.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 5fff5d7c0683f0..282e80329ae216 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 @@ -5116,10 +5116,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 @@ -5134,7 +5134,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