summaryrefslogtreecommitdiff
path: root/src/lib/ctime/lib_ctime.dox
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-05 08:05:49 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-05 08:05:49 -0500
commit8933789fef0e2014852df6ae55b5435b9d3256b2 (patch)
tree03cba4960d76656fd248e60d4d749152bdc62340 /src/lib/ctime/lib_ctime.dox
parent60d5ff303d65bb7caf5c064675c661faac4cecf1 (diff)
parentaac80a004f91a453733fed0ba62c00d7d1e2b76d (diff)
downloadtor-8933789fef0e2014852df6ae55b5435b9d3256b2.tar.gz
tor-8933789fef0e2014852df6ae55b5435b9d3256b2.zip
Merge branch 'doxygen_libs'
Diffstat (limited to 'src/lib/ctime/lib_ctime.dox')
-rw-r--r--src/lib/ctime/lib_ctime.dox16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/ctime/lib_ctime.dox b/src/lib/ctime/lib_ctime.dox
index 476c95991c..2bcd0f036a 100644
--- a/src/lib/ctime/lib_ctime.dox
+++ b/src/lib/ctime/lib_ctime.dox
@@ -1,4 +1,16 @@
/**
-@dir lib/ctime
-@brief lib/ctime
+@dir /lib/ctime
+@brief lib/ctime: Constant-time code to avoid side-channels.
+
+This module contains constant-time implementations of various
+data comparison and table lookup functions. We use these in preference to
+memcmp() and so forth, since memcmp() can leak information about its inputs
+based on how fast it returns. In general, your code should call tor_memeq()
+and tor_memneq(), not memcmp().
+
+We also define some _non_-constant-time wrappers for memcmp() here: Since we
+consider calls to memcmp() to be in error, we require that code that actually
+doesn't need to be constant-time to use the fast_memeq() / fast_memneq() /
+fast_memcmp() aliases instead.
+
**/