aboutsummaryrefslogtreecommitdiff
path: root/src/common/di_ops.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-25 22:22:07 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-03 11:29:48 -0500
commitf07a5125cb5bb9ee5968ded163cfdd73e5ad028c (patch)
tree03444d1dbfe2a58e242e9923728971c7303717b9 /src/common/di_ops.h
parent92d6a83e9895da874eae81e20e14df20231f25bf (diff)
downloadtor-f07a5125cb5bb9ee5968ded163cfdd73e5ad028c.tar
tor-f07a5125cb5bb9ee5968ded163cfdd73e5ad028c.tar.gz
Implement a constant-time safe_mem_is_zero.
Diffstat (limited to 'src/common/di_ops.h')
-rw-r--r--src/common/di_ops.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/di_ops.h b/src/common/di_ops.h
index a86f56c96..144482811 100644
--- a/src/common/di_ops.h
+++ b/src/common/di_ops.h
@@ -27,6 +27,8 @@ int tor_memeq(const void *a, const void *b, size_t sz);
#define fast_memeq(a,b,c) (0==memcmp((a),(b),(c)))
#define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c)))
+int safe_mem_is_zero(const void *mem, size_t sz);
+
/** A type for a map from DIGEST256_LEN-byte blobs to void*, such that
* data lookups take an amount of time proportional only to the size
* of the map, and not to the position or presence of the item in the map.