doc : mention constant-time in crypto doc

Included reference to 'constant time' in
crypto.timingSafeEqual description.

The Node website would score higher on a Google search
and the API would be more discoverable if it used the words
"constant time" in its description.

PR-URL: https://github.com/nodejs/node/pull/16604
Fixes: https://github.com/nodejs/node/issues/16504
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Mithun Sasidharan 2017-10-30 21:22:18 +05:30 committed by Joyee Cheung
parent 367db920e3
commit 841e305e4c

View File

@ -1969,6 +1969,7 @@ added: v6.6.0
- `a` {Buffer | TypedArray | DataView} - `a` {Buffer | TypedArray | DataView}
- `b` {Buffer | TypedArray | DataView} - `b` {Buffer | TypedArray | DataView}
This function is based on a constant-time algorithm.
Returns true if `a` is equal to `b`, without leaking timing information that Returns true if `a` is equal to `b`, without leaking timing information that
would allow an attacker to guess one of the values. This is suitable for would allow an attacker to guess one of the values. This is suitable for
comparing HMAC digests or secret values like authentication cookies or comparing HMAC digests or secret values like authentication cookies or