aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-07-01 01:16:59 +0000
committerNick Mathewson <nickm@torproject.org>2004-07-01 01:16:59 +0000
commit541add90a16a2b7b75e5aa3a54071f3a5db00502 (patch)
treee6fbde49f0a12931e102a5211651fd014d06f9b9 /src/common/crypto.h
parentf42f04c859a68dab45d021dd4197da816ec72b07 (diff)
downloadtor-541add90a16a2b7b75e5aa3a54071f3a5db00502.tar.gz
tor-541add90a16a2b7b75e5aa3a54071f3a5db00502.zip
Track routers by hash of identity key; use hex hash of identity key in place of nickname; accept (and use) hash of identity key in EXTEND cells.
svn:r1994
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index fa8380075e..09bb50f05a 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -37,6 +37,8 @@
/** Length of encoded public key fingerprints, including space; but not
* including terminating NUL. */
#define FINGERPRINT_LEN 49
+/** Length of hex encoding of SHA1 digest, not including final NUL. */
+#define HEX_DIGEST_LEN 40
typedef struct crypto_pk_env_t crypto_pk_env_t;
typedef struct crypto_cipher_env_t crypto_cipher_env_t;
@@ -91,6 +93,8 @@ int base64_encode(char *dest, int destlen, const char *src, int srclen);
int base64_decode(char *dest, int destlen, const char *src, int srclen);
#define BASE32_CHARS "abcdefghijklmnopqrstuvwxyz234567"
int base32_encode(char *dest, int destlen, const char *src, int srclen);
+int base16_encode(char *dest, int destlen, const char *src, int srclen);
+int base16_decode(char *dest, int destlen, const char *src, int srclen);
/* Key negotiation */
crypto_dh_env_t *crypto_dh_new();