aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-01 22:10:33 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-01 22:10:33 +0000
commitcbbd13f789d49182e3302fd401d9393e3fc276a4 (patch)
treeeb31be788ac968e740afb78259b7995bec91bdde /src/or
parentcc8dc4e34c4035a8e26d84204ac19973ab06c76d (diff)
downloadtor-cbbd13f789d49182e3302fd401d9393e3fc276a4.tar
tor-cbbd13f789d49182e3302fd401d9393e3fc276a4.tar.gz
Add new functions to wrap digest and sign/checksig.
svn:r1436
Diffstat (limited to 'src/or')
-rw-r--r--src/or/test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 18b7541f2..d09f7bd12 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -406,6 +406,11 @@ test_crypto()
test_eq(128, crypto_pk_private_sign(pk1, data1, 10, data2));
test_eq(10, crypto_pk_public_checksig(pk1, data2, 128, data3));
test_streq(data3, "Ossifrage");
+ /* Try signing digests. */
+ test_eq(128, crypto_pk_private_sign_digest(pk1, data1, 10, data2));
+ test_eq(20, crypto_pk_public_checksig(pk1, data2, 128, data3));
+ test_eq(0, crypto_pk_public_checksig_digest(pk1, data1, 10, data2, 128));
+ test_eq(-1, crypto_pk_public_checksig_digest(pk1, data1, 11, data2, 128));
/*XXXX test failed signing*/
/* Try encoding */