summaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorMatej Pjafjar <badbytes@freehaven.net>2002-08-22 07:30:03 +0000
committerMatej Pjafjar <badbytes@freehaven.net>2002-08-22 07:30:03 +0000
commit01aadefbfc7dbd99ddaff922b897996b768cf2f9 (patch)
tree1b179ece1205951776136d4976915e39c27410ee /src/common/crypto.h
parentac942bb365d7f100c3ceabb7c3ed470b51aebde6 (diff)
downloadtor-01aadefbfc7dbd99ddaff922b897996b768cf2f9.tar.gz
tor-01aadefbfc7dbd99ddaff922b897996b768cf2f9.zip
Changed crypto calls to go through common/crypto.[hc] instead of calling OpenSSL directly.
svn:r76
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index e35c8e74c5..b58b300a4c 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -5,11 +5,8 @@
#ifndef __CRYPTO_H
#define __CRYPTO_H
-#include <openssl/err.h>
+#include <stdio.h>
#include <openssl/rsa.h>
-#include <openssl/pem.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
/* available encryption primitives */
#define CRYPTO_CIPHER_IDENTITY 0
@@ -54,13 +51,17 @@ int crypto_pk_read_public_key(crypto_pk_env_t *env, FILE *src);
int crypto_pk_write_private_key(crypto_pk_env_t *env, FILE *dest);
int crypto_pk_write_public_key(crypto_pk_env_t *env, FILE *dest);
int crypto_pk_check_key(crypto_pk_env_t *env);
+int crypto_pk_read_private_key_filename(crypto_pk_env_t *env, unsigned char *keyfile);
int crypto_pk_set_key(crypto_pk_env_t *env, unsigned char *key);
+int crypto_pk_cmp_keys(crypto_pk_env_t *a, crypto_pk_env_t *b);
+int crypto_pk_keysize(crypto_pk_env_t *env);
int crypto_pk_public_encrypt(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to, int padding);
int crypto_pk_private_decrypt(crypto_pk_env_t *env, unsigned char *from, int fromlen, unsigned char *to, int padding);
/* symmetric crypto */
+int crypto_cipher_generate_key(crypto_cipher_env_t *env);
int crypto_cipher_set_iv(crypto_cipher_env_t *env, unsigned char *iv);
int crypto_cipher_set_key(crypto_cipher_env_t *env, unsigned char *key);
int crypto_cipher_encrypt_init_cipher(crypto_cipher_env_t *env);