2 @brief lib/ctime: Constant-time code to avoid side-channels.
4 This module contains constant-time implementations of various
5 data comparison and table lookup functions. We use these in preference to
6 memcmp() and so forth, since memcmp() can leak information about its inputs
7 based on how fast it returns. In general, your code should call tor_memeq()
8 and tor_memneq(), not memcmp().
10 We also define some _non_-constant-time wrappers for memcmp() here: Since we
11 consider calls to memcmp() to be in error, we require that code that actually
12 doesn't need to be constant-time to use the fast_memeq() / fast_memneq() /
13 fast_memcmp() aliases instead.