aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-05 09:11:53 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-05 09:11:53 -0400
commitdc7c97945344169ca560a95c73ebc47be582f898 (patch)
tree238b2698b4b10b3141da633d32c80d768a0c1cd1 /src
parent79a7fbb79b7f5a5a8bb3552f3c071498a34e5b84 (diff)
downloadtor-dc7c97945344169ca560a95c73ebc47be582f898.tar.gz
tor-dc7c97945344169ca560a95c73ebc47be582f898.zip
Add note about use of tor_memcmp()
Diffstat (limited to 'src')
-rw-r--r--src/lib/ctime/di_ops.c3
1 files changed, 3 insertions, 0 deletions
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 <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)