From b48f83ab8c27b6a26d4afe5177238a99637a1dc1 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sun, 15 May 2011 19:20:42 -0400 Subject: [PATCH 1/2] minor tweaks to 4b19730c8234d --- src/common/di_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/di_ops.c b/src/common/di_ops.c index c1e292fe2f..3da033cf6d 100644 --- a/src/common/di_ops.c +++ b/src/common/di_ops.c @@ -3,7 +3,7 @@ /** * \file di_ops.c - * \brief Functions for data-independent operations + * \brief Functions for data-independent operations. **/ #include "orconfig.h" @@ -11,7 +11,7 @@ /** * Timing-safe version of memcmp. As memcmp, compare the sz bytes - * at a with the sz bytes at , and returns less than 0 if the + * at a with the sz bytes at , and return less than 0 if the * bytes at a lexically precede those at b, 0 if the byte ranges * are equal, and greater than zero if the bytes at a lexically follow * those at . From 10d670674aa49ee6764cf93fe7d3f485a3f9ffd8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 May 2011 19:56:05 -0400 Subject: [PATCH 2/2] Another doc tweak on tor_memcmp: b, not . --- src/common/di_ops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/di_ops.c b/src/common/di_ops.c index 3da033cf6d..b22a58d1b1 100644 --- a/src/common/di_ops.c +++ b/src/common/di_ops.c @@ -10,11 +10,11 @@ #include "di_ops.h" /** - * Timing-safe version of memcmp. As memcmp, compare the sz bytes - * at a with the sz bytes at , and return less than 0 if the - * bytes at a lexically precede those at b, 0 if the byte ranges - * are equal, and greater than zero if the bytes at a lexically follow - * those at . + * Timing-safe version of memcmp. As memcmp, compare the sz bytes at + * a with the sz bytes at b, and return less than 0 if + * the bytes at a lexically precede those at b, 0 if the byte + * ranges are equal, and greater than zero if the bytes at a lexically + * follow those at b. * * 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 @@ -85,7 +85,7 @@ tor_memcmp(const void *a, const void *b, size_t len) /** * Timing-safe memory comparison. Return true if the sz bytes at - * a are the same as the sz bytes at , and 0 otherwise. + * a are the same as the sz bytes at b, and 0 otherwise. * * This implementation differs from !memcmp(a,b,sz) in that its timing * behavior is not data-dependent: it should return in the same amount of time