Browse Source

Aargl!! On equality, d==0! Might solve JSON-164?

pull/1/head Release_2.1.0-RC27
Roker 5 years ago
parent
commit
416ab7ac5b
  1. 3
      constant_time_algo.cc

3
constant_time_algo.cc

@ -13,7 +13,8 @@ namespace pEp
d |= ( static_cast<unsigned>(a[idx]) ^ static_cast<unsigned>(b[idx]) ); d |= ( static_cast<unsigned>(a[idx]) ^ static_cast<unsigned>(b[idx]) );
} }
return d != 0; // if d is still 0, the strings are equal.
return d == 0;
} }
} // end of namespace pEp } // end of namespace pEp

Loading…
Cancel
Save