diff options
author | ZaneHannanAU <ZaneHannanAU@users.noreply.github.com> | 2018-06-20 20:24:30 +1000 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2018-06-24 15:59:08 +0300 |
commit | c041fd2dc7c5a2b6d7a83bc68f40ab9ad72b6797 (patch) | |
tree | 2ccbab2ae32709ae1fd4b359cdc292600c43582f /doc | |
parent | cdb59854ee6c13712d17af729a42d5221d6af8f2 (diff) | |
download | android-node-v8-c041fd2dc7c5a2b6d7a83bc68f40ab9ad72b6797.tar.gz android-node-v8-c041fd2dc7c5a2b6d7a83bc68f40ab9ad72b6797.tar.bz2 android-node-v8-c041fd2dc7c5a2b6d7a83bc68f40ab9ad72b6797.zip |
doc: correct parameters, return types in crypto.md
PR-URL: https://github.com/nodejs/node/pull/21420
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/crypto.md | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 66b50f7069..e8acd1d0d8 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -245,7 +245,8 @@ once will result in an error being thrown. added: v1.0.0 --> - `buffer` {Buffer} -- `options` {Object} +- `options` {Object} [`stream.transform` options][] + - `plaintextLength` {number} - Returns: {Cipher} for method chaining. 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 no longer be used to decrypt data. Attempts to call `decipher.final()` more than once will result in an error being thrown. -### decipher.setAAD(buffer) +### decipher.setAAD(buffer[, options]) <!-- YAML added: v1.0.0 changes: @@ -407,12 +408,18 @@ changes: description: This method now returns a reference to `decipher`. --> - `buffer` {Buffer | TypedArray | DataView} -- Returns: {Cipher} for method chaining. +- `options` {Object} [`stream.transform` options][] + - `plaintextLength` {number} +- Returns: {Decipher} for method chaining. When using an authenticated encryption mode (only `GCM` and `CCM` are currently supported), the `decipher.setAAD()` method sets the value used for the _additional authenticated data_ (AAD) input parameter. +The `options` argument is optional for `GCM`. When using `CCM`, the +`plaintextLength` option must be specified and its value must match the length +of the plaintext in bytes. See [CCM mode][]. + The `decipher.setAAD()` method must be called before [`decipher.update()`][]. ### decipher.setAuthTag(buffer) @@ -427,7 +434,7 @@ changes: description: This method now returns a reference to `decipher`. --> - `buffer` {Buffer | TypedArray | DataView} -- Returns: {Cipher} for method chaining. +- Returns: {Decipher} for method chaining. When using an authenticated encryption mode (only `GCM` and `CCM` are currently supported), the `decipher.setAuthTag()` method is used to pass in the @@ -453,7 +460,7 @@ The `decipher.setAuthTag()` method must be called before added: v0.7.1 --> - `autoPadding` {boolean} **Default:** `true` -- Returns: {Cipher} for method chaining. +- Returns: {Decipher} for method chaining. When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent |