summaryrefslogtreecommitdiff
path: root/src/lib/ctime
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-04 10:19:41 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-04 10:21:10 -0500
commit51a98929148e9ca08b33735fb0542759380c57a9 (patch)
tree96951d1d564d4ac379e9feba4a28807c2855e875 /src/lib/ctime
parentb6b125709998a81d9c9c23d77c6a770ca7a927a7 (diff)
downloadtor-51a98929148e9ca08b33735fb0542759380c57a9.tar.gz
tor-51a98929148e9ca08b33735fb0542759380c57a9.zip
doxygen: Take "lib" descriptions from doc/HACKING/design.
This commit takes descriptions for src/lib and moves them into our doxygen hierarchy. I've covered everything from lib/cc through lib/sandbox here.
Diffstat (limited to 'src/lib/ctime')
-rw-r--r--src/lib/ctime/lib_ctime.dox14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/ctime/lib_ctime.dox b/src/lib/ctime/lib_ctime.dox
index 476c95991c..bf95b03165 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
+@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.
+
**/