@@ -57,7 +57,7 @@ crypto.createHash = function(algorithm) {};
57
57
58
58
/**
59
59
* @param {string } algorithm
60
- * @param {Object } options
60
+ * @param {Object= } options
61
61
* @constructor
62
62
* @extends stream.Transform
63
63
*/
@@ -85,7 +85,7 @@ crypto.createHmac = function(algorithm, key) {};
85
85
/**
86
86
* @param {string } hmac
87
87
* @param {string|buffer.Buffer } key
88
- * @param {Object } options
88
+ * @param {Object= } options
89
89
* @constructor
90
90
* @extends stream.Transform
91
91
*/
@@ -112,14 +112,14 @@ crypto.createCipher = function(algorithm, password) {};
112
112
* @param {string } algorithm
113
113
* @param {string|buffer.Buffer } key
114
114
* @param {string|buffer.Buffer } iv
115
- * @return {crypto.Cipher }
115
+ * @return {crypto.Cipheriv }
116
116
*/
117
117
crypto . createCipheriv = function ( algorithm , key , iv ) { } ;
118
118
119
119
/**
120
120
* @param {string|buffer.Buffer } cipher
121
121
* @param {string } password
122
- * @param {Object } options
122
+ * @param {Object= } options
123
123
* @constructor
124
124
* @extends stream.Transform
125
125
*/
@@ -135,26 +135,48 @@ crypto.Cipher.prototype.update = function(data, input_encoding, output_encoding)
135
135
136
136
/**
137
137
* @name crypto.Cipher.prototype.final
138
- * @function
139
138
* @param {string } output_encoding
140
139
* @return {string|buffer.Buffer }
141
140
*/
142
- // crypto.Cipher.prototype. final = function(output_encoding) {};
141
+ crypto . Cipher . prototype [ ' final' ] = function ( output_encoding ) { } ;
143
142
144
143
/**
145
144
* @param {boolean= } auto_padding
146
145
*/
147
146
crypto . Cipher . prototype . setAutoPadding = function ( auto_padding ) { } ;
148
147
149
148
/**
150
- * @param {string|crypto.Cipheriv } cipher
149
+ * Note: Cipheriv mixes update, final, and setAutoPadding from Cipher but
150
+ * doesn't inherit directly from Cipher.
151
+ *
152
+ * @param {string } cipher
151
153
* @param {string|buffer.Buffer } key
152
154
* @param {string|buffer.Buffer } iv
153
155
* @constructor
154
- * @extends crypto.Cipher
156
+ * @extends stream.Transform
155
157
*/
156
158
crypto . Cipheriv = function ( cipher , key , iv ) { } ;
157
159
160
+ /**
161
+ * @param {string|buffer.Buffer } data
162
+ * @param {string= } input_encoding
163
+ * @param {string= } output_encoding
164
+ * @return {string|buffer.Buffer }
165
+ */
166
+ crypto . Cipheriv . prototype . update = function ( data , input_encoding , output_encoding ) { } ;
167
+
168
+ /**
169
+ * @name crypto.Cipheriv.prototype.final
170
+ * @param {string } output_encoding
171
+ * @return {string|buffer.Buffer }
172
+ */
173
+ crypto . Cipheriv . prototype [ 'final' ] = function ( output_encoding ) { } ;
174
+
175
+ /**
176
+ * @param {boolean= } auto_padding
177
+ */
178
+ crypto . Cipheriv . prototype . setAutoPadding = function ( auto_padding ) { } ;
179
+
158
180
/**
159
181
* @param {string } algorithm
160
182
* @param {string|buffer.Buffer } password
@@ -166,14 +188,17 @@ crypto.createDecipher = function(algorithm, password) {};
166
188
* @param {string } algorithm
167
189
* @param {string|buffer.Buffer } key
168
190
* @param {string|buffer.Buffer } iv
169
- * @return {crypto.Decipher }
191
+ * @return {crypto.Decipheriv }
170
192
*/
171
193
crypto . createDecipheriv = function ( algorithm , key , iv ) { } ;
172
194
173
195
/**
174
- * @param {string|buffer.Buffer|crypto.Decipher } cipher
196
+ * Note: Decipher mixes update, final, and setAutoPadding from Cipher but
197
+ * doesn't inherit directly from Cipher.
198
+ *
199
+ * @param {string|buffer.Buffer } cipher
175
200
* @param {string|buffer.Buffer } password
176
- * @param {Object } options
201
+ * @param {Object= } options
177
202
* @constructor
178
203
* @extends stream.Transform
179
204
*/
@@ -189,41 +214,70 @@ crypto.Decipher.prototype.update = function(data, input_encoding, output_encodin
189
214
190
215
/**
191
216
* @name crypto.Decipher.prototype.final
192
- * @function
193
217
* @param {string } output_encoding
194
218
* @return {string|buffer.Buffer }
195
219
*/
196
- // crypto.Decipher.prototype.final = function(output_encoding) {};
220
+ crypto . Decipher . prototype [ 'final' ] = function ( output_encoding ) { } ;
221
+
222
+ /**
223
+ * @param {string } output_encoding
224
+ * @return {string|buffer.Buffer }
225
+ */
226
+ crypto . Decipher . prototype . finaltol = function ( output_encoding ) { } ;
197
227
198
228
/**
199
229
* @param {boolean= } auto_padding
200
230
*/
201
231
crypto . Decipher . prototype . setAutoPadding = function ( auto_padding ) { } ;
202
232
203
233
/**
234
+ * Note: Decipheriv mixes update, final, and setAutoPadding from Cipher but
235
+ * doesn't inherit directly from Cipher.
236
+ *
204
237
* @param {string|buffer.Buffer|crypto.Decipheriv } cipher
205
238
* @param {string|buffer.Buffer } key
206
239
* @param {string|buffer.Buffer } iv
207
- * @param {Object } options
240
+ * @param {Object= } options
208
241
* @constructor
209
- * @extends crypto.Cipher
242
+ * @extends stream.Transform
210
243
*/
211
244
crypto . Decipheriv = function ( cipher , key , iv , options ) { } ;
212
245
213
246
/**
214
- * @type {crypto.Cipher.prototype.final }
247
+ * @param {string|buffer.Buffer } data
248
+ * @param {string= } input_encoding
249
+ * @param {string= } output_encoding
250
+ * @return {string|buffer.Buffer }
251
+ */
252
+ crypto . Decipheriv . prototype . update = function ( data , input_encoding , output_encoding ) { } ;
253
+
254
+ /**
255
+ * @name crypto.Decipheriv.prototype.final
256
+ * @param {string } output_encoding
257
+ * @return {string|buffer.Buffer }
258
+ */
259
+ crypto . Decipheriv . prototype [ 'final' ] = function ( output_encoding ) { } ;
260
+
261
+ /**
262
+ * @param {string } output_encoding
263
+ * @return {string|buffer.Buffer }
215
264
*/
216
- crypto . Decipheriv . prototype . finaltol ;
265
+ crypto . Decipheriv . prototype . finaltol = function ( output_encoding ) { } ;
266
+
267
+ /**
268
+ * @param {boolean= } auto_padding
269
+ */
270
+ crypto . Decipheriv . prototype . setAutoPadding = function ( auto_padding ) { } ;
217
271
218
272
/**
219
273
* @param {string } algorithm
220
- * @return {crypto.Signer }
274
+ * @return {crypto.Sign }
221
275
*/
222
276
crypto . createSign = function ( algorithm ) { } ;
223
277
224
278
/**
225
279
* @param {string } algorithm
226
- * @param {Object } options
280
+ * @param {Object= } options
227
281
* @constructor
228
282
* @extends stream.Writable
229
283
*/
@@ -241,11 +295,6 @@ crypto.Sign.prototype.update = function(data) {};
241
295
*/
242
296
crypto . Sign . prototype . sign = function ( private_key , output_format ) { } ;
243
297
244
- /**
245
- * @type {crypto.Sign }
246
- */
247
- crypto . Signer ; // Not sure about API docs / source diff
248
-
249
298
/**
250
299
* @param {string } algorithm
251
300
* @return crypto.Verify
@@ -254,17 +303,12 @@ crypto.createVerify = function(algorithm) {};
254
303
255
304
/**
256
305
* @param {string } algorithm
257
- * @param {Object } options
306
+ * @param {Object= } options
258
307
* @constructor
259
308
* @extends stream.Writable
260
309
*/
261
310
crypto . Verify = function ( algorithm , options ) { } ;
262
311
263
- /**
264
- * @type {crypto.Sign._write }
265
- */
266
- crypto . Verify . prototype . _write ;
267
-
268
312
/**
269
313
* @param {string|buffer.Buffer } data
270
314
*/
@@ -287,7 +331,7 @@ crypto.createDiffieHellman = function(prime, encoding) {};
287
331
288
332
/**
289
333
* @param {number } sizeOrKey
290
- * @param {string } encoding
334
+ * @param {string= } encoding
291
335
* @constructor
292
336
*/
293
337
crypto . DiffieHellman = function ( sizeOrKey , encoding ) { } ;
@@ -345,70 +389,111 @@ crypto.DiffieHellman.prototype.setPublicKey = function(key, encoding) {};
345
389
crypto . DiffieHellman . prototype . setPrivateKey = function ( key , encoding ) { } ;
346
390
347
391
/**
392
+ * Note: DiffieHellmanGroup mixes DiffieHellman but doesn't inherit directly.
393
+ *
348
394
* @param {string } name
349
395
* @constructor
350
396
*/
351
397
crypto . DiffieHellmanGroup = function ( name ) { } ;
352
398
353
399
/**
354
- * TODO: Not sure if this works.
400
+ * @param {string= } encoding
401
+ * @return {string|buffer.Buffer }
402
+ */
403
+ crypto . DiffieHellmanGroup . prototype . generateKeys = function ( encoding ) { } ;
404
+
405
+ /**
406
+ * @param {string|buffer.Buffer } key
407
+ * @param {string= } inEnc
408
+ * @param {string= } outEnc
409
+ * @return {string|buffer.Buffer }
410
+ */
411
+ crypto . DiffieHellmanGroup . prototype . computeSecret = function ( key , inEnc , outEnc ) { } ;
412
+
413
+ /**
414
+ * @param {string= } encoding
415
+ * @return {string|buffer.Buffer }
355
416
*/
356
- crypto . DiffieHellmanGroup . prototype . generateKeys = crypto . DiffieHellman . prototype . generateKeys ;
417
+ crypto . DiffieHellmanGroup . prototype . getPrime = function ( encoding ) { } ;
357
418
358
419
/**
359
- * TODO: Not sure if this works.
420
+ * @param {string= } encoding
421
+ * @return {string|buffer.Buffer }
360
422
*/
361
- crypto . DiffieHellmanGroup . prototype . computeSecret = crypto . DiffieHellman . prototype . computeSecret ;
423
+ crypto . DiffieHellmanGroup . prototype . getGenerator = function ( encoding ) { } ;
362
424
363
425
/**
364
- * @type {crypto.DiffieHellman.prototype.getPrime }
426
+ * @param {string= } encoding
427
+ * @return {string|buffer.Buffer }
365
428
*/
366
- crypto . DiffieHellmanGroup . prototype . getPrime = crypto . DiffieHellman . prototype . getPrime ;
429
+ crypto . DiffieHellmanGroup . prototype . getPublicKey = function ( encoding ) { } ;
367
430
368
431
/**
369
- * @type {crypto.DiffieHellman.prototype.getGenerator }
432
+ * @param {string } encoding
433
+ * @return {string|buffer.Buffer }
434
+ */
435
+ crypto . DiffieHellmanGroup . prototype . getPrivateKey = function ( encoding ) { }
436
+
437
+ /**
438
+ * @param {string|buffer.Buffer } key
439
+ * @param {string= } encoding
440
+ * @return {crypto.DiffieHellmanGroup }
370
441
*/
371
- crypto . DiffieHellmanGroup . prototype . getGenerator = crypto . DiffieHellman . prototype . getGenerator ;
442
+ crypto . DiffieHellmanGroup . prototype . setPublicKey = function ( key , encoding ) { } ;
372
443
373
444
/**
374
- * @type {crypto.DiffieHellman.prototype.getPublicKey }
445
+ * @param {string|buffer.Buffer } key
446
+ * @param {string= } encoding
447
+ * @return {crypto.DiffieHellmanGroup }
375
448
*/
376
- crypto . DiffieHellmanGroup . prototype . getPublicKey = crypto . DiffieHellman . prototype . getPublicKey ;
449
+ crypto . DiffieHellmanGroup . prototype . setPrivateKey = function ( key , encoding ) { } ;
377
450
378
451
/**
379
- * @type {crypto.DiffieHellman.prototype.getPrivateKey }
452
+ * @param {string } group_name
453
+ * @return {crypto.DiffieHellmanGroup }
380
454
*/
381
- crypto . DiffieHellmanGroup . prototype . getPrivateKey = crypto . DiffieHellman . prototype . getPrivateKey ;
455
+ crypto . getDiffieHellman = function ( group_name ) { } ;
382
456
383
457
/**
384
- * @type {crypto.DiffieHellman.prototype.setPublicKey }
458
+ * @param {string|buffer.Buffer } password
459
+ * @param {string|buffer.Buffer } salt
460
+ * @param {number } iterations
461
+ * @param {number } keylen
462
+ * @param {function(*, string) } callback
385
463
*/
386
- crypto . DiffieHellmanGroup . prototype . setPublicKey = crypto . DiffieHellman . prototype . setPublicKey ;
464
+ crypto . pbkdf2 = function ( password , salt , iterations , keylen , callback ) { } ;
387
465
388
466
/**
389
- * @type {crypto.DiffieHellman.prototype.setPrivateKey }
467
+ * @param {string|buffer.Buffer } password
468
+ * @param {string|buffer.Buffer } salt
469
+ * @param {number } iterations
470
+ * @param {number } keylen
390
471
*/
391
- crypto . DiffieHellmanGroup . prototype . setPrivateKey = crypto . DiffieHellman . prototype . setPrivateKey ;
472
+ crypto . pbkdf2Sync = function ( password , salt , iterations , keylen ) { } ;
392
473
393
474
/**
394
- * @type {* }
475
+ * @param {number } size
476
+ * @param {function(Error, buffer.Buffer)= } callback
395
477
*/
396
- crypto . randomBytes ;
478
+ crypto . randomBytes = function ( size , callback ) { } ;
397
479
398
480
/**
399
- * @type {* }
481
+ * @param {number } size
482
+ * @param {function(Error, buffer.Buffer)= } callback
400
483
*/
401
- crypto . pseudoRandomBytes ;
484
+ crypto . pseudoRandomBytes = function ( size , callback ) { } ;
402
485
403
486
/**
404
- * @type {crypto.randomBytes }
487
+ * @param {number } size
488
+ * @param {function(Error, buffer.Buffer)= } callback
405
489
*/
406
- crypto . rng = crypto . randomBytes ;
490
+ crypto . rng = function ( size , callback ) { } ;
407
491
408
492
/**
409
- * @type {crypto.pseudoRandomBytes }
493
+ * @param {number } size
494
+ * @param {function(Error, buffer.Buffer)= } callback
410
495
*/
411
- crypto . prng = crypto . pseudoRandomBytes ;
496
+ crypto . prng = function ( size , callback ) { } ;
412
497
413
498
/**
414
499
* @return {Array.<string> }
0 commit comments