You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libpEpAdapter/constant_time_algo.hh

15 lines
450 B
C++

#pragma once
#include <string>
namespace pEp
{
// Returns false if a.size() != b.size().
// Compares always _all_ characters of 'a' and 'b' so runtime does not
// depends on the character position where the strings differ.
// Use this function instead of operator== if timing sidechannel attack
// might be a security problem.
bool constant_time_equal(const std::string& a, const std::string& b);
} // end of namespace pEp