@@ -245,7 +245,8 @@ once will result in an error being thrown.
245
245
added: v1.0.0
246
246
-->
247
247
- ` buffer ` {Buffer}
248
- - ` options ` {Object}
248
+ - ` options ` {Object} [ ` stream.transform ` options] [ ]
249
+ - ` plaintextLength ` {number}
249
250
- Returns: {Cipher} for method chaining.
250
251
251
252
When using an authenticated encryption mode (only ` GCM ` and ` CCM ` are currently
@@ -398,7 +399,7 @@ Once the `decipher.final()` method has been called, the `Decipher` object can
398
399
no longer be used to decrypt data. Attempts to call ` decipher.final() ` more
399
400
than once will result in an error being thrown.
400
401
401
- ### decipher.setAAD(buffer)
402
+ ### decipher.setAAD(buffer[ , options ] )
402
403
<!-- YAML
403
404
added: v1.0.0
404
405
changes:
@@ -407,12 +408,18 @@ changes:
407
408
description: This method now returns a reference to `decipher`.
408
409
-->
409
410
- ` buffer ` {Buffer | TypedArray | DataView}
410
- - Returns: {Cipher} for method chaining.
411
+ - ` options ` {Object} [ ` stream.transform ` options] [ ]
412
+ - ` plaintextLength ` {number}
413
+ - Returns: {Decipher} for method chaining.
411
414
412
415
When using an authenticated encryption mode (only ` GCM ` and ` CCM ` are currently
413
416
supported), the ` decipher.setAAD() ` method sets the value used for the
414
417
_ additional authenticated data_ (AAD) input parameter.
415
418
419
+ The ` options ` argument is optional for ` GCM ` . When using ` CCM ` , the
420
+ ` plaintextLength ` option must be specified and its value must match the length
421
+ of the plaintext in bytes. See [ CCM mode] [ ] .
422
+
416
423
The ` decipher.setAAD() ` method must be called before [ ` decipher.update() ` ] [ ] .
417
424
418
425
### decipher.setAuthTag(buffer)
@@ -424,7 +431,7 @@ changes:
424
431
description: This method now returns a reference to `decipher`.
425
432
-->
426
433
- ` buffer ` {Buffer | TypedArray | DataView}
427
- - Returns: {Cipher } for method chaining.
434
+ - Returns: {Decipher } for method chaining.
428
435
429
436
When using an authenticated encryption mode (only ` GCM ` and ` CCM ` are currently
430
437
supported), the ` decipher.setAuthTag() ` method is used to pass in the
@@ -448,7 +455,7 @@ The `decipher.setAuthTag()` method must be called before
448
455
added: v0.7.1
449
456
-->
450
457
- ` autoPadding ` {boolean} ** Default:** ` true `
451
- - Returns: {Cipher } for method chaining.
458
+ - Returns: {Decipher } for method chaining.
452
459
453
460
When data has been encrypted without standard block padding, calling
454
461
` decipher.setAutoPadding(false) ` will disable automatic padding to prevent
0 commit comments