diff --git a/constant_time_algo.cc b/constant_time_algo.cc index 186a3e2..6e4c2c4 100644 --- a/constant_time_algo.cc +++ b/constant_time_algo.cc @@ -13,7 +13,8 @@ namespace pEp d |= ( static_cast(a[idx]) ^ static_cast(b[idx]) ); } - return d != 0; + // if d is still 0, the strings are equal. + return d == 0; } } // end of namespace pEp