@@ -698,6 +698,32 @@ module):
698
698
* ` DH_UNABLE_TO_CHECK_GENERATOR `
699
699
* ` DH_NOT_SUITABLE_GENERATOR `
700
700
701
+ ## Class: DiffieHellmanGroup
702
+ <!-- YAML
703
+ added: v0.7.5
704
+ -->
705
+
706
+ The ` DiffieHellmanGroup ` class takes a well-known modp group as its argument but
707
+ otherwise works the same as ` DiffieHellman ` .
708
+
709
+ ``` js
710
+ const name = ' modp1' ;
711
+ const dh = crypto .createDiffieHellmanGroup (name);
712
+ ```
713
+
714
+ ` name ` is taken from [ RFC 2412] [ ] (modp1 and 2) and [ RFC 3526] [ ] :
715
+ ``` console
716
+ $ perl -ne ' print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
717
+ modp1 # 768 bits
718
+ modp2 # 1024 bits
719
+ modp5 # 1536 bits
720
+ modp14 # 2048 bits
721
+ modp15 # etc.
722
+ modp16
723
+ modp17
724
+ modp18
725
+ ```
726
+
701
727
## Class: ECDH
702
728
<!-- YAML
703
729
added: v0.11.14
@@ -1733,6 +1759,16 @@ Creates a `DiffieHellman` key exchange object and generates a prime of
1733
1759
` primeLength ` bits using an optional specific numeric ` generator ` .
1734
1760
If ` generator ` is not specified, the value ` 2 ` is used.
1735
1761
1762
+ ### crypto.createDiffieHellmanGroup(name)
1763
+ <!-- YAML
1764
+ added: v0.9.3
1765
+ -->
1766
+
1767
+ * ` name ` {string}
1768
+ * Returns: {DiffieHellman}
1769
+
1770
+ An alias for [ ` crypto.getDiffieHellman() ` ] [ ]
1771
+
1736
1772
### crypto.createECDH(curveName)
1737
1773
<!-- YAML
1738
1774
added: v0.11.14
@@ -3226,6 +3262,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
3226
3262
[ `crypto.createSign()` ] : #crypto_crypto_createsign_algorithm_options
3227
3263
[ `crypto.createVerify()` ] : #crypto_crypto_createverify_algorithm_options
3228
3264
[ `crypto.getCurves()` ] : #crypto_crypto_getcurves
3265
+ [ `crypto.getDiffieHellman()` ] : #crypto_crypto_getdiffiehellman_groupname
3229
3266
[ `crypto.getHashes()` ] : #crypto_crypto_gethashes
3230
3267
[ `crypto.privateDecrypt()` ] : #crypto_crypto_privatedecrypt_privatekey_buffer
3231
3268
[ `crypto.privateEncrypt()` ] : #crypto_crypto_privateencrypt_privatekey_buffer
0 commit comments