aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2016-03-11 10:46:21 -0500
committerRoger Dingledine <arma@torproject.org>2016-03-11 10:46:21 -0500
commitdc500c8cb4dc7643230d160d1b458a0acdadd242 (patch)
treeacb3b1d66543f608f430b5aa3095bf6bf119687e /src/or
parent53902963383e1babfccb8a4ffc7ed4e8accf2214 (diff)
downloadtor-dc500c8cb4dc7643230d160d1b458a0acdadd242.tar.gz
tor-dc500c8cb4dc7643230d160d1b458a0acdadd242.zip
rip out rend_id_is_in_interval()
it was used by hid_serv_responsible_for_desc_id(), which we no longer use.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/rendcommon.c31
-rw-r--r--src/or/rendcommon.h1
2 files changed, 0 insertions, 32 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 79aba80694..438fbc4d9a 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -688,37 +688,6 @@ rend_get_service_id(crypto_pk_t *pk, char *out)
return 0;
}
-/** Determines whether <b>a</b> is in the interval of <b>b</b> (excluded) and
- * <b>c</b> (included) in a circular digest ring; returns 1 if this is the
- * case, and 0 otherwise.
- */
-int
-rend_id_is_in_interval(const char *a, const char *b, const char *c)
-{
- int a_b, b_c, c_a;
- tor_assert(a);
- tor_assert(b);
- tor_assert(c);
-
- /* There are five cases in which a is outside the interval ]b,c]: */
- a_b = tor_memcmp(a,b,DIGEST_LEN);
- if (a_b == 0)
- return 0; /* 1. a == b (b is excluded) */
- b_c = tor_memcmp(b,c,DIGEST_LEN);
- if (b_c == 0)
- return 0; /* 2. b == c (interval is empty) */
- else if (a_b <= 0 && b_c < 0)
- return 0; /* 3. a b c */
- c_a = tor_memcmp(c,a,DIGEST_LEN);
- if (c_a < 0 && a_b <= 0)
- return 0; /* 4. c a b */
- else if (b_c < 0 && c_a < 0)
- return 0; /* 5. b c a */
-
- /* In the other cases (a c b; b a c; c b a), a is inside the interval. */
- return 1;
-}
-
/** Return true iff <b>query</b> is a syntactically valid service ID (as
* generated by rend_get_service_id). */
int
diff --git a/src/or/rendcommon.h b/src/or/rendcommon.h
index bab53fc1f6..c520c0634d 100644
--- a/src/or/rendcommon.h
+++ b/src/or/rendcommon.h
@@ -53,7 +53,6 @@ int rend_encode_v2_descriptors(smartlist_t *descs_out,
int rend_compute_v2_desc_id(char *desc_id_out, const char *service_id,
const char *descriptor_cookie,
time_t now, uint8_t replica);
-int rend_id_is_in_interval(const char *a, const char *b, const char *c);
void rend_get_descriptor_id_bytes(char *descriptor_id_out,
const char *service_id,
const char *secret_id_part);