After trying to use crypto.timingSafeEqual with two buffers that have different length I've got an exception.
I read the docs and realized that crypto.timingSafeEqual is supporting only buffers with the same length which is contradicting the concept of timing safe compare.
The comparison code:
|
void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) { |
Maybe it's worth to implement it like that: https://github.com/vadimdemedes/secure-compare/blob/master/index.js#L12
After trying to use
crypto.timingSafeEqualwith two buffers that have different length I've got an exception.I read the docs and realized that
crypto.timingSafeEqualis supporting only buffers with the same length which is contradicting the concept of timing safe compare.The comparison code:
node/src/node_crypto.cc
Line 6065 in 51e0948
Maybe it's worth to implement it like that: https://github.com/vadimdemedes/secure-compare/blob/master/index.js#L12