crypto: use byteLength in timingSafeEqual
This is a revival of https://github.com/nodejs/node/pull/23341 which has shown no activity since last year. I fixed the branch, changed the error description as suggested by @jasnell in https://github.com/nodejs/node/pull/23341#discussion_r235443728, and simplified the test case.
cc @nodejs/crypto
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines