#include "constant_time_algo.hh" namespace pEp { bool constant_time_equal(const std::string& a, const std::string& b) { if(a.size() != b.size()) return false; unsigned d = 0; for(std::size_t idx = 0; idx(a[idx]) ^ static_cast(b[idx]) ); } // if d is still 0, the strings are equal. return d == 0; } } // end of namespace pEp