summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-03-30 19:47:32 +0000
committerNick Mathewson <nickm@torproject.org>2004-03-30 19:47:32 +0000
commit6ea95488d2e2b519a33bd7c2f391b520a6dc6b97 (patch)
tree006e392500cc8439c4db421a6b29e0a002e860f9 /src/common/crypto.h
parentabcf3d934186d02e54253a57504138b900521ef7 (diff)
downloadtor-6ea95488d2e2b519a33bd7c2f391b520a6dc6b97.tar.gz
tor-6ea95488d2e2b519a33bd7c2f391b520a6dc6b97.zip
Add more key manipulation functions, and base32 functions, to crypto
svn:r1395
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index f371f416ae..761a8d9fc2 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -20,6 +20,8 @@
#define CRYPTO_SHA1_DIGEST 0
+#define CRYPTO_SHA1_DIGEST_LEN 20
+
typedef struct crypto_pk_env_t crypto_pk_env_t;
typedef struct crypto_cipher_env_t crypto_cipher_env_t;
typedef struct crypto_digest_env_t crypto_digest_env_t;
@@ -58,11 +60,15 @@ int crypto_pk_private_decrypt(crypto_pk_env_t *env, unsigned char *from, int fro
int crypto_pk_private_sign(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
int crypto_pk_public_checksig(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to);
#define FINGERPRINT_LEN 49
+int crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, int dest_len);
+crypto_pk_env_t *crypto_pk_asn1_decode(const char *str, int len);
+int crypto_pk_get_digest(crypto_pk_env_t *pk, char *digest_out);
int crypto_pk_get_fingerprint(crypto_pk_env_t *pk, char *fp_out);
int crypto_pk_check_fingerprint_syntax(const char *s);
int base64_encode(char *dest, int destlen, const char *src, int srclen);
int base64_decode(char *dest, int destlen, const char *src, int srclen);
+int base32_encode(char *dest, int destlen, const char *src, int srclen);
/* Key negotiation */
typedef struct crypto_dh_env_st {