File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,28 @@ assert.strictEqual(secret2.toString('base64'), secret1);
22
22
assert . strictEqual ( dh1 . verifyError , 0 ) ;
23
23
assert . strictEqual ( dh2 . verifyError , 0 ) ;
24
24
25
+ {
26
+ const DiffieHellman = crypto . DiffieHellman ;
27
+ const dh = DiffieHellman ( p1 , 'buffer' ) ;
28
+ assert ( dh instanceof DiffieHellman , 'DiffieHellman is expected to return a ' +
29
+ 'new instance when called without `new`' ) ;
30
+ }
31
+
32
+ {
33
+ const DiffieHellmanGroup = crypto . DiffieHellmanGroup ;
34
+ const dhg = DiffieHellmanGroup ( 'modp5' ) ;
35
+ assert ( dhg instanceof DiffieHellmanGroup , 'DiffieHellmanGroup is expected ' +
36
+ 'to return a new instance when ' +
37
+ 'called without `new`' ) ;
38
+ }
39
+
40
+ {
41
+ const ECDH = crypto . ECDH ;
42
+ const ecdh = ECDH ( 'prime256v1' ) ;
43
+ assert ( ecdh instanceof ECDH , 'ECDH is expected to return a new instance ' +
44
+ 'when called without `new`' ) ;
45
+ }
46
+
25
47
[
26
48
[ 0x1 , 0x2 ] ,
27
49
( ) => { } ,
You can’t perform that action at this time.
0 commit comments