]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add note about use of tor_memcmp()
authorNick Mathewson <nickm@torproject.org>
Wed, 5 Sep 2018 13:11:53 +0000 (09:11 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 5 Sep 2018 13:11:53 +0000 (09:11 -0400)
src/lib/ctime/di_ops.c

index 011baf2654c85dcfb1420c638875d410ea0eba58..73441f84f80c8d9cc635ce8a07ac9982bd469b80 100644 (file)
@@ -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 <b>a</b> and <b>b</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)