Skip to content

Commit

Permalink
doc: list supported MODP groups explicitly
Browse files Browse the repository at this point in the history
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: #43896

PR-URL: #43986
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
  • Loading branch information
tniessen authored Jul 27, 2022
1 parent abddacb commit a3d3e9d
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1181,20 +1181,16 @@ const { createDiffieHellmanGroup } = require('node:crypto');
const dh = createDiffieHellmanGroup('modp1');
```

The name (e.g. `'modp1'`) is taken from [RFC 2412][] (modp1 and 2) and
[RFC 3526][]:

```console
$ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
modp1 # 768 bits
modp2 # 1024 bits
modp5 # 1536 bits
modp14 # 2048 bits
modp15 # etc.
modp16
modp17
modp18
```
The following groups are supported:

* `'modp1'` (768 bits, [RFC 2409][] Section 6.1)
* `'modp2'` (1024 bits, [RFC 2409][] Section 6.2)
* `'modp5'` (1536 bits, [RFC 3526][] Section 2)
* `'modp14'` (2048 bits, [RFC 3526][] Section 3)
* `'modp15'` (3072 bits, [RFC 3526][] Section 4)
* `'modp16'` (4096 bits, [RFC 3526][] Section 5)
* `'modp17'` (6144 bits, [RFC 3526][] Section 6)
* `'modp18'` (8192 bits, [RFC 3526][] Section 7)

## Class: `ECDH`

Expand Down Expand Up @@ -6105,6 +6101,7 @@ See the [list of SSL OP Flags][] for details.
[Nonce-Disrespecting Adversaries]: https://github.com/nonce-disrespect/nonce-disrespect
[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html
[RFC 1421]: https://www.rfc-editor.org/rfc/rfc1421.txt
[RFC 2409]: https://www.rfc-editor.org/rfc/rfc2409.txt
[RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt
[RFC 2818]: https://www.rfc-editor.org/rfc/rfc2818.txt
[RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt
Expand Down

0 comments on commit a3d3e9d

Please sign in to comment.