aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-09-18 17:07:56 +0000
committerRoger Dingledine <arma@torproject.org>2007-09-18 17:07:56 +0000
commitf15a4c8bd762d1eb6cada0334f81a71f424626ec (patch)
tree27afc3e81b555e3a875c76cc53654a205adbb67d /src/common/crypto.h
parent5985135ed69d10ca35bcfdb4cbfe6d60ad3de61d (diff)
downloadtor-f15a4c8bd762d1eb6cada0334f81a71f424626ec.tar
tor-f15a4c8bd762d1eb6cada0334f81a71f424626ec.tar.gz
add some crypto/util functions from karsten, as the first
step of integrating his new hidden service stuff svn:r11489
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 5dc52f329..1d1f758fc 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -124,6 +124,11 @@ int crypto_cipher_encrypt(crypto_cipher_env_t *env, char *to,
int crypto_cipher_decrypt(crypto_cipher_env_t *env, char *to,
const char *from, size_t fromlen);
+int crypto_cipher_encrypt_cbc(const char *key, char *to, size_t tolen,
+ const char *from, size_t fromlen);
+int crypto_cipher_decrypt_cbc(const char *key, char *to, size_t tolen,
+ const char *from, size_t fromlen);
+
/* SHA-1 */
int crypto_digest(char *digest, const char *m, size_t len);
crypto_digest_env_t *crypto_new_digest_env(void);
@@ -164,6 +169,7 @@ int base64_decode(char *dest, size_t destlen, const char *src, size_t srclen);
/** Characters that can appear (case-insensitively) in a base-32 encoding. */
#define BASE32_CHARS "abcdefghijklmnopqrstuvwxyz234567"
void base32_encode(char *dest, size_t destlen, const char *src, size_t srclen);
+int base32_decode(char *dest, size_t destlen, const char *src, size_t srclen);
int digest_to_base64(char *d64, const char *digest);
int digest_from_base64(char *digest, const char *d64);