summaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-18 02:22:21 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-18 02:22:21 +0000
commite86893e87b11e8cd7392ae22587ba2ab2d631dbf (patch)
tree5b60c3d7712595c969311eed61f662f51ea351b0 /src/or/test.c
parentf8a80e8d599d87ea18cb72b7b22441612f1e26ac (diff)
downloadtor-e86893e87b11e8cd7392ae22587ba2ab2d631dbf.tar.gz
tor-e86893e87b11e8cd7392ae22587ba2ab2d631dbf.zip
Move to new base64 digest functions. Switch to new router digest calculation. Make sure there are no duplicates in router status lists.
svn:r5088
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index b76a439395..5007589eba 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -511,6 +511,16 @@ test_crypto(void)
test_eq(j, 71);
test_assert(data2[i] == '\0');
+ crypto_rand(data1, DIGEST_LEN);
+ memset(data2, 100, 1024);
+ digest_to_base64(data2, data1);
+ test_eq(BASE64_DIGEST_LEN, strlen(data2));
+ test_eq(100, data2[BASE64_DIGEST_LEN+2]);
+ memset(data3, 99, 1024);
+ digest_from_base64(data3, data2);
+ test_memeq(data1, data3, DIGEST_LEN);
+ test_eq(99, data3[DIGEST_LEN+1]);
+
/* Base32 tests */
strcpy(data1, "5chrs");
/* bit pattern is: [35 63 68 72 73] ->