From: Nick Mathewson Date: Wed, 5 Sep 2018 13:11:53 +0000 (-0400) Subject: Add note about use of tor_memcmp() X-Git-Tag: tor-0.3.5.1-alpha~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc7c97945344169ca560a95c73ebc47be582f898;p=thirdparty%2Ftor.git Add note about use of tor_memcmp() --- diff --git a/src/lib/ctime/di_ops.c b/src/lib/ctime/di_ops.c index 011baf2654..73441f84f8 100644 --- a/src/lib/ctime/di_ops.c +++ b/src/lib/ctime/di_ops.c @@ -23,6 +23,9 @@ * This implementation differs from memcmp in that its timing behavior is not * data-dependent: it should return in the same amount of time regardless of * the contents of a and b. + * + * Note that if all you care about is equality, this implementation is + * overkill: it would be better to use tor_memeq() or tor_memneq(). */ int tor_memcmp(const void *a, const void *b, size_t len)